defineWorkflowBlockTrigger wires an event handler to a trigger block. The handler runs once for each incoming request to metadata.triggerCallbackUrl, the URL registered with the upstream service during activation.
Here you decide whether the event should start a workflow run, and (if so) what outcome data to send into the workflow.
Parameters
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 workflow identity context for the incoming event:Example
trigger.ts
See also
- Registering a trigger: trigger activate handler
- Outcome schema: typing the data field in return values
- File structure: complete folder layout for trigger and step blocks