Swarm Workflows
Common patterns for coordinating multiple agents.
Workflow 1: Lead Processing Pipeline
Process leads from intake to outreach.
flowchart TB
subgraph intake [Phase 1: Intake]
Input[Raw Lead] --> Alpha[Alpha - Validate]
Alpha --> Bravo[Bravo - Triage]
end
subgraph enrich [Phase 2: Enrichment]
Bravo --> Echo[Echo - Research]
Echo --> |LinkedIn| LinkedIn[(LinkedIn)]
Echo --> |Google| Google[(Google)]
end
subgraph content [Phase 3: Content]
Echo --> Foxtrot[Foxtrot - Email]
Foxtrot --> Hotel[Hotel - Send]
end
subgraph track [Phase 4: Track]
Hotel --> India[India - Monitor]
India --> |Response| Sales[Sales Team]
India --> |Silence| Nurture[Nurture Sequence]
end
Agents: Alpha, Bravo, Echo, Foxtrot, Hotel, India Avg Duration: 5 minutes Cost: $0.05/lead
Workflow 2: Document Processing
Extract and decide on loan documents.
flowchart TB
subgraph upload [Upload]
Docs[Documents] --> Alpha[Alpha - Validate]
end
subgraph extract [Extract]
Alpha --> Charlie[Charlie - OCR]
Charlie --> |Paystub| PS[Extract Income]
Charlie --> |Tax Return| TR[Extract AGI]
Charlie --> |Bank Stmt| BS[Extract Balance]
end
subgraph decide [Decide]
PS --> Delta[Delta - Underwrite]
TR --> Delta
BS --> Delta
Delta --> |Approve| Approve[Approval]
Delta --> |Deny| Deny[Denial]
Delta --> |Refer| Human[Human UW]
end
Agents: Alpha, Charlie, Delta Avg Duration: 30 seconds Cost: $0.03/document set
Workflow 3: Content Campaign
Create multi-channel content for a campaign.
flowchart TB
subgraph plan [Planning]
Brief[Campaign Brief] --> Quinn[Quinn - Strategy]
Quinn --> Outline[Content Outline]
end
subgraph create [Creation - Parallel]
Outline --> Crella[Crella - Blog]
Outline --> Foxtrot[Foxtrot - Emails]
Outline --> Golf[Golf - Videos]
end
subgraph review [Review]
Crella --> Review[Human Review]
Foxtrot --> Review
Golf --> Review
end
subgraph publish [Publish]
Review --> Hotel[Hotel - Distribute]
Hotel --> Email[Email Campaign]
Hotel --> Social[Social Posts]
Hotel --> Web[Website]
end
Agents: Quinn, Crella, Foxtrot, Golf, Hotel Avg Duration: 2 hours Cost: $2.50/campaign
Workflow 4: Code Review Swarm
Automated code quality review.
flowchart TB
subgraph submit [Submission]
PR[Pull Request] --> Router[Lima - Route]
end
subgraph review [Review - Parallel]
Router --> Security[Ronin-Sec<br/>Security Scan]
Router --> Quality[Ronin-QA<br/>Code Quality]
Router --> Test[Ronin-Test<br/>Test Coverage]
end
subgraph analyze [Analysis]
Security --> Argo[Argo - Synthesize]
Quality --> Argo
Test --> Argo
Argo --> Report[Review Report]
end
subgraph action [Action]
Report --> |Pass| Merge[Auto-Merge]
Report --> |Fail| Block[Block + Comments]
Report --> |Review| Human[Human Review]
end
Agents: Lima, Ronin (3x), Argo Avg Duration: 5 minutes Cost: $0.20/PR
Workflow 5: Research Deep Dive
Comprehensive market research.
flowchart TB
subgraph scope [Scoping]
Request[Research Request] --> Quinn[Quinn - Scope]
Quinn --> Plan[Research Plan]
end
subgraph gather [Data Gathering - Parallel]
Plan --> Echo1[Echo - Company Data]
Plan --> Echo2[Echo - Market Data]
Plan --> Echo3[Echo - Competitor Data]
end
subgraph analyze [Analysis]
Echo1 --> Argo[Argo - Analysis]
Echo2 --> Argo
Echo3 --> Argo
Argo --> Draft[Draft Report]
end
subgraph finalize [Finalization]
Draft --> Crella[Crella - Polish]
Crella --> Juliet[Juliet - Charts]
Juliet --> Final[Final Report]
end
Agents: Quinn, Echo (3x), Argo, Crella, Juliet Avg Duration: 4 hours Cost: $5.00/report
Workflow Templates
Simple Pipeline
name: simple_pipeline
steps:
- agent: ALPHA001
action: validate
- agent: BRAVO001
action: triage
- agent: ECHO001
action: enrich
Parallel Processing
name: parallel_research
steps:
- agent: LIMA001
action: distribute
- parallel:
- agent: ECHO001
action: linkedin_research
- agent: ECHO001
action: google_research
- agent: ECHO001
action: company_research
- agent: LIMA001
action: aggregate
Conditional Branching
name: conditional_flow
steps:
- agent: ALPHA001
action: validate
- condition: has_documents
true:
- agent: CHARLIE001
action: extract
false:
- agent: ECHO001
action: research
- agent: DELTA001
action: decide
Creating Custom Workflows
const workflow = await crella.createWorkflow({
name: 'custom_lead_flow',
steps: [
{ agent: 'ALPHA001', action: 'validate', timeout: 5000 },
{ agent: 'ECHO001', action: 'enrich', timeout: 30000 },
{
parallel: true,
steps: [
{ agent: 'FOXTROT001', action: 'email' },
{ agent: 'GOLF001', action: 'video' }
]
},
{ agent: 'HOTEL001', action: 'send' }
],
onError: 'escalate_to_india'
});
// Execute workflow
const result = await workflow.execute({ lead: leadData });