Workflows.defineWorkflowBlock in block.ts to declare a block’s stable identity, human-readable copy, and the configuration schema exposed to workspace members in the workflow editor. The export from block.ts is shared between client and server; it must not import client- or server-only code.
Parameters
Whether this block starts a workflow run (
"trigger") or runs inline as part of one ("step").Stable identifier for this block within your app. Used as the folder name under
src/blocks/,
to wire up handlers, and to reference the block from workflow definitions. Must be unique across
all blocks in the app.Human-readable label shown in the workflow editor’s block picker.
Short description shown alongside the title in the block picker.
The configurable fields that
configurator.tsx must render inputs for. Build this with
Workflows.ConfigSchema, for example Workflows.ConfigSchema.struct({...}). The configSchema is
also the source of truth for the typed config argument your handlers receive. See
Config schema for all available node types.Whether this block expects a workspace user to have a connection configured. Set to
true for
blocks that call third-party APIs on behalf of the user.Mark the block as deprecated. Pass
{replacedBy: "other-block-id"} to point users at a
successor block.Example
block.ts
See also
- File structure: complete folder layout for trigger and step blocks
- Config schema: all available schema field types
- Executing a step: step execute handler
- Registering a trigger: trigger activate handler