Skip to main content
POST
Count Workflow Runs

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

Filter by workflow 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

Success

count

The number of workflow runs matching the filters.