Sub-Agents¶
A sub-agent is a workflow step that spawns a child workflow to handle a focused sub-task. Think of it as delegation: the parent workflow describes an objective in natural language, and the sub-agent plans and executes its own steps to accomplish it, then returns the result.
This is useful when part of a workflow requires deeper reasoning, a separate set of tools, or a different perspective than the main flow.
[Screenshot needed: Agent step in the workflow editor showing objective, briefing fields, and the parallel execution tab]
When to Use Sub-Agents¶
Sub-agents suit tasks that are too complex for a single step but have a clear deliverable:
- Research: "Summarise the top 5 competitors in this market"
- Analysis: "Review this contract and flag any unusual clauses"
- Content generation: "Draft three LinkedIn posts from different angles on this topic"
- Data processing: "Collect pricing data from these three sources and produce a comparison table"
For simple operations (formatting a value, filtering a list, calling a single API), a code step or integration step is more appropriate.
Configuring a Sub-Agent Step¶
In the workflow editor, an Agent step has the following fields:
- Objective: A natural language description of what the sub-agent should accomplish. This supports variable interpolation from previous steps, so you can pass dynamic context.
- Briefing (optional): Key facts, constraints, and role information that shape the sub-agent's behaviour. For example, you might specify "You are a financial analyst" or "Only use data from the last 30 days".
- Allowed integrations (optional): A whitelist of services the sub-agent may use (e.g., "slack", "gmail"). If omitted, the sub-agent can use all services available to you.
- Budget limit: The maximum the sub-agent may spend. Defaults to $1.00, with a range of $0 to $100. The parent workflow's remaining budget is divided among its children.
Parallel Execution¶
Sub-agents can run multiple child workflows at the same time. There are two modes for this.
Split work across children¶
Set a parallel count (up to 5) and optionally a variable to vary across the children. For example:
- Objective: "Research {{competitor}} and summarise their pricing strategy"
- Variable:
competitor - Values:
["Apple", "Google", "Microsoft"]
This spawns three child workflows, each researching a different competitor. The budget is split evenly among them.
Multi-perspective mode¶
Define named perspectives, each with a role, area of expertise, and focus. For example:
- Legal Analyst: focus on compliance risks
- Financial Analyst: focus on cost implications
- Technical Lead: focus on integration feasibility
Each perspective runs as a separate child workflow, and the results are aggregated. You choose how results are combined:
- List: Returns an array of all outputs
- Merge: Concatenates the text outputs
- Best: Returns the first successful result
Budget and Safety Limits¶
Sub-agents operate within several guardrails:
| Limit | Value | Purpose |
|---|---|---|
| Default budget per agent | $1.00 | Prevents runaway spending on a single sub-task |
| Budget range | $0 -- $100 | Configurable per step |
| Maximum nesting depth | 10 | Prevents unbounded recursive spawning |
| Inactivity timeout | 10 minutes | Terminates sub-agents that appear stuck |
| Maximum identical retries | 3 | Stops repeating the same failing action |
| Depth warning threshold | 5 | Logs a warning (does not block execution) |
Budget is the primary constraint. It naturally limits how much work a sub-agent can do. The depth limit and inactivity timeout are infrastructure safeguards that protect against edge cases.
When a sub-agent exhausts its budget, it stops and returns whatever partial results it has produced. The parent workflow continues with those partial results.
Enabling and Disabling Sub-Agents¶
You can control whether your workflows are allowed to spawn sub-agents through the collaboration.allow_agent_spawning toggle in Settings under Collaboration → Allow Dynamic Agent Spawning. This is disabled by default. You must enable it before using Agent steps. If it is disabled, any Agent step in a workflow will return an error explaining that dynamic agent spawning is turned off.
Sub-Agents in Virtual Run¶
During a Virtual Run preview, Agent steps are simulated. You see what the sub-agent would produce, including:
- The generated child workflow plan
- The objective and briefing sent to the child
- The expected cost breakdown
This lets you verify that the sub-agent's scope and budget are appropriate before running the workflow live.
See also: