> ## Documentation Index
> Fetch the complete documentation index at: https://docs.serval.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Workflow Runs

> Search workflow runs with filters. Supports filtering by workflow ID, status, user IDs, time range, linked ticket, and parent_workflow_run_id. To investigate a run's sub-workflows, search with parent_workflow_run_id set to that run's id (combine with statuses=[FAILED] to find failing children), then recurse into each child run.



## OpenAPI

````yaml /sections/api-reference/openapi-spec-v2.yaml post /v2/workflow-runs/search
openapi: 3.1.0
info:
  title: Serval Public API
  description: Serval Public API
  contact:
    name: Serval
    url: https://serval.com
    email: support@serval.com
  license:
    name: Serval License
    url: https://serval.com/license
  version: 2.0.0
servers:
  - url: https://public.api.serval.com
security:
  - BearerAuth: []
tags:
  - name: Access Policy API
  - name: Access Policy Approval Procedure API
  - name: Access Profile API
  - name: Access Relationship API
  - name: Access Request API
  - name: Agent API
  - name: App Instance API
  - name: App Resource API
  - name: App Resource Role API
  - name: Approval Delegation API
  - name: Approval Request API
  - name: Audit Log API
  - name: Change Blackout API
  - name: Change Model API
  - name: Custom Field API
  - name: Custom Service API
  - name: Entity API
  - name: Entity Field Mapping API
  - name: Entity Ingestion Config API
  - name: Entity Type API
  - name: Folder API
  - name: Group API
  - name: Guidance API
  - name: Help Agent API
  - name: Journey API
  - name: Knowledge API
  - name: Knowledge Base API
  - name: Report API
  - name: SLA API
  - name: Schedule API
  - name: Tag API
  - name: Team API
  - name: Team User API
  - name: Ticket API
  - name: Topic API
  - name: User API
  - name: User Relationship API
  - name: Workflow API
  - name: Workflow Approval Procedure API
  - name: Workflow Run API
paths:
  /v2/workflow-runs/search:
    post:
      tags:
        - Workflow Run API
      summary: Search Workflow Runs
      description: >-
        Search workflow runs with filters. Supports filtering by workflow ID,
        status, user IDs, time range, linked ticket, and parent_workflow_run_id.
        To investigate a run's sub-workflows, search with parent_workflow_run_id
        set to that run's id (combine with statuses=[FAILED] to find failing
        children), then recurse into each child run.
      operationId: svrelay.publicv2.PublicAPIServiceV2.SearchWorkflowRuns
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/svflow.publicapi.SearchWorkflowRunsRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/svflow.publicapi.SearchWorkflowRunsResponse
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
      security:
        - BearerAuth: []
