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

# List workflows

> Returns a paginated list of workflows in your organization.



## OpenAPI

````yaml /api-reference/v2.json get /workflows
openapi: 3.1.1
info:
  title: Deck API
  version: 2.0.0
servers:
  - url: https://api.deck.co/v2
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Agents
    description: >-
      Agents are the AI workers that execute tasks against sources. Create and
      manage the agents in your organization.
  - name: Components
    description: >-
      Embeddable UI components. Create short-lived session tokens for the Auth
      Component.
  - name: Credentials
    description: >-
      Credentials store the login details an agent uses at a source. Values are
      tokenized at rest and never returned in plaintext.
  - name: Event Destinations
    description: >-
      Where Deck delivers events: webhooks, SQS, Kinesis, S3, or EventBridge.
      Manage destinations and inspect delivery attempts.
  - name: Events
    description: >-
      Immutable records of things that happened in your organization, such as a
      task run completing or a credential being verified.
  - name: Sessions
    description: >-
      Sessions are agent sandbox lifetimes. A session is created for each task
      run (or explicitly) and counts toward your concurrency limit.
  - name: Sources
    description: >-
      Sources are the websites and portals agents work against. Register,
      inspect, reset, and delete them.
  - name: Storage
    description: >-
      Files produced by task runs: downloaded documents, exports, and extraction
      results.
  - name: Task Runs
    description: >-
      A task run is one execution of a task. Inspect status and output, retrieve
      files and screenshots, cancel runs, and answer interaction requests.
  - name: Tasks
    description: >-
      Tasks define reusable units of work for an agent: a goal, an input schema,
      and an output schema. Run them against sources with credentials.
  - name: Test
    description: Connectivity check for your API key.
  - name: Triggers
    description: Triggers run tasks automatically on a schedule or in response to events.
  - name: Workflows
  - name: Workflow Runs
