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
The block returned by
defineWorkflowBlock in block.ts.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
- Executing a step: step execute handler
- Outcome schema: typing the data field in return values
- File structure: complete folder layout for trigger and step blocks