components:
  schemas:
    svflow.publicapi.SearchWorkflowRunsRequest:
      type: object
      properties:
        teamId:
          type: string
          title: team_id
          description: The ID of the team. Required.
          x-stainless-terraform-configurability: optional
        workflowId:
          type: string
          title: workflow_id
          description: Filter by workflow ID.
          nullable: true
          x-stainless-terraform-configurability: optional
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/svflow.common.models.WorkflowRunStatus'
          title: statuses
          description: Filter by statuses (multiple allowed).
          x-stainless-terraform-configurability: optional
        targetUserId:
          type: string
          title: target_user_id
          description: Filter by the target user for the workflow run.
          nullable: true
          x-stainless-terraform-configurability: optional
        initiatedByUserId:
          type: string
          title: initiated_by_user_id
          description: Filter by the user who initiated the workflow run.
          nullable: true
          x-stainless-terraform-configurability: optional
        createdAfter:
          type: string
          title: created_after
          description: Filter by runs created after this timestamp (RFC3339 format).
          nullable: true
          x-stainless-terraform-configurability: optional
        createdBefore:
          type: string
          title: created_before
          description: Filter by runs created before this timestamp (RFC3339 format).
          nullable: true
          x-stainless-terraform-configurability: optional
        linkedTicketId:
          type: string
          title: linked_ticket_id
          description: Filter by linked ticket ID.
          nullable: true
          x-stainless-terraform-configurability: optional
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            Maximum number of results to return. Default is 50, maximum is 200.
             Larger values are silently coerced server-side; the actual value used
             is returned in the X-Served-Page-Size response header.
          nullable: true
          x-stainless-terraform-configurability: computed_optional
        pageToken:
          type: string
          title: page_token
          description: Token for pagination. Leave empty for the first request.
          nullable: true
          x-stainless-terraform-configurability: optional
        includeOutput:
          type: boolean
          title: include_output
          description: |-
            When true (default), each returned run includes its `output` field
             (the full workflow result). For multi-row search responses this can be
             megabytes per row — set to false if you only need run metadata; you
             can then fetch full output per-run via GetWorkflowRun. Strongly
             recommended `false` for any caller that does not need `output`.
          nullable: true
          x-stainless-terraform-configurability: computed_optional
        parentWorkflowRunId:
          type: string
          title: parent_workflow_run_id
          description: |-
            Filter to the direct child runs (sub-workflows) of this parent run.
             Pass a run ID here to list the runs it spawned one level deep; combine
             with `statuses` (e.g. FAILED) to find the failing children.
          nullable: true
          x-stainless-terraform-configurability: optional
      title: SearchWorkflowRunsRequest
      additionalProperties: false
    svflow.publicapi.SearchWorkflowRunsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/svflow.pubapimodels.WorkflowRun'
          title: data
          description: The list of workflow runs.
          x-stainless-terraform-configurability: optional
        nextPageToken:
          type: string
          title: next_page_token
          description: >-
            Token for retrieving the next page of results. Empty if no more
            results.
          nullable: true
          x-stainless-terraform-configurability: optional
      title: SearchWorkflowRunsResponse
      additionalProperties: false
    connect.error:
      type: object
      properties:
        code:
          type: string
          examples:
            - not_found
          enum:
            - canceled
            - unknown
            - invalid_argument
            - deadline_exceeded
            - not_found
            - already_exists
            - permission_denied
            - resource_exhausted
            - failed_precondition
            - aborted
            - out_of_range
            - unimplemented
            - internal
            - unavailable
            - data_loss
            - unauthenticated
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
          x-stainless-terraform-configurability: optional
        message:
          type: string
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
          x-stainless-terraform-configurability: optional
        detail:
          $ref: '#/components/schemas/google.protobuf.Any'
          x-stainless-terraform-configurability: optional
      title: Connect Error
      additionalProperties: true
      description: >-
        Error type returned by Connect:
        https://connectrpc.com/docs/go/errors/#http-representation
    svflow.common.models.WorkflowRunStatus:
      type: string
      title: WorkflowRunStatus
      enum:
        - 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
    svflow.pubapimodels.WorkflowRun:
      type: object
      properties:
        id:
          type: string
          title: id
          description: |-
            The unique ID of the workflow run. Persist this to follow up with
             GetWorkflowRun / AwaitWorkflowRunResult. This is the orchestration
             (Temporal) run ID — the same identifier returned by the webhook
             trigger response and by the worker SDK as `ctx.currentWorkflowRun.id`.
          x-stainless-terraform-configurability: optional
        workflowId:
          type: string
          title: workflow_id
          description: The ID of the workflow that was run.
          x-stainless-terraform-configurability: optional
        teamId:
          type: string
          title: team_id
          description: The ID of the team that the workflow belongs to.
          x-stainless-terraform-configurability: optional
        status:
          $ref: '#/components/schemas/svflow.common.models.WorkflowRunStatus'
          title: status
          description: The status of the workflow run.
          x-stainless-terraform-configurability: optional
        createdAt:
          type: string
          title: created_at
          description: The timestamp when the workflow run was created.
          x-stainless-terraform-configurability: optional
        completedAt:
          type: string
          title: completed_at
          description: The timestamp when the workflow run completed (if applicable).
          nullable: true
          x-stainless-terraform-configurability: optional
        initiatedByUserId:
          type: string
          title: initiated_by_user_id
          description: The ID of the user who initiated the workflow run.
          x-stainless-terraform-configurability: optional
        targetUserId:
          type: string
          title: target_user_id
          description: >-
            The ID of the target user for the workflow run (if different from
            initiator).
          nullable: true
          x-stainless-terraform-configurability: optional
        inputs:
          type: string
          title: inputs
          description: The inputs provided to the workflow (JSON string).
          nullable: true
          x-stainless-terraform-configurability: optional
        output:
          type: string
          title: output
          description: >-
            The output of the workflow run (JSON string, available when
            completed or failed).
          nullable: true
          x-stainless-terraform-configurability: optional
        linkedTicketId:
          type: string
          title: linked_ticket_id
          description: The ID of the linked ticket, if any.
          nullable: true
          x-stainless-terraform-configurability: optional
        approvalRequestId:
          type: string
          title: approval_request_id
          description: >-
            The ID of the approval request associated with this workflow run, if
            any.
          nullable: true
          readOnly: true
          x-stainless-terraform-configurability: computed
        statusUpdatedAt:
          type: string
          title: status_updated_at
          description: The timestamp when the workflow run status was last updated.
          readOnly: true
          x-stainless-terraform-configurability: computed
        parentWorkflowRunId:
          type: string
          title: parent_workflow_run_id
          description: >-
            The run ID of the parent workflow run that spawned this run, if this
            run
             is a child (sub-workflow). Empty for top-level runs.
          nullable: true
          readOnly: true
          x-stainless-terraform-configurability: computed
        parentWorkflowRunStepNumber:
          type:
            - integer
            - string
          title: parent_workflow_run_step_number
          format: int64
          description: >-
            The step number in the parent run that spawned this run, if this run
            is
             a child.
          nullable: true
          readOnly: true
          x-stainless-terraform-configurability: computed
      title: WorkflowRun
      additionalProperties: false
      description: WorkflowRun represents a single execution of a workflow.
    google.protobuf.Any:
      type: object
      properties:
        type:
          type: string
          x-stainless-terraform-configurability: optional
        value:
          type: string
          format: binary
          x-stainless-terraform-configurability: optional
        debug:
          type: object
          additionalProperties: true
          x-stainless-terraform-configurability: optional
      additionalProperties: true
      description: >-
        Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````