> ## 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.

# Bulk Restart Workflows from DLQ

> Restart multiple failed workflow runs from the DLQ. Each workflow will start from the beginning.

Unlike resume, which continues from where workflows failed, restart executes the entire workflows
from the first step. New workflow run IDs are generated and all steps will be executed again.

A maximum of 50 workflow runs can be restarted per request. If more runs are available, a cursor is returned, which can be used in subsequent requests to continue the operation. When no cursor is returned, all entries have been processed.
Each restarted workflow run is assigned a new random Run ID.




## OpenAPI

````yaml /workflow/openapi.yaml post /v2/workflows/dlq/restart
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/restart:
    post:
      tags:
        - DLQ
      summary: Bulk Restart Workflows from DLQ
      description: >
        Restart multiple failed workflow runs from the DLQ. Each workflow will
        start from the beginning.


        Unlike resume, which continues from where workflows failed, restart
        executes the entire workflows

        from the first step. New workflow run IDs are generated and all steps
        will be executed again.


        A maximum of 50 workflow runs can be restarted per request. If more runs
        are available, a cursor is returned, which can be used in subsequent
        requests to continue the operation. When no cursor is returned, all
        entries have been processed.

        Each restarted workflow run is assigned a new random Run ID.
      parameters:
        - in: query
          name: dlqIds
          required: false
          schema:
            type: array
            items:
              type: string
          description: >-
            List of specific DLQ IDs to restart. If provided, other filters are
            ignored.
        - in: query
          name: cursor
          required: false
          schema:
            type: string
          description: Pagination cursor for restarting workflows in batches.
        - in: query
          name: count
          required: false
          schema:
            type: integer
          description: >-
            Maximum number of workflows to restart. If not provided, all
            matching workflows will be restarted.
        - in: query
          name: fromDate
          required: false
          schema:
            type: integer
            format: int64
          description: >-
            Filter workflows by starting date, in milliseconds (Unix timestamp).
            This is inclusive.
        - in: query
          name: toDate
          required: false
          schema:
            type: integer
            format: int64
          description: >-
            Filter workflows by ending date, in milliseconds (Unix timestamp).
            This is inclusive.
        - in: query
          name: workflowUrl
          required: false
          schema:
            type: string
          description: Filter workflows by workflow URL.
        - in: query
          name: workflowRunId
          required: false
          schema:
            type: string
          description: Filter workflows by workflow run ID.
        - in: query
          name: workflowCreatedAt
          required: false
          schema:
            type: integer
            format: int64
          description: >-
            Filter workflows by creation timestamp in milliseconds (Unix
            timestamp).
        - in: query
          name: label
          required: false
          schema:
            type: string
          description: Filter workflows by label assigned by the user.
        - in: query
          name: failureFunctionState
          required: false
          schema:
            type: string
          description: |
            Filter workflows 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 workflows by IP address of the publisher.
        - in: query
          name: flowControlKey
          required: false
          schema:
            type: string
          description: Filter workflows by Flow Control Key.
        - in: header
          name: Upstash-Retries
          required: false
          schema:
            type: integer
          description: Override the number of retries for the workflow steps.
        - in: header
          name: Upstash-Delay
          required: false
          schema:
            type: string
          description: >-
            Override the delay before executing the workflows. Format is
            `<value><unit>` (e.g., "10s", "5m").
        - in: header
          name: Upstash-Retry-Delay
          required: false
          schema:
            type: string
          description: Override the retry delay expression for the workflow steps.
        - in: header
          name: Upstash-Flow-Control-Key
          required: false
          schema:
            type: string
          description: Override the flow control key for the workflows.
        - in: header
          name: Upstash-Flow-Control-Value
          required: false
          schema:
            type: string
          description: >-
            Override the flow control configuration in the format
            `parallelism=<value>, rate=<value>, period=<value>`.
        - in: header
          name: Upstash-Label
          required: false
          schema:
            type: string
          description: Override the label for the workflows.
        - in: header
          name: Upstash-Failure-Callback
          required: false
          schema:
            type: string
          description: Override the failure callback URL for the workflows.
      responses:
        '200':
          description: Workflows restarted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  workflowRuns:
                    type: array
                    items:
                      type: object
                      properties:
                        workflowRunId:
                          type: string
                          description: >-
                            The ID of the restarted workflow run (a new ID is
                            generated for each restarted run).
                        workflowCreatedAt:
                          type: integer
                          format: int64
                          description: >-
                            The timestamp when the restarted workflow run was
                            created (Unix timestamp in milliseconds).
                    description: Array of restarted workflow runs.
                  cursor:
                    type: string
                    description: >-
                      Pagination cursor to use in subsequent requests. If empty,
                      all matching workflows have been processed.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Some DLQ messages were not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    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

````