defineWorkflowBlockExecute wires an execute handler to a step block. The handler runs each time a workflow run reaches this step.
Parameters
The block returned by
defineWorkflowBlock in block.ts.The handler function. Receives a context object with
config (typed from the block’s configSchema) and metadata.metadata provides context about the current run and workflow:| Field | Type | Description |
|---|---|---|
workflowId | string | ID of the workflow this block belongs to. |
workflowVersionId | string | ID of the active workflow version. |
workflowBlockId | string | ID of this block instance within the workflow. |
workflowRunId | string | ID of the current workflow run. |
uniqueExecutionId | string | Unique ID for this specific execution of the block. Use for idempotency. |
workflowTitle | string | Human-readable title of the workflow. |
workflowUrl | string | Link to the workflow in the Attio UI. |
runUrl | string | Link to the current run in the Attio UI. |
finishCallbackUrl | string | URL to POST to when finishing a deferred execution. Only relevant when the handler returns {type: "defer"}. See Finishing a deferred step. |
Example
execute.ts
See also
- Finishing a deferred step: deferred step handler
- Outcome schema: typing the data field in return values
- File structure: complete folder layout for trigger and step blocks