Pattern C: Agent as Orchestrator

The agent coordinates multiple workflows, making decisions about what to trigger, in what order, and how to synthesize results across them. The agent is the decision-maker; each workflow is a capability it can invoke. Unlike Pattern B, which routes into one downstream path, the orchestrator keeps reasoning across several workflow results before it completes.

flowchart TD Agent["Orchestrator Agent"] -->|"1. verify identity"| KYC["Identity Verification<br/>Workflow"] KYC -->|"result: verified"| Agent Agent -->|"2. screen sanctions"| Sanctions["Sanctions Screening<br/>Workflow"] Sanctions -->|"result: partial match"| Agent Agent -->|"3. conflict - escalate"| Human["Human Review"] Human -->|"decision: clear"| Agent Agent -->|"4. provision account"| Account["Account Provisioning<br/>Workflow"] Account -->|"result: provisioned"| Agent Agent -->|"5. complete with full trace"| Done["__complete__"] style Agent fill:#f3e8ff,stroke:#9333ea style Human fill:#dbeafe,stroke:#3b82f6

When to Use

  • the process requires dynamic coordination across multiple sub-processes
  • the sequence of steps depends on intermediate results
  • you need to synthesize information from multiple workflows before deciding the next step
  • the agent makes judgment calls, not just routing decisions

Pattern C vs Pattern B

Pattern B = classify, route into one workflow, stop.

Pattern C = run one workflow, inspect the result, choose the next workflow, synthesize across several results, escalate if needed, and continue until the process is complete.

The telltale sign of Pattern C is ongoing reasoning across multiple workflow results.

---

How It Differs From Pattern B

Pattern B: Trigger Pattern C: Orchestrator
Core question "Which workflow should handle this?" "How do I coordinate these workflows to complete a complex process?"
Workflow calls One downstream workflow Multiple workflows
Result synthesis Minimal Combines results across workflows and resolves conflicts
Human escalation Rare Common when workflow results conflict or remain uncertain
Typical iterations 3-5 10-20
Iteration budget max_iterations: 8 max_iterations: 20
Timeout Shorter Longer, because several workflow calls may complete in sequence

Tool Declaration

Pattern C agents usually rely on several workflow tools plus a small set of direct actions:

json
{
  "tools": [
    { "type": "workflow", "id": "wfl-identity-verification-001", "description": "Verify identity against government databases and trade registers" },
    { "type": "workflow", "id": "wfl-sanctions-screening-002", "description": "Screen against OFAC, EU, UN, and UK sanctions lists" },
    { "type": "workflow", "id": "wfl-enhanced-due-diligence-003", "description": "Enhanced due diligence -- deep background check for flagged entities" },
    { "type": "workflow", "id": "wfl-account-provisioning-004", "description": "Provision customer account, set up billing, assign account manager" },
    { "type": "action", "name": "gmail_send" }
  ]
}

Typed workflow tools resolve by workflow ID, then execute through the runtime. The agent continues only after each triggered workflow returns a result, pause, failure, or timeout. Implicit tools such as __complete__, __pause_for_human__, __store_memory__, and __log_progress__ are auto-injected.


Complete Example: Customer Onboarding

An orchestrator agent that onboards a business customer by running identity verification, sanctions screening, conditionally triggering enhanced due diligence, and escalating to a human when signals conflict.

Agent Configuration

json
{
  "objective": "Onboard the following business customer. Run identity verification first, then sanctions screening. If the results conflict or remain uncertain, run enhanced due diligence. If uncertainty remains, pause for human review. If approved, provision the account and send a welcome email.

Customer summary:
- Company: Acme GmbH
- Country: DE
- Registration: HRB 12345
- Contact: Hans Mueller (hans@acme.de)",
  "tools": [
    { "type": "workflow", "id": "wfl-identity-verification-001", "description": "Verify company identity -- checks trade registers, document authenticity, address verification" },
    { "type": "workflow", "id": "wfl-sanctions-screening-002", "description": "Screen against global sanctions lists. Returns clear, partial_match, or hit." },
    { "type": "workflow", "id": "wfl-enhanced-due-diligence-003", "description": "Enhanced due diligence -- deep background check, adverse media, PEP screening" },
    { "type": "workflow", "id": "wfl-account-provisioning-004", "description": "Provision customer account -- create org, set up billing, assign account manager" },
    { "type": "action", "name": "gmail_send" }
  ],
  "config": {
    "model": "gpt-4o",
    "max_iterations": 20,
    "timeout_ms": 600000,
    "on_stuck": { "iterations": 3, "action": "escalate" }
  }
}

Execute via Standalone Agent API

bash
curl -X POST https://your-hyphen.example.com/agents/execute   -H "X-Org-Id: acme-corp"   -H "Content-Type: application/json"   -d '{
    "objective": "Onboard the following business customer. Run identity verification first, then sanctions screening. If the results conflict or remain uncertain, run enhanced due diligence. If uncertainty remains, pause for human review. If approved, provision the account and send a welcome email.

Customer summary:
- Company: Acme GmbH
- Country: DE
- Registration: HRB 12345
- Contact: Hans Mueller (hans@acme.de)",
    "tools": [
      { "type": "workflow", "id": "wfl-identity-verification-001" },
      { "type": "workflow", "id": "wfl-sanctions-screening-002" },
      { "type": "workflow", "id": "wfl-enhanced-due-diligence-003" },
      { "type": "workflow", "id": "wfl-account-provisioning-004" },
      { "type": "action", "name": "gmail_send" }
    ],
    "config": { "model": "gpt-4o", "max_iterations": 20, "timeout_ms": 600000 }
  }'

As with Pattern B, the standalone agent API takes the objective directly. If you need richer structured context, wrap the orchestrator in a workflow and pass the relevant business data into that workflow first.