paths:
  /workflows:
    get:
      tags:
        - Workflows
      summary: List workflows
      description: Returns a paginated list of workflows in your organization.
      operationId: listWorkflows
      parameters:
        - name: limit
          in: query
          description: Maximum number of items to return (1-100, default 20)
          schema:
            pattern: ^-?(?:0|[1-9]\d*)$
            type:
              - integer
              - string
            format: int32
            minimum: 1
            maximum: 100
            default: 20
            example: 20
        - name: cursor
          in: query
          schema:
            type: string
          description: Cursor from a previous response for pagination.
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/PaginatedResponseOfWorkflowResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponseOfWorkflowResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponseOfWorkflowResponse'
        '400':
          description: Bad request — validation error or malformed input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not found — the requested resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Conflict — the request is valid but cannot be completed in the
            current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Unprocessable content — the request body is understood but contains
            invalid values.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Too many requests — the organization-wide API rate limit was
            exceeded (`rate_limit_exceeded`). Retry with exponential backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PaginatedResponseOfWorkflowResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowResponse'
          description: Array of resource objects for the current page.
        has_more:
          type: boolean
          description: '`true` if there are more results beyond this page.'
        next_cursor:
          type:
            - 'null'
            - string
          description: >-
            Opaque cursor string to pass as the `cursor` query parameter on the
            next request. `null` when there are no more pages.
        request_id:
          type:
            - 'null'
            - string
          description: Unique identifier for the API request.
      required:
        - data
        - has_more
    ValidationErrorResponse:
      required:
        - errors
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
          description: RFC 9110 problem type URI.
        title:
          type:
            - 'null'
            - string
          description: Short summary of the validation failure.
        status:
          type:
            - 'null'
            - integer
          description: HTTP status code.
          format: int32
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Validation errors grouped by field name.
        traceId:
          type:
            - 'null'
            - string
          description: Request trace identifier.
      description: Validation error returned for malformed requests (HTTP 400).
    ErrorResponse:
      required:
        - errors
        - request_id
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/TaskRunError'
          description: One or more errors that describe what went wrong.
        request_id:
          type: string
          description: Unique identifier for this request, useful for tracing.
      description: Standard error response.
    WorkflowResponse:
      type: object
      required:
        - id
        - object
        - name
        - steps
        - created_at
        - updated_at
      properties:
        id:
          type: string
          pattern: ^wflo_
          example: wflo_AbC123xYz456
          description: Unique identifier for the workflow, prefixed with `wflo_`.
        object:
          type: string
          description: Always `workflow`.
        name:
          type: string
          description: Display name.
        steps:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowStep'
          description: Ordered array of step definitions.
        created_at:
          type: string
          format: date-time
          example: '2026-06-18T00:00:00Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-06-18T00:00:00Z'
        request_id:
          type: string
          description: >-
            Unique identifier for the API request. Include this when contacting
            support.
      description: Workflow definition object.
    TaskRunError:
      required:
        - type
        - code
        - message
      type: object
      properties:
        type:
          type: string
          description: >-
            Error category (e.g. `source`, `auth`, `task`, `rate_limit`).
            Determines the class of failure.
        code:
          type: string
          description: Machine-readable error code. Use this for programmatic handling.
        message:
          type: string
          description: >-
            Human-readable explanation. Do not rely on this for logic — it may
            change.
        field:
          type:
            - 'null'
            - string
          description: The input field that caused the error, when applicable.
      description: Error details for a failed task run. Same structure as API-level errors.
    WorkflowStep:
      oneOf:
        - $ref: '#/components/schemas/WorkflowTaskStep'
        - $ref: '#/components/schemas/WorkflowForEachStep'
      discriminator:
        propertyName: type
        mapping:
          task:
            $ref: '#/components/schemas/WorkflowTaskStep'
          for_each:
            $ref: '#/components/schemas/WorkflowForEachStep'
      description: One step of a workflow definition, discriminated by `type`.
    WorkflowTaskStep:
      type: object
      required:
        - name
        - type
        - task_id
      properties:
        name:
          type: string
          pattern: ^[a-z_][a-z0-9_]*$
          example: check_price
          description: >-
            Step identifier, unique within the workflow. Lowercase letters,
            digits, and underscores.
        type:
          type: string
          enum:
            - task
          description: Always `task`.
        task_id:
          type: string
          pattern: ^task_
          example: task_AbC123xYz456
          description: The task to run. The agent is derived from the task.
        credential_id:
          type:
            - 'null'
            - string
          description: Credential for the task run. Mutually exclusive with `source_id`.
        source_id:
          type:
            - 'null'
            - string
          description: >-
            Source for the task run, for public sources that don't require
            authentication. Mutually exclusive with `credential_id`.
        input:
          type:
            - 'null'
            - object
          additionalProperties: true
          description: >-
            Input for the task run. String values may reference an earlier
            step's output, or the current item inside a `for_each`, using the
            template syntax in [Build a
            workflow](/guides/workflows#wiring-outputs-into-inputs). A value
            that is a single reference keeps its JSON type. Not checked against
            the task's `input_schema` before the run starts.
        if:
          type:
            - 'null'
            - string
          description: >-
            Condition expression. When it evaluates false the step is `skipped`.
            Inside a `for_each`, the inner step's `if` may read `item`.
          example: steps.check_price.output.price_dropped == true
      description: A step that runs one task as a task run.
    WorkflowForEachStep:
      type: object
      required:
        - name
        - type
        - items
        - step
      properties:
        name:
          type: string
          pattern: ^[a-z_][a-z0-9_]*$
          example: process_refunds
          description: >-
            Step identifier, unique within the workflow. Lowercase letters,
            digits, and underscores.
        type:
          type: string
          enum:
            - for_each
          description: Always `for_each`.
        items:
          type: string
          example: steps.find.output.reservations
          description: Path to the array to iterate, on an earlier step's output.
        step:
          $ref: '#/components/schemas/WorkflowForEachInnerStep'
        failure_behavior:
          type:
            - 'null'
            - string
          enum:
            - null
            - stop
            - continue
          default: stop
          description: >-
            `stop` (default) fails the step on the first failed item, which
            stops the workflow. `continue` runs the remaining items and the
            workflow carries on; failed items have `null` output.
        if:
          type:
            - 'null'
            - string
          description: Condition expression gating the whole loop. May not read `item`.
      description: >-
        A step that runs an inner task step once per item in an array. Items run
        sequentially in the same session.
    WorkflowForEachInnerStep:
      type: object
      required:
        - task_id
      properties:
        type:
          type: string
          enum:
            - task
          description: '`task`. May be omitted; a loop''s inner step is always a task.'
        task_id:
          type: string
          pattern: ^task_
          example: task_AbC123xYz456
          description: The task to run. The agent is derived from the task.
        credential_id:
          type:
            - 'null'
            - string
          description: Credential for the task run. Mutually exclusive with `source_id`.
        source_id:
          type:
            - 'null'
            - string
          description: >-
            Source for the task run, for public sources that don't require
            authentication. Mutually exclusive with `credential_id`.
        input:
          type:
            - 'null'
            - object
          additionalProperties: true
          description: >-
            Input for the task run. String values may reference an earlier
            step's output, or the current item inside a `for_each`, using the
            template syntax in [Build a
            workflow](/guides/workflows#wiring-outputs-into-inputs). A value
            that is a single reference keeps its JSON type. Not checked against
            the task's `input_schema` before the run starts.
        if:
          type:
            - 'null'
            - string
          description: >-
            Condition expression. When it evaluates false the step is `skipped`.
            Inside a `for_each`, the inner step's `if` may read `item`.
          example: steps.check_price.output.price_dropped == true
      description: >-
        The task step a `for_each` runs once per item. It has no `name`;
        reference the loop by its outer name.
  securitySchemes:
    BearerAuth:
      type: http
      description: Secret key (sk_live_...)
      scheme: bearer
      bearerFormat: JWT

````