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

# Query workflows

> Use when listing or auditing workflow runs (e.g. ops dashboard or debugging). Returns a paginated list; supports filtering by workflow type and status.



## OpenAPI

````yaml /api-reference/openapi.json post /workflows/search
openapi: 3.0.1
info:
  title: Flexprice API
  description: Flexprice API Service
  contact:
    name: API Support
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1.0'
servers:
  - url: https://us.api.flexprice.io/v1
    description: US Region
  - url: https://api.cloud.flexprice.io/v1
    description: India Region
security: []
paths:
  /workflows/search:
    post:
      tags:
        - Workflows
      summary: Query workflows
      description: >-
        Use when listing or auditing workflow runs (e.g. ops dashboard or
        debugging). Returns a paginated list; supports filtering by workflow
        type and status.
      operationId: queryWorkflow
      requestBody:
        description: Filter
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/types.WorkflowExecutionFilter'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListWorkflowsResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    types.WorkflowExecutionFilter:
      type: object
      properties:
        end_time:
          type: string
          format: date-time
        entity:
          type: string
          description: e.g. plan, invoice, subscription
        entity_id:
          type: string
          description: e.g. plan_01ABC123
        expand:
          type: string
        filters:
          type: array
          description: >-
            filters allows complex filtering based on multiple fields (same as
            FeatureFilter)
          items:
            $ref: '#/components/schemas/types.FilterCondition'
        limit:
          maximum: 1000
          minimum: 1
          type: integer
        offset:
          minimum: 0
          type: integer
        order:
          type: string
          enum:
            - asc
            - desc
        sort:
          type: array
          items:
            $ref: '#/components/schemas/types.SortCondition'
        start_time:
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/types.Status'
        task_queue:
          type: string
        workflow_id:
          type: string
          description: Workflow-specific filters
        workflow_status:
          type: string
          description: e.g. Running, Completed, Failed
        workflow_type:
          type: string
      x-speakeasy-name-override: WorkflowExecutionFilter
    ListWorkflowsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowExecutionDTO'
        pagination:
          $ref: '#/components/schemas/types.PaginationResponse'
    errors.ErrorResponse:
      type: object
      properties:
        code:
          type: string
          enum:
            - not_found
            - already_exists
            - version_conflict
            - validation_error
            - invalid_operation
            - permission_denied
            - http_client_error
            - database_error
            - system_error
            - internal_error
            - service_unavailable
        details:
          type: object
          additionalProperties:
            type: object
        http_status_code:
          type: integer
        message:
          type: string
      x-speakeasy-name-override: ErrorResponse
    types.FilterCondition:
      type: object
      properties:
        data_type:
          $ref: '#/components/schemas/types.DataType'
        field:
          type: string
        operator:
          $ref: '#/components/schemas/types.FilterOperatorType'
        value:
          $ref: '#/components/schemas/types.Value'
      x-speakeasy-name-override: FilterCondition
    types.SortCondition:
      type: object
      properties:
        direction:
          $ref: '#/components/schemas/types.SortDirection'
        field:
          type: string
      x-speakeasy-name-override: SortCondition
    types.Status:
      type: string
      enum:
        - published
        - deleted
        - archived
      x-enum-varnames:
        - StatusPublished
        - StatusDeleted
        - StatusArchived
      x-speakeasy-name-override: Status
    WorkflowExecutionDTO:
      type: object
      properties:
        close_time:
          type: string
          format: date-time
        created_by:
          type: string
        duration_ms:
          type: integer
        entity:
          type: string
          description: e.g. plan, invoice, subscription
        entity_id:
          type: string
          description: e.g. plan ID, invoice ID
        run_id:
          type: string
        start_time:
          type: string
          format: date-time
        status:
          type: string
        task_queue:
          type: string
        total_duration:
          type: string
        workflow_id:
          type: string
        workflow_type:
          type: string
    types.PaginationResponse:
      type: object
      properties:
        limit:
          type: integer
        offset:
          type: integer
        total:
          type: integer
      x-speakeasy-name-override: PaginationResponse
    types.DataType:
      type: string
      enum:
        - string
        - number
        - date
        - array
      x-enum-varnames:
        - DataTypeString
        - DataTypeNumber
        - DataTypeDate
        - DataTypeArray
      x-speakeasy-name-override: DataType
    types.FilterOperatorType:
      type: string
      enum:
        - eq
        - contains
        - not_contains
        - gt
        - lt
        - in
        - not_in
        - before
        - after
      x-enum-varnames:
        - EQUAL
        - CONTAINS
        - NOT_CONTAINS
        - GREATER_THAN
        - LESS_THAN
        - IN
        - NOT_IN
        - BEFORE
        - AFTER
      x-speakeasy-name-override: FilterOperatorType
    types.Value:
      type: object
      properties:
        array:
          type: array
          items:
            type: string
        boolean:
          type: boolean
        date:
          type: string
        number:
          type: number
        string:
          type: string
      x-speakeasy-name-override: Value
    types.SortDirection:
      type: string
      enum:
        - asc
        - desc
      x-enum-varnames:
        - SortDirectionAsc
        - SortDirectionDesc
      x-speakeasy-name-override: SortDirection
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Enter your API key in the format *x-api-key &lt;api-key&gt;**
      name: x-api-key
      in: header

````