Workflow Analytics
Analytics are available at two scopes:
| Scope | Who can access | Where |
|---|---|---|
| Per-workflow | Anyone who can open the workflow: its owner, members of its space, and admins | API + Editor Runs tab |
| Platform-wide | Admin only | Admin > Analytics > Agents |
Per-Workflow Analytics
Every workflow developer has access to run history and aggregate metrics for their own workflows — no admin access required.
These endpoints follow the same access rule as opening the workflow (GET /api/v1/agent-workflows/{id}). Anyone else gets 403, and an unknown workflow id gets 404.
Run history
GET /api/v1/agent-analytics/workflows/{workflow_id}/runs
Authorization: Bearer <token>Query parameters:
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by run status — any of the run states. Any other value returns 422 |
limit | int | Page size (1–200, default: 25) |
offset | int | Pagination offset (default: 0) |
start_ts | int | Unix timestamp (seconds) — only runs created at or after this time |
end_ts | int | Unix timestamp (seconds) — only runs created at or before this time |
Runs are returned newest first. Each row has the same fields as the admin run list, including tokens, cost and the workflow's name. started_at, ended_at and created_at are Unix seconds; duration_ms is milliseconds.
Response:
{
"items": [
{
"id": "run_abc123",
"workflow_id": "wf_xyz",
"workflow_name": "Invoice triage",
"space_id": "space_def",
"catalog_id": "cat_ghi",
"status": "completed",
"triggered_by": "user_id_or_webhook_token",
"started_at": 1700001000,
"ended_at": 1700001003,
"duration_ms": 3186,
"error_message": null,
"created_at": 1700000999,
"warning_count": 0,
"prompt_tokens": 512,
"completion_tokens": 128,
"total_tokens": 640,
"cost_usd": 0.0012,
"provider": "anthropic",
"model_id": "claude-sonnet-4-6"
}
],
"total": 42
}Aggregate summary
GET /api/v1/agent-analytics/workflows/{workflow_id}/summary
Authorization: Bearer <token>Query parameters: start_ts, end_ts (same as run history).
Response:
{
"total_runs": 42,
"completed_runs": 38,
"failed_runs": 3,
"paused_runs": 1,
"success_rate": 0.9048,
"runs_with_warnings": 2,
"avg_duration_ms": 3186.0,
"p95_duration_ms": 7842.0,
"total_prompt_tokens": 21504,
"total_completion_tokens": 5376,
"total_cost_usd": 0.0504
}success_rate is completed_runs / total_runs (0–1). paused_runs counts runs that are paused, waiting_decision or ready_to_resume. avg_duration_ms and p95_duration_ms cover runs that have both started and ended. The p95 is the duration at position ⌊0.95 × n⌋ of the sorted durations (nearest rank).
This returns exactly what the admin summary returns for the same workflow (GET /api/v1/agent-analytics/summary?workflow_id=…).
Warnings: failures a run carried on past
Some node failures don't stop a run, so the run still ends completed:
- a
transformwhose expression fails writes[transform error: …]as its output; - an
if_elseorwhile_loopwhose condition fails takes its fallback; - any node with
on_error: skipis skipped.
These count as warnings. A run's warning_count is how many it had, and the summary's runs_with_warnings is how many runs had at least one. They're shown in the editor Runs tab and the admin run table, so a "completed" run whose output is an error message doesn't go unnoticed. failed is reserved for runs that stopped.
Token cost: every run records its prompt and completion tokens and an estimated cost, including runs of personal workflows that aren't in a catalog. Tokens come from the provider's usage report; for OpenAI-compatible providers the runtime asks for it on streamed calls (stream_options.include_usage). cost_usd is estimated from the model's pricing, so it is 0 when no price is known for the model, even when tokens are recorded. Cost rows are written just after a run ends, so a summary fetched the instant a run finishes may not include it yet.
Run States
| Status | Meaning |
|---|---|
running | Actively executing nodes |
paused | Paused (older runs) |
waiting_decision | Paused at a user_approval node; awaiting inbox decision |
ready_to_resume | Decision made; waiting for the next execution slot |
completed | All paths reached an end node. Check warning_count for node failures the run carried on past |
failed | An error occurred; run terminated |
rejected | A reviewer rejected a user_approval step, which ends the run |
cancelled | Manually cancelled via the API (POST /api/v1/agent-workflows/runs/{run_id}/cancel) |
Editor: Runs Tab
Inside the Agent Builder editor, click the Runs tab in the right panel to see the most recent runs for the current workflow without leaving the editor. Each row shows status, trigger, elapsed time, and, for runs that used a model, tokens and estimated cost (e.g. 640 tok · $0.0012). A ⚠ count marks runs with warnings.
Evaluate Panel
The editor's Evaluate panel (test cases) shows per-run metrics after each evaluation:
- Latency — end-to-end duration in milliseconds
- Tokens — total tokens consumed (prompt + completion)
- Cost — estimated USD cost based on the model's pricing
Use the Evaluate panel to compare different versions of a workflow before publishing.
Admin-Level Analytics
Platform admins can see analytics across all workflows, catalogs, and node types at Admin > Analytics > Agents.
Platform summary
GET /api/v1/agent-analytics/summary
Authorization: Bearer <admin-token>
?catalog_id=...
&space_id=...
&workflow_id=...
&start_ts=...
&end_ts=...All runs (paginated)
GET /api/v1/agent-analytics/runs
Authorization: Bearer <admin-token>
?status=failed
&limit=50Accepts the same filters as the platform summary plus status, limit (1–200, default 50) and offset. Each row includes workflow_name, so the admin runs table shows workflow names alongside run IDs for every workflow. The row also has tokens, cost and warning_count. The status filter offers every run state.
GET /api/v1/agent-analytics/runs/{run_id} returns one row; an unknown id returns 404.
Node-type performance
GET /api/v1/agent-analytics/node-stats
Authorization: Bearer <admin-token>
?catalog_id=...
&workflow_id=...
&start_ts=... (Unix seconds)
&end_ts=...Response:
[
{
"node_type": "agent",
"count": 1240,
"avg_latency_ms": 1823.5,
"p50_latency_ms": 1600.0,
"p95_latency_ms": 4200.0,
"error_count": 12,
"warning_count": 3
},
{
"node_type": "classify",
"count": 620,
"avg_latency_ms": 412.1,
"p50_latency_ms": 380.0,
"p95_latency_ms": 920.0,
"error_count": 2,
"warning_count": 0
}
]Results are sorted by avg_latency_ms descending — the slowest node types appear first.
countand the latencies cover completed node executions.error_countcounts node errors.warning_countcounts nodes that failed but were handled inside the run.
Stats come from run timelines, which every run records — editor and API runs, and runs fired by a webhook, cron schedule or event.
The node type is recorded with each event. For events recorded before that, it's looked up from the workflow's current graph by node id. A node that has since been removed from the graph shows as unknown.
Run timeline (per run)
GET /api/v1/agent-analytics/runs/{run_id}/timeline
Authorization: Bearer <admin-token>Returns the ordered list of SSE events stored for a specific run — useful for replaying what happened during a failed run or debugging unexpected output. An unknown run_id returns 404; a run with no recorded events returns [].
Related
- Run Infrastructure — SSE event types, pause/resume, rate limiting
- Triggers —
run_idreturned immediately when a webhook fires a workflow - Workflow Lifecycle — publishing gates that affect which runs appear in analytics