Executions API
13 endpoints under /api/v1/executions. The CLI’s factflow execution commands map to this API 1:1.
curl -X POST http://localhost:8000/api/v1/executions \ -H 'Content-Type: application/json' \ -d '{"config_id": "CONFIG_ID"}'Response: {"execution_id": "...", "status": "running", ...}.
Optional fields:
trigger_context— free-form JSON stamped onto the execution row; visible inGETresponses (use for tagging e.g."source": "cron")idempotency_key— if provided, the server dedupes concurrent POSTs with the same key within a short window
GET /api/v1/executionsGET /api/v1/executions?status=runningGET /api/v1/executions?status=failed&limit=50&offset=0Inspect
Section titled “Inspect”GET /api/v1/executions/{id}Returns the execution row + config_snapshot + timestamps + derived stats.
Wait (SSE)
Section titled “Wait (SSE)”GET /api/v1/executions/{id}/events # SSE stream of status changesThe CLI’s factflow execution wait consumes this stream. The stream closes when the execution reaches a terminal state.
Cancel
Section titled “Cancel”POST /api/v1/executions/{id}/cancelGraceful cancellation; returns immediately with status: "cancelling". The execution transitions to cancelled once processors drain.
GET /api/v1/executions/{id}/statsCounts per adapter (completed, failed, pending), average duration, throughput. Derived from lineage — updates live as the execution runs.
GET /api/v1/executions/{id}/dagNodes (routes + adapters) and edges (queue links). Use this to build an execution-topology UI.
Routes
Section titled “Routes”GET /api/v1/executions/{id}/routesPer-route detail: queue name, processor status, in-flight count.
Replay
Section titled “Replay”POST /api/v1/executions/{id}/replayBody: {"from_stage": "markdown", "to_route": "embeddings"}See the replay guide for mechanics.
Storage stream (SSE)
Section titled “Storage stream (SSE)”GET /api/v1/executions/{id}/storage-streamLive feed of storage writes during the execution. Powers factflow storage watch.
POST /api/v1/executions/{id}/tagAttach labels to an execution (e.g., "env": "prod", "owner": "@ove"). Queryable via GET /api/v1/executions?tag=env:prod.
Content model
Section titled “Content model”An execution’s life cycle:
created → running → (completed | failed | cancelled | interrupted) ↑ replay inherits from a parent → new execution- created — row exists, orchestrator not yet started (transient, usually skipped)
- running — active
- completed — all routes drained, no failures
- failed — at least one uncaught adapter error; see
errorfield and lineage failures - cancelled — user cancelled via
POST .../cancel - interrupted — server crashed; recovery on next startup resumes from lineage
Idempotency and retries
Section titled “Idempotency and retries”If you POST the same POST /api/v1/executions twice with the same idempotency_key, the second call returns the first execution’s row. Useful for cron jobs that may retry on network failure.
Related
Section titled “Related”- CLI: execution
- Reference: API — OpenAPI spec rendered
- Concept: Orchestration — what happens when you hit POST /executions
- factflow-execution reference