Quickstart
This guide walks you through triggering a workflow run and retrieving its results.
Prerequisites
- An Origami account with a workflow that has an Input node and Output node (see Workflow Setup)
- Your API key
- A workflow ID (find it in the URL:
app.origamiagents.com/workflows/{workflowId})
Step 1: Get your request body
Open your workflow and click on the Input node. If you’ve added test data, you’ll see an API Usage section with a ready-to-use request body:
{
"rows": [
{
"status": "Approved"
}
]
}
Click Copy to grab this payload, or build your own following the same format.
Step 2: 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 '{
"rows": [
{ "status": "Approved" }
]
}'
Response:
{
"success": true,
"data": {
"workflowId": "wf_abc123",
"runId": "run_xyz789",
"status": "queued"
}
}
The rows array you send replaces any test data in the Input node. Each object in the array becomes one row processed by your workflow.
Step 3: 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 4: Get Results
Once the run completes, fetch the output from the Output node:
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-id-abc123": {
"result": "Your workflow output here..."
}
}
}
Next Steps