🚀 New Release: Introducing AI Agent for Ecommerce: Sell more. Support faster. Grow smarter.

Book your AI agent demo
Start for free
Table of Content

    How to Apply Conditions in your AI Agent workflow

    • June 25, 2026
    • 4 mins read

    Table of Content

      Conditions allow you to create different paths inside a workflow based on specific logic. You can use conditions to decide what should happen next after the AI Agent generates a response.

      For example, you can configure a condition where:

      • If the customer asks for human support, the workflow sends the conversation to a human agent.
      • If the AI Agent can answer the question, the workflow sends the response directly to the customer.

      This helps you create a more controlled automation flow and improves the customer experience.

      Advance Wize Agent Automation

      Configure Human Handover Using a Condition

      You can use a condition node to route customers to a human agent when the AI Agent detects that human support is required.

      In this example, the workflow checks whether the AI Agent output includes a value called “requested_humanhandover”. If the value is “true”, the workflow routes the conversation to a human agent.

      Step 1: Create the required attribute

      Before using the condition, create the attribute that will store the handover request.

      Go to: Settings > General Settings > Attributes

      Create an attribute named: requested_humanhandover

      Create an custom attribute

      This attribute will be used to check whether the customer should be transferred to a human agent.

      Step 2: Add the output schema to the AI Agent

      Add the output schema to the AI Agent

      Open the AI Agent node and enable the option to require a specific output format.

      In the Input schema section, add the following JSON schema:

      {
      “type”: “object”,
        “properties”: {“requested_humanhandover”: {“type”: “boolean” }},
        “required”: [“requested_humanhandover”]
      }

      This schema tells the AI Agent to return a structured value for requested_humanhandover.

      Step 3: Update the AI Agent prompt

      In the AI Agent prompt, clearly explain when the AI Agent should request human handover.

      Example instruction: If the customer asks for human support, refund disputes, order issues, payment problems, complaints, technical issues not covered in the knowledge base, or information that cannot be found in the available tools, set requested_humanhandover to true.

      When human handover is required, use this response:

      “I’d like to connect you with one of our support specialists who can assist you further.”

      This helps the AI Agent decide when the workflow should continue to human handover.

      Step 4: Add a Condition node

      Add a Condition node

      To apply the handover logic:

      • Click the + button after the AI Agent node.
      • Select Condition.
      • Open the Condition node.
      • In the right-side data panel, go to Nodes > AI Agent > structured_response.
      • Drag requested_humanhandover into the condition field.
      • Set the comparison rule to Equals to.
      • Enter the value: true

      The condition should check whether the AI Agent returned requested_humanhandover as true.

      Step 5: Connect the condition paths

      After configuring the condition, connect the workflow paths:

      Condition result Workflow action
      True Connect to the Human handover node.
      False Connect to the Response To Chat node.

      This means that when the customer needs human support, the workflow transfers the conversation to a live agent. Otherwise, the AI Agent response is sent directly to the customer.

      Test the advanced workflow

      After adding the Knowledge Base tool, Google Sheet tool, condition logic, and human handover, test the workflow before activating it.

      Use the Test Flow panel and try different customer messages.

      Expected result:

      • The workflow starts from the On chat message trigger.
      • The AI Agent detects that the customer wants human support.
      • The condition checks requested_humanhandover.
      • If the value is true, the workflow executes the Human handover node.
      • The customer is routed to a human agent.
      Test the advanced workflow

      Recommended advanced workflow structure

      A typical advanced Wize AI Agent workflow may include the following flow:

      →On chat message
      → AI Agent
      → Knowledge Base tool / Google Sheet tool
      → Condition
      → Human handover or Response to Chat

      This structure allows the AI Agent to understand the customer message, check available business data, decide whether human support is needed, and respond or transfer the conversation accordingly.

      Best practices

      • Use the Knowledge Base tool for support policies, FAQs, help articles, and general business information.
      • Use Google Sheets for structured data such as product inventory, prices, stock status, ratings, and order records.
      • Write a detailed prompt that defines the AI Agent’s role, tone, available sources, and response rules.
      • Use structured output when your workflow depends on conditions.
      • Keep attribute names consistent across the AI Agent schema, condition node, and system attributes.
      • Always test both successful AI responses and human handover scenarios before activating the workflow.
      • Review execution logs to confirm each node runs correctly.

      Next Step

      You have now learned how to use conditions to build intelligent decision-making into your AI Agent workflow. Next, we will show you how to add multiple AI Agents within a single workflow, allowing each agent to specialize in different tasks or knowledge domains while working together to handle complex customer conversations.

      👉 Continue to: How to Add Multiple AI Agents in a Single Workflow

      AUTHOR’S BIO

      Khalid Hassan Emran is a Senior Technical Content Writer with more than 5 years of experience in technical documentation, content marketing, and blog writing. He specializes in simplifying complex technical concepts into clear, engaging content. In addition, he is an ...

      0:00 / 0:00