> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://onepin.ai/docs/reference/api-reference/workflows/list/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://onepin.ai/_mcp/server. # List Workflows GET https://api.onepin.ai/api/v1/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. Reference: https://onepin.ai/docs/reference/api-reference/workflows/list ## Authentication - `Authorization` header (bearer token, required) — Clerk JWT token - `Authorization` header (bearer token, required) — Onepin live API key (`op_live_...`). Test and public keys are reserved in Phase 1. ## Servers - `https://api.onepin.ai` (prod, default) - `https://dev-api.onepin.ai` (dev) ## Request ### Query parameters - `status` (enum, optional, nullable) — 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: `draft`, `running`, `completed`, `failed`, `paused` - `search` (string, optional, nullable) — Case-insensitive search over name and description. - `sort` (list of enum, optional, nullable) — Repeat for multi-sort. Pairs with `order` index-wise. - Allowed values: `name`, `updated_at`, `runs_count` - `order` (list of enum, optional, nullable) — Parallel to sort[]; shorter is padded with per-field defaults. - Allowed values: `asc`, `desc` - `last_run_after` (datetime, optional, nullable) — Filter workflows whose last_run_at is at or after this ISO datetime (ISO 8601 with UTC offset required). - `last_run_before` (datetime, optional, nullable) — Filter workflows whose last_run_at is at or before this ISO datetime (ISO 8601 with UTC offset required). - `has_failed_run` (boolean, optional, nullable) — 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_definition` (boolean, optional, default: 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. - `offset` (integer, optional, default: 0) — Zero-based pagination offset. - `limit` (integer, optional, default: 20) — Maximum items to return (1–100). ### Headers - `X-Workspace-Id` (string, optional, nullable) ## Response ### 200 Successful Response - `data` (list of WorkflowListItem, required) - `meta` (Meta, required) - `pagination` (CountedPaginationMeta, required) — PaginationMeta variant for endpoints that compute an unpaginated total. ## Errors ### 422 Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ## Types ### WorkflowListItem - `id` (string, required) — Unique workflow identifier. - `user_id` (string, required) — ID of the user who created the workflow. - `name` (string, required) — Human-readable workflow name. - `name_source` (string, required) — How `name` was set: 'placeholder' | 'generated' | 'user'. - `created_at` (datetime, required) — When the workflow was created (UTC). - `updated_at` (datetime, required) — When the workflow was last modified (UTC). - `description` (string, optional, nullable) — Optional workflow description. - `definition` (map from string to any, optional, nullable) — Full workflow graph, present only when the request passed `include_definition=true`. Omitted by default: a list page needs names and run stats, not N graphs. Ask for it when you need to compare what the workflows in this list actually DO — which is a question the other fields here cannot answer at any list size. - `runs_count` (integer, optional, default: 0) — Total number of runs ever started for this workflow. - `last_run_at` (datetime, optional, nullable) — When the most recent run was created. Null if never run. - `last_run_status` (string, optional, nullable) — Raw RunStatus of the most recent run. One of: `pending`, `running`, `completed`, `failed`, `cancelled`, `paused`. Null if never run. - `run_status_counts` (RunStatusCounts, optional) — Number of runs per raw RunStatus, computed over ALL runs of this workflow (same population as `runs_count`; NOT affected by the list-level `status` filter). The sum of all values equals `runs_count`; statuses with no runs are 0. ### Meta - `request_id` (string, required) - `timestamp` (datetime, required) ### CountedPaginationMeta PaginationMeta variant for endpoints that compute an unpaginated total. - `limit` (integer, required) - `total` (integer, required) - `next` (string, optional, nullable) - `prev` (string, optional, nullable) ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) - `input` (any, optional) - `ctx` (ValidationErrorCtx, optional) ### RunStatusCounts Per-raw-`RunStatus` run counts for a workflow. Computed over ALL runs of the workflow — the same population as `runs_count` — so it is NOT affected by the list-level `status` filter. Every raw status is always present; a status with no runs is `0`. The sum of all fields equals `runs_count`, and each field matches the `pagination.total` of `GET /workflows/{id}/runs?status=`. These are RAW status counts (not the UI-derived `WorkflowListStatus` buckets), so the caller can group them per tab. - `pending` (integer, optional, default: 0) — Runs queued but not yet started. - `running` (integer, optional, default: 0) — Runs currently executing. - `completed` (integer, optional, default: 0) — Runs that finished successfully. - `failed` (integer, optional, default: 0) — Runs that ended in a failure state. - `cancelled` (integer, optional, default: 0) — Runs explicitly cancelled by a user. - `paused` (integer, optional, default: 0) — Runs currently paused/parked. ### ValidationErrorLocItems ### ValidationErrorCtx ## Examples **Response** ```json { "data": [ { "id": "string", "user_id": "string", "name": "string", "name_source": "string", "created_at": "2024-01-15T09:30:00Z", "updated_at": "2024-01-15T09:30:00Z", "description": "string", "definition": {}, "runs_count": 0, "last_run_at": "2024-01-15T09:30:00Z", "last_run_status": "string", "run_status_counts": { "pending": 0, "running": 0, "completed": 0, "failed": 0, "cancelled": 0, "paused": 0 } } ], "meta": { "request_id": "string", "timestamp": "2024-01-15T09:30:00Z" }, "pagination": { "limit": 1, "total": 1, "next": "string", "prev": "string" } } ``` **SDK Code** ```python import requests url = "https://api.onepin.ai/api/v1/workflows" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.onepin.ai/api/v1/workflows'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.onepin.ai/api/v1/workflows" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.onepin.ai/api/v1/workflows") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.onepin.ai/api/v1/workflows") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.onepin.ai/api/v1/workflows', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.onepin.ai/api/v1/workflows"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.onepin.ai/api/v1/workflows")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` > Onepin is a voice workflow platform that orchestrates, validates, and ships production-ready audio across 33 TTS models.