Also in docs/dev/quickstarts.md
Trigger a workflow
Start a workflow from your own system, with input data. About 2 minutes.
You need:
- An API key in
PYROSYNC_API_KEYand the deployment URL inPYROSYNC_URL(for examplehttps://app.example.com). - An active workflow (build one in the dashboard).
1. Find the workflow
GET /api/v1/workflows
WORKFLOW_ID=$(curl -sS -X GET "$PYROSYNC_URL/api/v1/workflows" \
-H "X-API-Key: $PYROSYNC_API_KEY" | jq -r '.data[0].id')
echo "$WORKFLOW_ID"
2. Trigger it
POST /api/workflows/{id}/trigger
curl -sS -X POST "$PYROSYNC_URL/api/workflows/$WORKFLOW_ID/trigger" \
-H "X-API-Key: $PYROSYNC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"triggerType": "webhook",
"triggerData": {
"email": "ada@example.com"
}
}'
A paused workflow queues or drops the trigger according to its paused behavior; the response says which.
3. Read the run
GET /api/workflows/{id}/runs
curl -sS -X GET "$PYROSYNC_URL/api/workflows/$WORKFLOW_ID/runs" \
-H "X-API-Key: $PYROSYNC_API_KEY"
Result: A workflow run with its status and per-node results.