Skip to navigation

List Workflows

List workflows in the current workspace.

Returns a counted, paginated list of workflows scoped to the X-Workspace-Id header. Each item includes aggregate stats (runs_count, last_run_at, last_run_status, run_status_counts) computed over all runs for that workflow. run_status_counts is a per-raw-RunStatus map whose values sum to runs_count and are NOT affected by the status filter below, so a collapsed row can render an accurate per-tab total without a separate runs query.

Status filter: status narrows by the UI-derived state of the workflow’s most recent run. completed matches only workflows whose latest run succeeded (completed-only), and failed matches only workflows whose latest run failed — the two buckets are disjoint. A workflow whose latest run was cancelled matches neither bucket and surfaces only in the unfiltered list. running matches active (running or paused) workflows. draft matches workflows with no runs yet. paused is accepted but currently returns no results.

Multi-sort: sort and order are parallel query lists. ?sort=runs_count&sort=name&order=desc&order=asc orders primarily by runs_count DESC, then by name ASC. When order has fewer entries than sort, missing positions use per-field defaults (name=asc, updated_at=desc, runs_count=desc). Omitting sort defaults to updated_at DESC. A stable id ASC tiebreaker is always appended so offset/limit pagination is consistent when sort keys tie.

Date range: last_run_after / last_run_before filter by the time of the most recent run. Both must be ISO 8601 with a UTC offset; a naive datetime returns 422. An inverted range (after > before) also returns 422.

Failure history: has_failed_run is orthogonal to status. status keys off the latest run only; has_failed_run=true matches workflows with a failed run anywhere in their history, so a workflow whose latest run completed still matches if an earlier run failed. It composes with the other filters (AND). cancelled runs do not count as failures.

pagination.total reflects the filtered count for the current query.

Authentication

AuthorizationBearer
Clerk JWT token
OR
AuthorizationBearer

Onepin live API key (op_live_...). Test and public keys are reserved in Phase 1.

Headers

X-Workspace-Idstring or nullOptional

Query parameters

statusenum or nullOptional

UI workflow status filter. completed matches workflows whose latest run succeeded (completed-only); failed matches failed-only — the two are disjoint. A workflow whose latest run was cancelled matches neither and appears only in the unfiltered list. paused is accepted for forward compatibility and currently returns no rows.

Allowed values:
searchstring or nullOptional<=100 characters

Case-insensitive search over name and description.

sortlist of enums or nullOptional

Repeat for multi-sort. Pairs with order index-wise.

Allowed values:
orderlist of enums or nullOptional

Parallel to sort[]; shorter is padded with per-field defaults.

Allowed values:
last_run_afterdatetime or nullOptional

Filter workflows whose last_run_at is at or after this ISO datetime (ISO 8601 with UTC offset required).

last_run_beforedatetime or nullOptional

Filter workflows whose last_run_at is at or before this ISO datetime (ISO 8601 with UTC offset required).

has_failed_runboolean or nullOptional

Filter by failure history — ORTHOGONAL to status (which is latest-run based). true returns only workflows with at least one run that ended in failed state anywhere in their history; a workflow whose latest run succeeded still matches if an earlier run failed. false returns only workflows that have never had a failed run. Composes (ANDs) with status/search/date filters. cancelled runs are not treated as failures.

include_definitionbooleanOptionalDefaults to false

Include each workflow's full definition graph in the response. Off by default because the graphs dominate the payload and a list view does not render them; turn it on to compare what the listed workflows do without a per-workflow GET.

offsetintegerOptional>=0Defaults to 0

Zero-based pagination offset.

limitintegerOptional1-100Defaults to 20

Maximum items to return (1–100).

Response

Successful Response
datalist of objects
metaobject
paginationobject
PaginationMeta variant for endpoints that compute an unpaginated total.

Errors

422
Unprocessable Entity Error