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

# Notify Workflow Run Event

> Notify an event to a specific workflow run's waiters.

This endpoint sends an event notification to waiters within a specific workflow run.
Unlike the general notify endpoint, this uses a "safe notify" mechanism that guarantees
delivery even if no waiter is currently active.

**Safe Notify Behavior:**
- If a waiter is currently active, it receives the notification immediately
- If no waiter is active, the notification is saved in the database
- When a waiter becomes active later, it will consume the saved notification
- This ensures events are never lost due to timing issues




## OpenAPI

````yaml /workflow/openapi.yaml post /v2/notify/{workflowRunId}/{eventId}
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/notify/{workflowRunId}/{eventId}:
    post:
      tags:
        - Notify
      summary: Notify Workflow Run Event
      description: >
        Notify an event to a specific workflow run's waiters.


        This endpoint sends an event notification to waiters within a specific
        workflow run.

        Unlike the general notify endpoint, this uses a "safe notify" mechanism
        that guarantees

        delivery even if no waiter is currently active.


        **Safe Notify Behavior:**

        - If a waiter is currently active, it receives the notification
        immediately

        - If no waiter is active, the notification is saved in the database

        - When a waiter becomes active later, it will consume the saved
        notification

        - This ensures events are never lost due to timing issues
      parameters:
        - in: path
          name: workflowRunId
          required: true
          schema:
            type: string
          description: The workflow run ID to notify.
        - in: path
          name: eventId
          required: true
          schema:
            type: string
          description: The event ID that waiters are listening for.
      requestBody:
        description: >-
          The event data to send to the waiter. This will be the request payload
          for the waiting workflow step.
        required: false
        content:
          application/json:
            schema:
              type: object
          text/plain:
            schema:
              type: string
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '201':
          description: Event notification sent or saved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotifyResponse'
        '400':
          description: Bad Request - Invalid workflow run ID or event ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 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:
    NotifyResponse:
      type: object
      properties:
        waiter:
          $ref: '#/components/schemas/Waiter'
          description: The waiter that was notified.
        messageId:
          type: string
          description: The ID of the notification message that was published.
        deduplicated:
          type: boolean
          description: Whether this notification was deduplicated.
        error:
          type: string
          description: Error message if the notification failed.
        workflowRunId:
          type: string
          description: The workflow run ID if the notification was sent within a workflow.
        workflowCreatedAt:
          type: integer
          format: int64
          description: >-
            The timestamp when the workflow run was created (Unix timestamp in
            milliseconds).
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
    Waiter:
      type: object
      properties:
        url:
          type: string
          description: The URL that is waiting for the event notification.
        headers:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: The HTTP headers to send with the notification.
        deadline:
          type: integer
          format: int64
          description: The Unix timestamp in seconds when the wait operation times out.
        timeoutBody:
          type: string
          format: byte
          description: The body to send if the wait times out.
        timeoutUrl:
          type: string
          description: The URL to call if the wait times out.
        timeoutHeaders:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: The HTTP headers to send with the timeout callback.
  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

````