---
title: "Wait for a message from inside a workflow"
method: POST
path: "/durable-messages/waits"
tags: ["Durable Functions"]
---

# Wait for a message from inside a workflow

`POST /durable-messages/waits`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/durable-messages/waits`
- Auth: none required

Registers a wait for a named message. The Volcano SDK calls this from
`ctx.waitForMessage`; applications do not call it directly.

`execution_ref` and `callback_id` are opaque values the SDK reads from
the running workflow. Together they are the request's credential, so
the operation takes no other authentication. When a message for the
name is already queued, the wait takes the oldest one at once.

Retrying is safe: a request for a wait that is already registered
returns it with `200`.

## Request body

- RegisterDurableMessageWaitRequest
  - `execution_ref` string, required: Opaque reference to the running execution, supplied by the SDK.
  - `callback_id` string, required: Opaque wait reference, supplied by the SDK.
  - `name` string, required: The name a workflow waits on or publishes under: up to 237 printable ASCII characters.

## Response `200`

The wait was already registered

- DurableMessageWaitRegistration: The registered wait, as the waiting workflow sees it.
  - `id` string, uuid, required
  - `status` 'waiting' | 'matched' | 'delivered' | 'expired' | 'cancelled', required: `waiting` until a message for its name arrives, `matched` while that message is handed over, then `delivered`. `expired` means the wait's timeout passed first, and `cancelled` that the execution stopped waiting.
  - `expires_at` string, date-time, nullable, required

## Other responses

- `201`: Wait registered
- `400`: The request body is invalid
- `404`: No running durable execution matches `execution_ref`
- `409`: The wait cannot be registered now. `code` says why: - `callback_not_ready`: the workflow has not finished opening the wait yet. Retry with a short backoff; the SDK does. - `callback_closed`: the workflow is no longer waiting on it. - `callback_taken`: the callback is already registered as an approval or a messages session. - `execution_ended`: the execution has finished. - `too_many_message_waits`: the execution already has the maximum number of open waits.
- `413`: The request body is larger than 8 KiB
- `429`: Too many requests from this execution
- `503`: The wait could not be confirmed with the workflow right now. Retry with backoff.

## Changes

- **2026-10-16** `7fec2090c1f4`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/durable-messages/waits/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
