src/app/blocks/{block-id}/, where block-id is the id you pass to defineWorkflowBlock (see block definition). The filenames are fixed. The SDK and CLI resolve handlers by name, so the files must match exactly. Which files are required depends on the block’s type, which you set in block.ts.
Apps created before the folder-based layout have their blocks at
src/blocks/. That location is
still discovered while you migrate, but block ids must be unique across both locations; a
duplicate id is a build error. Use attio migrate folder-structure to move everything under src/app/.Trigger block
A trigger block subscribes to external events and fires a workflow run for each one. It has a three-file lifecycle:activate runs when the workflow is enabled (set up the subscription), trigger runs for each incoming event, and deactivate runs when the workflow is disabled (tear down the subscription).
Step block
A step block runs inline each time a workflow reaches it. The only required handler isexecute. Add finish.ts only when execute returns {type: "defer"} and the step needs to wait for an external signal before continuing.
Handler files are server-only and must use the
.ts extension. The CLI rejects .tsx variants
like execute.tsx or activate.tsx.