Approve then send
Pause before any outbound action that affects customers or production data.Graph structure
- Draft step —
llm_callormcp_callgenerates content (email body, WhatsApp message, CRM update payload) - human_task —
task_type: "approval"with draft intask_payload - Send step —
mcp_calltogmail(send_email),whatsapp(send_message), or another connector —depends_onthe human task, uses approved payload
Example human task payload
Inbound webhook triggers
Start workflows from external systems (CRM, payment processor, monitoring alert).Setup
- Create a workflow whose first step validates
{{input.*}}fields - Create an inbound webhook subscription — see Inbound webhooks
- Configure the external system to POST to the subscription URL with the signing secret
- Map POST body fields to workflow input
Validate-first pattern
Always validate required input before calling external tools:condition on downstream steps: "condition": "{{input.order_id}}"
Idempotency
External systems may retry webhooks. Design workflows to be idempotent:- Check if the order/event was already processed (MCP query step)
- Use external IDs in
tool_argsso duplicate runs do not double-send
AgentRuntime does not provide built-in cron scheduling today. For recurring runs, use an external scheduler that calls the API or fires an inbound webhook on a timetable.
Error handling with retries
Per-step retries
Setretry_count on steps that call flaky external APIs:
retry_count times before marking the step failed.
Timeouts
Settimeout_s on every external call. Defaults are not unlimited — long-running MCP or LLM calls without timeouts can stall runs.
Failure propagation
When a step fails after retries:- The run marks the step
failed - Downstream steps that
depends_onthe failed step are skipped - The run appears in Command Center Failed recently
Human escalation on failure
Route low-confidence or failed LLM output to human review instead of failing silently: Usecondition or a Lua branch to set a flag, then add a human_task on the low-confidence path.
Parallel fan-out
Usefor_each to process a list with bounded parallelism:
for_each_max_parallel low for rate-limited APIs (WhatsApp, email providers).
Memory-enriched steps
When memory is enabled, workflow prepare-step can inject long-term context before LLM steps. See Memory (preview). Pattern:- Index conversations or files into memory
- LLM step prompt references memory search results passed via prepare-step context
- Human task approves actions informed by retrieved knowledge
Pattern checklist
End-to-end guides
These patterns are expanded into full step-by-step recipes in Guides:- Form webhook → Postgres → Resend digest
- Shopify order → WhatsApp template
- GitHub PR → LLM review → comment
- Scheduled Postgres → Gmail report
- Lead webhook → ActiveCampaign + Notion
Related docs
- Command Center — approve tasks and monitor runs
- Human tasks — task authoring reference
- Inbound webhooks — external triggers
- Connector catalog — common patterns
- Troubleshooting — recover from failures