> ## 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 Workflow Run Logs



## OpenAPI

````yaml /workflow/openapi.yaml get /v2/workflows/logs
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/logs:
    get:
      tags:
        - Logs
      summary: List Workflow Run Logs
      parameters:
        - in: query
          name: cursor
          required: false
          schema:
            type: string
          description: Pagination cursor for fetching the next page of results.
        - in: query
          name: workflowUrl
          required: false
          schema:
            type: string
          description: >-
            Filter by workflow URL (exact match). Must start with http:// or
            https://.
        - in: query
          name: workflowRunId
          required: false
          schema:
            type: string
          description: Filter by specific 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: workflowRuns
          required: false
          schema:
            type: string
          description: >
            Filter by multiple workflow runs. Provide a comma-separated list of
            `workflowRunId@workflowCreatedAt` pairs to query specific runs in a
            single request.


            Example: `workflowRuns=ID1@TS1,ID2@TS2`


            When this parameter is provided, all other filters are ignored.
        - in: query
          name: state
          required: false
          schema:
            type: string
          description: >
            Filter by workflow or step state. Common states include:


            | Value          |
            Description                                                    |

            | -------------- |
            -------------------------------------------------------------- |

            | `RUN_STARTED`  | The workflow has started to run and currently in
            progress.     |

            | `RUN_SUCCESS`  | The workflow run has completed
            succesfully.                    |

            | `RUN_FAILED`   | Some errors has occured and workflow failed after
            all retries. |

            | `RUN_CANCELED` | The workflow run has canceled upon user
            request.               |

            | `STEP_SUCCESS` | The step succesfully fnished.               |

            | `STEP_RETRY` | The step is being retried.               |

            | `STEP_FAILED` | The step is failed.               |

            | `STEP_PROGRESS` | The step is in progress.                |

            | `STEP_CANCELED` | The step is cancelled manually.               |
        - in: query
          name: fromDate
          required: false
          schema:
            type: integer
            format: int64
          description: >-
            Filter events from this date onwards in milliseconds (Unix
            timestamp). Inclusive.
        - in: query
          name: toDate
          required: false
          schema:
            type: integer
            format: int64
          description: >-
            Filter events up to this date in milliseconds (Unix timestamp).
            Inclusive.
        - in: query
          name: count
          required: false
          schema:
            type: integer
            default: 1000
            maximum: 1000
          description: |
            Maximum number of results to return per page.
            - Event mode: Max 1000 (default 1000)
            - Run mode (groupBy=workflowRunId): Max 10 (default 10)
        - in: query
          name: trimBody
          required: false
          schema:
            type: integer
            default: -1
          description: >
            Trim request/response bodies to this many bytes. Use -1 to exclude
            bodies entirely.

            Useful for reducing response size when bodies are large.
        - in: query
          name: label
          required: false
          schema:
            type: string
          description: |
            Filter workflow run by the label assigned by the user.
        - in: query
          name: flowControlKey
          required: false
          schema:
            type: string
          description: >
            Filter workflow run by the flow control key assigned by the user on
            trigger.
        - in: query
          name: callerIp
          required: false
          schema:
            type: string
          description: |
            Filter workflow run by the callerIp that started to workflow run.
      responses:
        '200':
          description: Workflow logs retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  cursor:
                    type: string
                    description: >-
                      Pagination cursor for the next page. Empty if no more
                      results.
                  runs:
                    type: array
                    items:
                      $ref: '#/components/schemas/WorkflowRun'
                    description: >-
                      Array of complete workflow runs with all steps and
                      metadata.
        '400':
          description: >-
            Bad Request - Invalid parameters (e.g., invalid cursor, state, or
            groupBy value)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    WorkflowRun:
      type: object
      properties:
        workflowRunId:
          type: string
          description: The unique identifier for this workflow run.
        workflowUrl:
          type: string
          description: The URL of the workflow.
        workflowState:
          type: string
          description: >
            The current state of the workflow run 


            | Value          |
            Description                                                    |
              | -------------- | -------------------------------------------------------------- |
              | `RUN_STARTED`  | The workflow has started to run and currently in progress.     |
              | `RUN_SUCCESS`  | The workflow run has completed succesfully.                    |
              | `RUN_FAILED`   | Some errors has occured and workflow failed after all retries. |
              | `RUN_CANCELED` | The workflow run has canceled upon user request.               |
        workflowRunCreatedAt:
          type: integer
          format: int64
          description: When the workflow run was created (Unix timestamp in milliseconds).
        workflowRunCompletedAt:
          type: integer
          format: int64
          description: When the workflow run completed (Unix timestamp in milliseconds).
        workflowRunCallerIp:
          type: string
          description: IP address of the client who triggered the workflow.
        steps:
          type: array
          items:
            $ref: '#/components/schemas/GroupedSteps'
          description: The workflow steps grouped by execution pattern.
        workflowRunResponse:
          type: string
          description: The response returned by the workflow run.
        invoker:
          $ref: '#/components/schemas/InvokerContext'
          description: Information about the workflow that invoked this one.
        failureFunction:
          $ref: '#/components/schemas/FailureFunction'
          description: Information about the failure callback if configured.
        dlqId:
          type: string
          description: The DLQ ID if the workflow run failed.
        label:
          type: string
          description: Label assigned to the workflow run.
        flowControlKey:
          type: string
          description: Flow Control Key assigned to the workflow run.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
    GroupedSteps:
      type: object
      properties:
        steps:
          type: array
          items:
            $ref: '#/components/schemas/StepInfo'
          description: Array of steps in this group.
        type:
          type: string
          enum:
            - parallel
            - sequential
            - next
          description: The type of grouping (parallel, sequential, or next).
    InvokerContext:
      type: object
      properties:
        workflowRunId:
          type: string
          description: The workflow run ID of the invoker.
        workflowUrl:
          type: string
          description: The workflow URL of the invoker.
        workflowRunCreatedAt:
          type: integer
          format: int64
          description: The creation timestamp of the invoker workflow run.
    FailureFunction:
      type: object
      properties:
        messageId:
          type: string
          description: The message ID of the failure callback.
        url:
          type: string
          description: The URL of the failure callback.
        state:
          type: string
          description: The state of the failure callback.
        dlqId:
          type: string
          description: The DLQ ID of the failure callback if it failed.
        failHeaders:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: The headers from the failed workflow step.
        failStatus:
          type: integer
          description: The status code from the failed workflow step.
        failResponse:
          type: string
          description: The response body from the failed workflow step.
        responseBody:
          type: string
          description: The response body from the failure callback attempt.
        responseHeaders:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: The response headers from the failure callback attempt.
        responseStatus:
          type: integer
          description: The response status from the failure callback attempt.
        maxRetries:
          type: integer
          description: Maximum number of retries configured for the failure callback.
    StepInfo:
      type: object
      properties:
        stepId:
          type: integer
          format: int64
          description: The unique identifier for this step.
        stepName:
          type: string
          description: The name of the step.
        stepType:
          type: string
          description: The type of step (e.g., call, wait, sleep, invoke).
        callType:
          type: string
          description: The call type (e.g., step, parallelPlan, parallelResult).
        messageId:
          type: string
          description: The message ID for this step.
        state:
          type: string
          description: >-
            The state of the step (STEP_SUCCESS, STEP_RETRY, STEP_FAILED,
            STEP_PROGRESS, STEP_CANCELED).
        createdAt:
          type: integer
          format: int64
          description: When the step was created (Unix timestamp in milliseconds).
        out:
          type: string
          description: The output/result of the step.
        callUrl:
          type: string
          description: The URL called in this step.
        callMethod:
          type: string
          description: The HTTP method used.
        callBody:
          type: string
          description: The request body sent.
        callHeaders:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: The request headers sent.
        callResponseStatus:
          type: integer
          format: int64
          description: The HTTP status code received.
        callResponseBody:
          type: string
          description: The response body received.
        callResponseHeaders:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: The response headers received.
        waitEventId:
          type: string
          description: The event ID being waited for (wait steps only).
        waitTimeout:
          type: boolean
          description: Whether the wait timed out.
        invokedWorkflowRunId:
          type: string
          description: The run ID of the invoked workflow (invoke steps only).
        invokedWorkflowUrl:
          type: string
          description: The URL of the invoked workflow.
        retries:
          type: integer
          description: Maximum number of retries configured.
        nextDeliveryTime:
          type: integer
          format: int64
          description: Next scheduled retry time (Unix timestamp in milliseconds).
  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

````