Skip to main content

Quickstart for Developers

This guide walks you through triggering a workflow run and retrieving its results.

Prerequisites

  • An Origami account with at least one workflow
  • Your API key
  • A workflow ID (find it in the URL: app.origamiagents.com/workflows/{workflowId})

Step 1: Trigger a Run

Start a workflow run using the async endpoint:
curl -X POST https://api.origamiagents.com/api/v1/workflows/{workflowId}/runs/async \
  -H "x-origami-key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "nodes": {}
  }'
Response:
{
  "success": true,
  "data": {
    "workflowId": "wf_abc123",
    "runId": "run_xyz789",
    "status": "queued"
  }
}

Step 2: Poll for Status

Check the run status until it completes:
curl https://api.origamiagents.com/api/v1/workflows/{workflowId}/runs/{runId}/async/status \
  -H "x-origami-key: your-api-key"
Response:
{
  "success": true,
  "data": {
    "status": "completed",
    "startedAt": "2024-01-15T10:30:00Z",
    "finishedAt": "2024-01-15T10:30:45Z"
  }
}

Step 3: Get Results

Once the run completes, fetch the output:
curl https://api.origamiagents.com/api/v1/workflows/{workflowId}/runs/{runId}/async/response \
  -H "x-origami-key: your-api-key"
Response:
{
  "success": true,
  "data": {
    "row_1": {
      "result": "Your workflow output here..."
    }
  }
}

Next Steps