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

# List Failed Workflow Runs

> List and paginate through all failed workflow runs currently in the DLQ.

Failed workflows end up in the DLQ after exhausting all retry attempts. You can filter,
paginate, and inspect these failures to understand what went wrong and decide whether to
resume, restart, or delete them.




## OpenAPI

````yaml /workflow/openapi.yaml get /v2/workflows/dlq
openapi: 3.1.0
info:
  title: Upstash Workflow REST API
  description: >
    Upstash Workflow is a serverless workflow orchestration service built on top
    of Upstash QStash and Upstash Redis.
  version: 2.0.0
  contact:
    name: Upstash
    url: https://upstash.com
servers:
  - url: https://qstash.upstash.io
security:
  - bearerAuth: []
  - bearerAuthQuery: []
paths:
  /v2/workflows/dlq:
    get:
      tags:
        - DLQ
      summary: List Failed Workflow Runs
      description: >
        List and paginate through all failed workflow runs currently in the DLQ.


        Failed workflows end up in the DLQ after exhausting all retry attempts.
        You can filter,

        paginate, and inspect these failures to understand what went wrong and
        decide whether to

        resume, restart, or delete them.
      parameters:
        - in: query
          name: cursor
          required: false
          schema:
            type: string
          description: Pagination cursor. If provided, returns the next page of results.
        - in: query
          name: count
          required: false
          schema:
            type: integer
            default: 100
            maximum: 100
          description: The maximum number of failed workflow runs to return per page.
        - in: query
          name: fromDate
          required: false
          schema:
            type: integer
            format: int64
          description: >-
            Filter by starting date in milliseconds (Unix timestamp). This is
            inclusive.
        - in: query
          name: toDate
          required: false
          schema:
            type: integer
            format: int64
          description: >-
            Filter by ending date in milliseconds (Unix timestamp). This is
            inclusive.
        - in: query
          name: workflowUrl
          required: false
          schema:
            type: string
          description: Filter by workflow URL.
        - in: query
          name: workflowRunId
          required: false
          schema:
            type: string
          description: Filter by workflow run ID.
        - in: query
          name: workflowCreatedAt
          required: false
          schema:
            type: integer
            format: int64
          description: >-
            Filter by workflow creation timestamp in milliseconds (Unix
            timestamp).
        - in: query
          name: label
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
          description: >
            Filter by label assigned to the workflow run. Supports multi-value
            filtering. You can pass multiple values to match workflow runs with
            any of the given labels (OR logic).


            Examples:

            - `label=my_label`

            - `label=label_1&label=label_2`
        - in: query
          name: failureFunctionState
          required: false
          schema:
            type: string
          description: |
            Filter by failure function state.

             | State | Description |
            |--------|--------------|
            | CALLBACK_INPROGRESS | The failure function is in progress. |
            | CALLBACK_SUCCESS | The failure function run successfully. |
            | CALLBACK_FAIL | The failure function failed to run. |
            | CALLBACK_CANCELED | The failure function was manually canceled |
        - in: query
          name: callerIp
          required: false
          schema:
            type: string
          description: Filter by IP address of the publisher.
        - in: query
          name: flowControlKey
          required: false
          schema:
            type: string
          description: Filter by Flow Control Key.
      responses:
        '200':
          description: List of failed workflow runs
          content:
            application/json:
              schema:
                type: object
                properties:
                  cursor:
                    type: string
                    description: >-
                      Pagination cursor for the next page. Empty if no more
                      results.
                  messages:
                    type: array
                    items:
                      $ref: '#/components/schemas/WorkflowDLQMessage'
                    description: Array of failed workflow messages.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    WorkflowDLQMessage:
      type: object
      properties:
        dlqId:
          type: string
          description: The DLQ ID of the failed workflow message.
        workflowUrl:
          type: string
          description: The URL of the workflow.
        workflowRunId:
          type: string
          description: The ID of the workflow run.
        workflowCreatedAt:
          type: integer
          format: int64
          description: >-
            The timestamp when the workflow run was created (Unix timestamp in
            milliseconds).
        url:
          type: string
          description: The URL of the failed workflow step.
        method:
          type: string
          description: The HTTP method used for the workflow step.
        header:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: The HTTP headers sent to the workflow step.
        body:
          type: string
          description: >-
            The body of the message if it is composed of utf8 chars only, empty
            otherwise.
        bodyBase64:
          type: string
          description: >-
            The base64 encoded body if the body contains a non-utf8 char only,
            empty otherwise.
        maxRetries:
          type: integer
          description: >-
            The number of retries that should be attempted in case of delivery
            failure.
        createdAt:
          type: integer
          format: int64
          description: The unix timestamp in milliseconds when the message was created.
        failureCallback:
          type: string
          description: The url where we send a callback to after the workflow fails.
        callerIP:
          type: string
          description: IP address of the publisher of this workflow.
        label:
          type: string
          deprecated: true
          description: >-
            The label assigned to the workflow run. Deprecated in favor of
            `labels`.
        labels:
          type: array
          items:
            type: string
          description: The list of labels assigned to the workflow run.
        flowControlKey:
          type: string
          description: The flow control key used for rate limiting.
        failureFunctionState:
          type: string
          description: The state of the failure function if applicable.
        responseStatus:
          type: integer
          description: The HTTP status code received from the destination API.
        responseHeader:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: The HTTP response headers received from the destination API.
        responseBody:
          type: string
          description: >-
            The body of the response if it is composed of utf8 chars only, empty
            otherwise.
        responseBodyBase64:
          type: string
          description: >-
            The base64 encoded body of the response if the body contains a
            non-utf8 char only, empty otherwise.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: QStash authentication token
    bearerAuthQuery:
      type: apiKey
      in: query
      name: qstash_token
      description: QStash authentication token passed as a query parameter

````