swrm runs three classifiers simultaneously — urgency score, intent label, and sender reputation. The synthesis agent combines those signals into a routing decision, and conditional edges send the workflow to whichever response agent fits: draft a reply, write a forwarding note, or generate an archive reason.
What it demonstrates
pythontool node making authenticated multi-step API callsswrmrunning three parallel classifiers on the same input- Synthesis agent combining swrm outputs into a single routing decision
- Conditional edges routing on
working.triage.output piiguardrail protecting email content throughout
Prerequisites
Obtain a Gmail OAuth 2.0 access token withgmail.readonly scope:
email_fetcher module lives alongside the workflow:
Run it
Workflow
docs/cookbook/email-triage/workflow.yaml
How data flows
fetch_emailcallsemail_fetcher.fetch_latest_unread(), which returns a JSON string withfrom,subject, andsnippet.triagefans out to three agents simultaneously. Each reads{{ fetch_email.email_json }}and produces a single score word.- The synthesis agent combines all three signals and outputs one of
reply,forward, orarchive. - The synthesis output is written to
working.triage.output. Conditional edges route to exactly one ofdraft_reply,forward_note, orarchive_reason.
Graph
Next steps
Market Analysis
Swrm of specialist analysts with a synthesis agent — the core parallel pattern.
Conditional Pipeline
Simpler conditional routing without swrm.