Skip to main content
POST
Count Workflow Runs

Authentication and permissions

Token requirements: User-based token (OAuth) or Organization-scoped API key or Team-scoped API key. Send a bearer access token for one of these identities. The permissions and resource restrictions below also apply.
Permissions joined by + are all required; or separates alternatives. Full-access keys still cannot call endpoints marked unsupported. Team keys must allow every team checked by the request. OAuth access depends on the user’s roles and resource access.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Same filter set as SearchWorkflowRunsRequest, minus pagination and include_output — the two requests must stay filter-compatible so a caller can count a result set and then page exactly that set.

teamId
string

The ID of the team. Required.

workflowId
string | null

The workflow UUID. Not a wf_ scoped id.

statuses
enum<string>[]

Filter by statuses (multiple allowed).

Available options:
WORKFLOW_RUN_STATUS_UNSPECIFIED,
WORKFLOW_RUN_STATUS_PENDING,
WORKFLOW_RUN_STATUS_RUNNING,
WORKFLOW_RUN_STATUS_COMPLETED,
WORKFLOW_RUN_STATUS_FAILED,
WORKFLOW_RUN_STATUS_DENIED,
WORKFLOW_RUN_STATUS_CANCELED
targetUserId
string | null

Filter by the target user for the workflow run.

initiatedByUserId
string | null

Filter by the user who initiated the workflow run.

createdAfter
string | null

Filter by runs created after this timestamp (RFC3339 format).

createdBefore
string | null

Filter by runs created before this timestamp (RFC3339 format).

linkedTicketId
string | null

Filter by linked ticket ID.

parentWorkflowRunId
string | null

Count only the direct child runs (sub-workflows) of this parent run.

includeChildRuns
boolean | null

Whether to include child runs (sub-workflows) in the count. Unset means true (matches include_output's unset-means-true convention). Set explicitly to false to count only top-level runs. include_child_runs=false is mutually exclusive with parent_workflow_run_id; combining them is a 400.

includeRunsWithLinkedTicket
boolean | null

When true, count only runs that are linked to a ticket (linked_ticket_id set). Unset and explicit false are equivalent — no filter is applied.

Response

200 - application/json

Success

count

The number of workflow runs matching the filters.