Skip to main content
defineWorkflowBlockFinish wires a finish handler to a step block. The handler runs when a request arrives at metadata.finishCallbackUrl, for example when a long-running upstream job posts back its result. This handler is only needed when execute returns {type: "defer"}.

Parameters

block
WorkflowBlock
required
The block returned by defineWorkflowBlock in block.ts.
finish
function
required
The handler function. Receives the raw req (a standard Request object) and a context object with config (typed from the block’s configSchema) and metadata.metadata provides run context and the execution ID for correlating the callback with the original deferred execution:

Example

finish.ts

See also