Node Details

  • Name: seqLoop

  • Label: Loop

  • Version: 2.0

  • Type: Loop

  • Category: Sequential Agents

  • Base Class: Loop

Parameters

The Loop node accepts the following input parameters:

  1. Agent | Condition | LLM | Tool Node

    • Name: sequentialNode

    • Type: Agent | Condition | LLMNode | ToolNode

    • Description: The predecessor node(s) in the sequence

    • Required: Yes

    • List: Yes (can accept multiple nodes)

  2. Loop To

    • Name: loopToName

    • Type: string

    • Description: Name of the agent/LLM to loop back to

    • Required: Yes

    • Placeholder: “Agent”

Input/Output

Input

  • The node requires at least one predecessor node (Agent, Condition, LLM, or Tool).

  • The name of the node to loop back to must be specified.

Output

  • The node’s output is hidden (hideOutput: true).

  • It returns an ISeqAgentNode object containing:

    • id: The node’s ID

    • node: The name of the node to loop to (lowercase, underscores instead of spaces)

    • name: Same as ‘node’

    • label: The original label of the node to loop to

    • type: Always set to ‘agent’

    • predecessorAgents: Array of input sequential nodes

    • output: Same as ‘node’

Usage

The Loop node is used to create cycles in sequential agent workflows. It’s particularly useful for:

  1. Implementing iterative processes where certain steps need to be repeated.

  2. Creating conditional loops where the workflow returns to a previous state based on certain conditions.

  3. Building complex decision trees or state machines within agent-based systems.

To use the Loop node:

  1. Connect it to one or more predecessor nodes in the sequence.

  2. Specify the name of the node you want to loop back to in the “Loop To” field.

The node will then create a loop in the workflow, directing the execution back to the specified node when reached.

Error Handling

The node will throw an error if:

  • No predecessor nodes are provided

  • The “Loop To” name is not specified