Durable Functions

Get a callback token from inside a workflow

Changed on

Registers a waiting step and returns its callback token. The Volcano SDK calls this from ctx.waitForCallback; 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. The token works until the step's own timeout, and only for that step.

Retrying is safe: a request for a step that is already registered returns the same token with 200 while the step still waits. Once the token is answered, or the step times out or ends, a retry answers 409 with callback_closed.

post/durable-callbacks

Request

  • Base URL
    https://api.volcano.dev
  • Auth
    none required

Request body

RegisterDurableCallbackRequest required
execution_ref, string required

Opaque reference to the running execution, supplied by the SDK.

callback_id, string required

Opaque reference to the waiting step, supplied by the SDK.

name, string required

The waiting step's name, up to 237 printable ASCII characters.

operation_id, string

The operation an earlier run of the workflow opened the waiting step under, supplied by the SDK when a replay registers it. Volcano then looks for the step further back in the execution's history than a first registration reads.

Response

The step was already registered; its token is returned

DurableCallbackRegistration required

The token for the waiting step, as the workflow receives it.

token, string required

The vcb_ token the workflow handed out. It is the only credential the callback operations take, so treat it as a secret.

expires_at, string date-time nullable required

When the waiting step's timeout passes and the token stops working. Null when the workflow set no timeout. A step with a heartbeat timeout also ends once that long passes without a heartbeat, which can be before this time.

Changes