Skip to main content

Module workflow

Module workflow 

Source
Expand description

Deterministic workflow agent primitives.

These composable agents orchestrate sub-agents without LLM calls:

Structs§

LoopAgent
Runs a single agent in a loop. Stops when should_stop returns true on the output text, or when max_iterations is reached. Returns the final iteration’s output with accumulated TokenUsage.
LoopAgentBuilder
Builder for LoopAgent.
ParallelAgent
Runs multiple sub-agents concurrently via tokio::JoinSet. All agents receive the same input task. Returns merged results with accumulated TokenUsage.
ParallelAgentBuilder
Builder for ParallelAgent.
SequentialAgent
Runs a list of sub-agents in order. Each agent receives the previous agent’s text output as its task input. Returns the final agent’s output with accumulated TokenUsage.
SequentialAgentBuilder
Builder for SequentialAgent.

Enums§

WorkflowRouter
Routes execution to one of the workflow agent types. Allows config-driven workflow selection without hardcoding the type.
WorkflowType
Identifies which workflow pattern to use.