- Reference
- Operator API
Reference
Operator API
The REST API of the local operator, for starting and reading runs from your own code.
The operator serves a REST API next to its UI, at
http://127.0.0.1:7435/api/v1. It can do what the UI and the ava command do.
curl -X POST http://127.0.0.1:7435/api/v1/runs \
-H "Content-Type: application/json" \
-d '{"workflow_selector": "flow.py::process_invoice", "input_json": "{\"text\": \"Invoice 42\"}"}'
Interactive documentation is served by the operator itself at /api/docs, and the OpenAPI
document at /api/openapi.json.
Like the UI, the API has no sign-in. See Self-hosting.
Workflows
| Method | Path | Does |
|---|---|---|
GET | /v1/flows | Lists workflows |
POST | /v1/flows/{workflow_selector}/schedule | Turns a schedule on or off. Body: {"enabled": true, "input_json": "..."} |
Runs
| Method | Path | Does |
|---|---|---|
POST | /v1/runs | Starts a run. Answers 202. |
GET | /v1/runs | Lists runs. Filter with workflow_selector. |
GET | /v1/runs/{run_id} | A run’s state, step by step |
GET | /v1/runs:resolve | Finds a keyed run by workflow_selector and key_fields |
POST | /v1/runs/{run_id}/cancel | Cancels a run |
GET | /v1/runs/{run_id}/result | The result |
GET | /v1/runs/{run_id}/output | The raw output |
GET | /v1/runs/{run_id}/activity | Logs and agent activity. Filter with node_id. |
GET | /v1/runs/{run_id}/evaluations | Evaluation answers |
GET | /v1/runs/{run_id}/links | Parent and child runs |
Waits
| Method | Path | Does |
|---|---|---|
GET | /v1/runs/{run_id}/waits | What the run is waiting for |
POST | /v1/runs/{run_id}/events/{key} | Sends an event |
POST | /v1/runs/{run_id}/decisions/{node} | Submits an approval. Body: {"outcome": {...}, "reason": "..."} |
Both POST routes need an Idempotency-Key header.
State machines
| Method | Path | Does |
|---|---|---|
GET | /v1/runs/{run_id}/machine | The machine’s current state |
GET | /v1/runs/{run_id}/machine/history | Its transitions |
GET | /v1/runs/{run_id}/machine/entries/{entry} | One state entry |
GET | /v1/runs/{run_id}/machine/entries/{entry}/events | The events of one state entry |
POST | /v1/runs/{run_id}/machine/events/{name} | Sends an event. Needs Idempotency-Key. |
POST | /v1/runs/{run_id}/machine/entries:retry | Retries an interrupted state |
Shapes
| Request bodies | JSON, up to 4 MiB |
| Errors | {"error": {"code": "...", "message": "..."}} |
| Field names | snake_case |
