Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.anyreach.ai/llms.txt

Use this file to discover all available pages before exploring further.

Workflows can run synchronously (the caller waits for completion) or asynchronously (the caller gets an execution_id immediately and the workflow runs in the background).

At a glance

SyncAsync
Caller behaviorWaits for completionReturns immediately with execution_id
Wait stepsBlock the caller (avoid)Suspend the execution (works correctly)
Max duration~60s practical limitUp to the workflow’s configured timeout (default 1 hour)
RetriesNot supportedConfigurable per workflow
Used byAgent tools, Ongoing ConversationTimer, External Apps, Post Call, batch jobs

When to use sync

  • The caller needs the result immediately (agent tool during a live call)
  • Total expected duration is well under 30 seconds
  • No Wait steps
  • Low-latency response matters

When to use async

  • The workflow has Wait steps
  • Total duration could exceed 30 seconds
  • Retry on failure matters
  • The caller doesn’t need the result synchronously
  • High-concurrency batch processing

Sync execution

curl -X POST https://api.anyreach.ai/workflow/workflow-executions \
  -H "Authorization: Bearer $ANYREACH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_id": "wf_...",
    "workflow_version": "latest",
    "input_data": { "customer_email": "alice@example.com" }
  }'
Success response:
{
  "status": "success",
  "execution_id": "exec_...",
  "output": { /* whatever the Output step returned */ }
}
Failure response:
{
  "status": "failed",
  "execution_id": "exec_...",
  "error": { "step_name": "Lookup contact", "message": "..." }
}

Async execution

curl -X POST https://api.anyreach.ai/workflow/workflow-executions/async \
  -H "Authorization: Bearer $ANYREACH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_id": "wf_...",
    "workflow_version": "latest",
    "input_data": { "customer_email": "alice@example.com" }
  }'
Immediate response:
{
  "status": "pending",
  "execution_id": "exec_..."
}
Poll for the result:
curl https://api.anyreach.ai/workflow/workflow-executions/$EXEC_ID \
  -H "Authorization: Bearer $ANYREACH_TOKEN"