02 Server API first run
Before you start
Read 01 Embedded SDK vs server so the Postgres requirement and auth headers make sense. You need Docker with Compose v2, curl, and a repository clone. On Windows PowerShell, use curl.exe if the curl alias maps to Invoke-WebRequest.
Concept
arcflow-server wraps arcflow-core with HTTP routes for run creation, status polling, traces, registry, admin sites, HITL approve, and external callbacks. The development compose file starts Postgres, runs migrations once, and exposes the API on port 8080.
Development keys from docker/docker-compose.server.yml:
| Variable | Default | Used for |
|---|---|---|
ARCFLOW_SERVER_API_KEY | dev-secret | POST /v1/runs, run poll, trace |
ARCFLOW_ADMIN_API_KEY | dev-admin | /v1/admin/* routes |
Change these before any non-local deployment.
Auth on run routes accepts either Authorization: Bearer <key> or X-ArcFlow-Api-Key: <key>. /health and /ready require no auth. /ready returns 200 when Postgres is reachable and migrations are at head; 503 when degraded.
Example
Start the stack from the repository root:
Confirm readiness:
Save this payload as run-payload.json:
Create the run:
Example 201 response:
Poll until terminal status (replace RUN_ID):
When complete, status is Completed and result.output holds the final text. Fetch the trace:
Expect lifecycle kinds such as WorkflowStarted, StepCompleted, and WorkflowCompleted. Trace exports are metadata-only under trace data policy: no prompts, tool payloads, or secrets.
Stop the stack when finished:
Add -v only if you intend to wipe the Postgres volume.
Verify
| Check | Expected |
|---|---|
/ready HTTP code | 200 after migrations |
| Create run HTTP code | 201 with run_id |
| Poll until complete | status is Completed |
| Trace response | Non-empty events array with workflow lifecycle kinds |
| Stub path | No LLM API keys required |
Optional: send Idempotency-Key: <uuid> on create to deduplicate identical submissions within the server window.
Next
03 External callbacks intro covers runs that pause at Interrupted until an external system posts an outcome.
For the full server quickstart with SDK client and bash poll loop, see Server API quickstart.