Node Details

  • Name: ConditionAgent_SeqAgents

  • Type: ConditionAgent

  • Category: Sequential Agents

  • Version: 2.0

Parameters

Main Parameters

  1. Name (string)

    • Label: Name

    • Description: Name for the Condition Agent

  2. Sequential Node (Start | Agent | LLMNode | ToolNode)

    • Label: Start | Agent | LLM | Tool Node

    • Description: Previous nodes in the sequence

    • List: true

  3. Chat Model (BaseChatModel)

    • Label: Chat Model

    • Description: Overwrite model to be used for this agent

    • Optional: true

Prompt Parameters

  1. System Prompt (string)

    • Label: System Prompt

    • Description: System message for the agent

    • Optional: true

    • Default: Example prompt provided

  2. Human Prompt (string)

    • Label: Human Prompt

    • Description: Human message added at the end of the conversation

    • Optional: true

    • Default: Example prompt provided

  3. Format Prompt Values (json)

    • Label: Format Prompt Values

    • Description: Assign values to prompt variables

    • Optional: true

    • List: true

Output Configuration

  1. JSON Structured Output (datagrid)

    • Label: JSON Structured Output

    • Description: Instruct the LLM to give output in a JSON structured schema

    • Optional: true

Condition Configuration

  1. Condition (conditionFunction)

    • Label: Condition

    • Description: Function or table to evaluate the condition

    • Tabs: a. Condition (Table): Datagrid for defining conditions b. Condition (Code): JavaScript function for custom condition logic

Inputs

  • Previous node in the sequential flow

  • Chat model (optional)

  • Prompts and prompt values

  • Condition logic (table or code)

Outputs

  • Next: Connection to the next node if condition is met

  • End: Connection to end the flow if condition is not met

Functionality

  1. Initializes with previous nodes and configurations

  2. Prepares the agent with system and human prompts

  3. Executes the agent to evaluate the current state

  4. Applies the condition logic (either table-based or code-based)

  5. Determines the next step in the flow based on the condition result

Use Cases

  • Routing conversations based on user intent

  • Implementing decision trees in conversational flows

  • Applying business logic to determine next steps in a process

  • Filtering or categorizing responses before proceeding

Notes

  • The node supports both simple table-based conditions and complex JavaScript-based condition functions

  • It can use structured output from the LLM for more precise decision-making

  • The condition can access various parts of the conversation state, including previous messages and custom variables

Was this page helpful?