---

Sample Reasoning Trace

text
Iteration 1:
  Thought: "Starting onboarding for Acme GmbH. First step is identity verification."
  Action: __log_progress__
  Input: { "message": "Starting onboarding", "milestone": "begin" }

Iteration 2:
  Thought: "Running identity verification."
  Action: identity_verification
  Input: {
    "company_name": "Acme GmbH",
    "country": "DE",
    "registration_number": "HRB 12345",
    "timeout_ms": 120000
  }
  Observation: {
    "status": "completed",
    "result": { "verified": true, "confidence": 0.92, "source": "trade_register" }
  }

Iteration 3:
  Thought: "Identity verified at high confidence. Saving this and moving to sanctions screening."
  Action: __store_memory__
  Input: { "key": "kyc_result", "value": { "verified": true, "confidence": 0.92 } }

Iteration 4:
  Thought: "Now running sanctions screening."
  Action: sanctions_screening
  Input: {
    "company_name": "Acme GmbH",
    "country": "DE",
    "directors": ["Hans Mueller", "Maria Schmidt"],
    "timeout_ms": 120000
  }
  Observation: {
    "status": "completed",
    "result": {
      "overall": "partial_match",
      "matches": [{ "name": "Hans Mueller", "list": "EU", "score": 0.72,
                     "note": "Similar name on EU consolidated list" }]
    }
  }

Iteration 5:
  Thought: "Identity passed but sanctions flagged a partial match. I need enhanced due diligence before deciding."
  Action: __log_progress__
  Input: { "message": "Conflict detected between verification and sanctions results", "milestone": "conflict_detected" }

Iteration 6:
  Thought: "Running enhanced due diligence to resolve the conflict."
  Action: enhanced_due_diligence
  Input: {
    "company_name": "Acme GmbH",
    "flagged_individual": "Hans Mueller",
    "flag_reason": "72% name match on EU consolidated list",
    "timeout_ms": 180000
  }
  Observation: {
    "status": "completed",
    "result": {
      "conclusion": "likely_false_positive",
      "confidence": 0.78,
      "reasoning": "Different date of birth and nationality from the listed entity"
    }
  }

Iteration 7:
  Thought: "EDD suggests a false positive, but confidence is still below my threshold. I should pause for human review."
  Action: __pause_for_human__
  Input: {
    "question": "Sanctions screening flagged Hans Mueller (72% name match, EU list). EDD concludes likely false positive at 78% confidence. Should we proceed with onboarding?",
    "options": ["Approve -- proceed with onboarding", "Reject -- deny application", "Request additional documentation"],
    "context_summary": "KYC verified at 92%. Sanctions screening produced a partial match. EDD suggests false positive at 78% confidence.",
    "urgency": "medium"
  }

Iteration 8:
  Thought: "Human approved. Provisioning the account with a monitoring note."
  Action: account_provisioning
  Input: {
    "company_name": "Acme GmbH",
    "country": "DE",
    "contact_email": "hans@acme.de",
    "risk_notes": "Sanctions false positive cleared by compliance (2026-02-08)",
    "monitoring_level": "enhanced",
    "timeout_ms": 60000
  }
  Observation: {
    "status": "completed",
    "result": { "account_id": "acct_xyz789", "status": "active" }
  }

Iteration 9:
  Thought: "Account provisioned. Sending the welcome email."
  Action: gmail_send
  Input: {
    "to": "hans@acme.de",
    "subject": "Welcome to Hyphen -- Your Account is Ready",
    "body": "Dear Hans,

Your Acme GmbH account has been provisioned..."
  }

Iteration 10:
  Thought: "Onboarding is complete."
  Action: __complete__
  Input: {
    "answer": "Acme GmbH onboarded successfully. Identity verified, sanctions false positive cleared by compliance, and the account was provisioned.",
    "confidence": 0.95,
    "summary": "KYC verified | sanctions cleared after review | account active"
  }

Key Properties

  • Multiple workflow calls — the agent coordinates several workflow capabilities in sequence
  • Result synthesis — the agent compares workflow results and resolves conflicts before taking the next step
  • Conditional workflow triggering — due diligence runs only because sanctions screening raised a concern
  • Human escalation with context — when the agent pauses, the reviewer gets the chain of evidence gathered so far
  • Higher iteration budgetmax_iterations: 20 is typical because each workflow call and decision consumes several iterations
  • Longer timeout — a larger timeout_ms gives the orchestrator room to coordinate several workflow calls

Pattern C vs Building It as a Deterministic Workflow

You could encode the same process as a deterministic workflow with conditional branches. Use Pattern C when:

  • the process has too many conditional paths to enumerate upfront
  • you need natural-language judgment between steps
  • the order of operations depends on results, not just fixed branch rules
  • you want the agent to explain its reasoning as it goes

Use a deterministic workflow when:

  • the process is well-defined with clear branching rules
  • every conditional can be expressed as explicit comparisons
  • you do not need natural-language reasoning between steps
  • volume is high enough that LLM cost per run matters

In practice, many teams start with Pattern C for new processes, then move stable portions into deterministic workflows as the process hardens.


Governance Model

Pattern C agents have the highest autonomy level, so governance matters most:

  • Structural permissioning — the agent can trigger only the workflows and actions declared in its tools array
  • Reasoning traces — each iteration is captured and can be inspected through the agent run APIs
  • Stuck detection — if the agent stops making progress, it escalates instead of looping indefinitely
  • Pause and resume — when the agent asks for human input, the run state is persisted and the decision becomes part of the agent record
  • Timeout enforcementtimeout_ms prevents unbounded orchestration

Back to: Deployment Patterns Overview