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

# List workflows

> List the project's workflows or their status counts. Use view='list' for the paginated inventory (filter by type/status/search) or view='counts' for totals.



## OpenAPI

````yaml https://mcp.agent.writesonic.com/openapi.json post /api/v1/business/workflows/query
openapi: 3.1.0
info:
  title: hq-backend — Business API
  description: Public business tool endpoints (API-key auth).
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/business/workflows/query:
    post:
      tags:
        - business
      summary: List workflows
      description: >-
        List the project's workflows or their status counts. Use view='list' for
        the paginated inventory (filter by type/status/search) or view='counts'
        for totals.
      operationId: list_workflows_api_v1_business_workflows_query_post
      parameters:
        - name: x-project-id
          in: header
          required: true
          schema:
            type: string
            format: uuid
            description: Project ID for tenant scoping
            title: X-Project-Id
          description: Project ID for tenant scoping
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Overrides the key's workspace
            title: X-Workspace-Id
          description: Overrides the key's workspace
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: User API key
            title: X-Api-Key
          description: User API key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowListArgs'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WorkflowListArgs:
      properties:
        view:
          $ref: '#/components/schemas/WorkflowListView'
          description: '''list'' for the paginated inventory, ''counts'' for status counts'
        type:
          anyOf:
            - $ref: '#/components/schemas/WorkflowType'
            - type: 'null'
          description: >-
            Filter by workflow type: system (the curated Playbooks the tagging
            UI offers) or user (workflows built by users in this workspace).
        search:
          anyOf:
            - type: string
            - type: 'null'
          title: Search
          description: Free-text search over workflow names
        status:
          anyOf:
            - $ref: '#/components/schemas/WorkflowVersionStatus'
            - type: 'null'
          description: Filter by latest version status
        sort_by:
          anyOf:
            - $ref: '#/components/schemas/WorkflowSortBy'
            - type: 'null'
          description: Sort field
        sort_order:
          $ref: '#/components/schemas/SortOrder'
          description: Sort direction
          default: desc
        page:
          type: integer
          minimum: 1
          title: Page
          description: 1-based page number (list view)
          default: 1
        size:
          type: integer
          maximum: 100
          minimum: 1
          title: Size
          description: Page size (list view)
          default: 50
      type: object
      required:
        - view
      title: WorkflowListArgs
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WorkflowListView:
      type: string
      enum:
        - list
        - counts
      title: WorkflowListView
    WorkflowType:
      type: string
      enum:
        - system
        - user
      title: WorkflowType
    WorkflowVersionStatus:
      type: string
      enum:
        - draft
        - published
      title: WorkflowVersionStatus
    WorkflowSortBy:
      type: string
      enum:
        - created_at
        - last_edited
        - last_run
      title: WorkflowSortBy
    SortOrder:
      type: string
      enum:
        - asc
        - desc
      title: SortOrder
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````