Overview
Theswrm node type lets you fan out to a static, author-defined set of agents that all run concurrently against the same workflow input. After every agent completes, an optional synthesis step combines their outputs into a single response.
This pattern is sometimes called a committee of experts: each agent contributes a specialist perspective, and a final model synthesises them into a coherent answer.
Node Fields
Agents
Each entry in theagents list is a self-contained LLM call with its own provider, model, and prompt template.
Agent Fields
Template Interpolation
Prompts inagents and the synthesis block support {{ variable }} placeholders. The template namespace includes:
Example
Synthesis
The optionalsynthesis block is a single LLM call that runs after all agents have completed. Its prompt can reference every agent’s output. The synthesis output becomes the node’s canonical output.
Synthesis Fields
Output Shape
After a swrm node executes, its results are written to the workflow context:Accessing Results
In downstream nodes or edges, reference swrm outputs like any other context value:Concurrency
By default, all agents run in parallel. Setconcurrency to limit the number of agents executing simultaneously:
Failure Policy
Control what happens when one or more agents raise an error usingon_failure:
SwrmAgentError
When on_failure: abort (the default), any agent failure raises SwrmAgentError:
Committee-of-Experts Pattern
The committee-of-experts pattern decomposes a complex analytical task into specialist sub-tasks and then synthesises the results:- Analysing a document from multiple angles (sentiment + risk + opportunity)
- Generating multiple candidate responses and picking the best
- Parallelising independent LLM calls to reduce total latency
- Building a reviewer panel where each agent judges a different criterion
- Tasks where agents need to share intermediate state (use sequential nodes with edges)
- Dynamic agent sets determined at runtime (see
factory:node type)
CLI Output
When you run a workflow containing a swrm node withsirenspec run, the output is rendered with a dedicated visual layout:
- Opening rule — Shows the swarm name and agent count.
- Agent panels — Each agent’s output is rendered in its own Rich panel, in definition order.
- Closing rule — Displays success/failure tally (e.g.,
3/3 succeededor2/3 succeeded, 1 failed) and total swarm duration. - Synthesis panel — If synthesis is configured and successful, its output is shown in a final panel (omitted if no synthesis or no string output).
- Writes arrow — Shows the context path where the node output was written.
Complete Example
See the Market Analysis cookbook recipe for a full working workflow.nodes entry for the swrm node with:
agents— per-agent prompt, response, token count, and latencysynthesis— synthesis prompt, response, token count, and latencyoutput— the synthesis text (or list of agent outputs if no synthesis)tokens— total token count across all agents and synthesisduration_ms— total elapsed time