Skip to main content
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

block
WorkflowBlock
required
The block returned by defineWorkflowBlock in block.ts.
trigger
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 workflow identity context for the incoming event:

Example

trigger.ts

See also