docs/guides/agent/agent_workflow/flow_components.md
Switch executes rule-based judgment and routes workflows to different downstream paths according to results.
At least one Case must be defined. Each Case can contain multiple conditions combined by AND / OR. Supported operators: Equals, Not equal, Greater than, Greater equal, Less than, Less equal, Contains, Not contains, Starts with, Ends with, Is empty, Not empty.
:::tip NOTE Switch is rule-based judgment for structured data and clear conditions. Categorize uses LLM-based classification for natural language intent recognition. :::
The Iteration component iterates over an array and repeatedly executes the same processing logic for each element. It is suitable for scenarios such as batch file processing or processing multiple data items with the same logic.
When configuring the Iteration component, set Query variables and Output.
sys.files or sys.history. The Iteration component processes each element in the array in sequence and executes the configured internal workflow.Note
The Iteration component is suitable when the input is an array and each element can be processed independently. For example, by selecting
sys.files, you can process multiple files uploaded by the user one by one.
Iteration splits text into fragments and executes the same set of internal components for each fragment. Suitable for long-text translation, paragraph-wise summarization, batch generation and item-by-item list processing.
Iteration contains built-in Loop Item. Components dragged inside Iteration can only be accessed within the loop. Reference Loop Item to obtain current fragment data.
When configuring the Loop component, you need to set the loop variables, loop termination condition, and maximum loop count.
:::tip NOTE Configure both termination condition and maximum loop count to avoid long-running infinite loops. :::
Categorize uses LLM to judge user intent or input category and branch the workflow based on classification results.
Use easy-to-understand category names, e.g. Product Consultation, Installation Reservation, After-sales Fault, Other Questions. Examples improve classification stability; provide 2~3 typical samples for each category.