Skip to main content
Connect to Gmail and let SirenSpec triage your inbox. A Python tool fetches the most recent unread message, then a 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

  • python tool node making authenticated multi-step API calls
  • swrm running three parallel classifiers on the same input
  • Synthesis agent combining swrm outputs into a single routing decision
  • Conditional edges routing on working.triage.output
  • pii guardrail protecting email content throughout

Prerequisites

Obtain a Gmail OAuth 2.0 access token with gmail.readonly scope:
The email_fetcher module lives alongside the workflow:

Run it

Workflow

docs/cookbook/email-triage/workflow.yaml

How data flows

  1. fetch_email calls email_fetcher.fetch_latest_unread(), which returns a JSON string with from, subject, and snippet.
  2. triage fans out to three agents simultaneously. Each reads {{ fetch_email.email_json }} and produces a single score word.
  3. The synthesis agent combines all three signals and outputs one of reply, forward, or archive.
  4. The synthesis output is written to working.triage.output. Conditional edges route to exactly one of draft_reply, forward_note, or archive_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.