Agent Outcomes
Last updated
Last updated
In xFlow, the AI Agent State leverages Agent Outcomes to define the actions that should be taken based on the results produced by the AI agent. This documentation explains the properties of Agent Outcomes, their purpose, and how they can be configured to ensure that the workflow transitions correctly based on the AI agent's output.
Agent Outcomes are critical for defining the behavior of the AI agent within a workflow. They specify conditions, actions, and transitions that should occur based on the AI agent's responses. Below are the key properties of Agent Outcomes, along with examples for each.
Name: condition
Type: string
Description: An expression that must evaluate to true for this outcome to be matched. If the condition evaluates to false, the outcome is disregarded. The condition is typically used to check the AI agent's output or any relevant workflow data. These expressions follow the .
Example:
Name: finish
Type: boolean
Default: false
Description: If set to true
, the agent will finish after this action is executed. If set to false
, the agent will continue to process other actions or outcomes. This property is used to control whether the workflow should proceed further with the AI agent's execution.
Example:
Name: dataFilter
Type: object
Example:
Name: transition
Type: object
Description: Defines the outgoing transition when the outcome is selected. If not defined, the default transition will be used. The transition specifies the next state to move to in the workflow.
Example:
Agent Outcomes serve several important purposes in the context of AI agents within xFlow:
Conditional Execution: By defining conditions, workflows can execute specific actions only when certain criteria are met. This allows for more dynamic and responsive workflows that can adapt to different AI agent outputs.
Workflow Control: The finish
property allows for precise control over the workflow's execution flow, determining whether the AI agent should continue processing or terminate after a certain outcome.
Data Management: The dataFilter
property ensures that only relevant data is passed to subsequent states, reducing unnecessary data processing and improving workflow efficiency.
State Transitions: The transition
property clearly defines the next steps in the workflow, ensuring smooth and logical progression based on the AI agent's outcomes.
Here is an example of how to configure Agent Outcomes in an AI Agent State within a xFlow workflow:
Description: Defines the data filter to be applied to the event data. Data filters are used to control which parts of the data should be passed along to subsequent workflow states. More details can be found in the .
For more detailed information and advanced configurations, refer to the .