defineWorkflowBlockDeactivate wires a deactivate handler to a trigger block. The handler runs once when the workflow is disabled or replaced by a new version.
Mirror what activate.ts set up: typically, tear down the webhook registration with the upstream service.
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 mirrors what was passed to activate, including the uniqueActivationId needed to identify the registration to tear down:| Field | Type | Description |
|---|---|---|
workflowId | string | ID of the workflow this block belongs to. |
workflowVersionId | string | ID of the workflow version being deactivated. |
workflowBlockId | string | ID of this block instance within the workflow. |
uniqueActivationId | string | The same ID that was passed to activate. Use it to look up and tear down the webhook registration you stored during activation. |
workflowTitle | string | Human-readable title of the workflow. |
workflowUrl | string | Link to the workflow in the Attio UI. |
Example
deactivate.ts
See also
- Registering a trigger: trigger activate handler
- Receiving a trigger event: trigger event handler
- File structure: complete folder layout for trigger and step blocks