# Retry a Step Now

> Execute a workflow step that is waiting for its next retry immediately

`POST /v2/messages/{messageId}/retry`

When a step fails, Upstash Workflow schedules the next attempt according to the configured retry delay. This endpoint skips the remaining wait and executes the step right away, so the workflow run can continue without waiting.

Retrying now does not add an extra attempt. It moves the already scheduled retry forward, so the retry count and the remaining retries stay the same.

The `messageId` of a retrying step is available in the step details returned by the [logs](/workflow/api-reference/logs/list-workflow-run-logs) endpoint. Steps waiting for a retry have a `nextDeliveryTime`. If multiple parallel steps are waiting for a retry, call this endpoint once for each step.

See [Retry a Step Now](/workflow/howto/retry-now) for more details.

## OpenAPI

````yaml workflow/openapi.yaml post /v2/messages/{messageId}/retry
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-{region}.upstash.io
    description: Regional
    variables:
      region:
        default: eu-central-1
        enum:
          - us-east-1
          - eu-central-1
security:
  - bearerAuth: []
  - bearerAuthQuery: []
paths:
  /v2/messages/{messageId}/retry:
    post:
      tags:
        - Runs
      summary: Retry a Step Now
      description: Execute a workflow step that is waiting for its next retry immediately
      x-mint:
        content: >
          When a step fails, Upstash Workflow schedules the next attempt
          according to the configured retry delay. This endpoint skips the
          remaining wait and executes the step right away, so the workflow run
          can continue without waiting.


          Retrying now does not add an extra attempt. It moves the already
          scheduled retry forward, so the retry count and the remaining retries
          stay the same.


          The `messageId` of a retrying step is available in the step details
          returned by the
          [logs](/workflow/api-reference/logs/list-workflow-run-logs) endpoint.
          Steps waiting for a retry have a `nextDeliveryTime`. If multiple
          parallel steps are waiting for a retry, call this endpoint once for
          each step.


          See [Retry a Step Now](/workflow/howto/retry-now) for more details.
      parameters:
        - in: path
          name: messageId
          required: true
          schema:
            type: string
          description: The message ID of the retrying step.
      responses:
        "200":
          description: The step is scheduled for immediate execution.
        "400":
          description: The message id is invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Step not found, or the step is not waiting for a retry.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  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
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
````
