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

"trigger" | "step"
required
Whether this block starts a workflow run ("trigger") or runs inline as part of one ("step").
string
required
Stable identifier for this block within your app. Used as the folder name under src/app/blocks/, to wire up handlers, and to reference the block from workflow definitions. Must be unique across all blocks in the app.
string
required
Human-readable label shown in the workflow editor’s block picker.
string
required
Short description shown alongside the title in the block picker.
WorkflowBlockConfigFriendlyStruct
required
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.
boolean
default:"false"
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.
true | {replacedBy: string}
Mark the block as deprecated. Pass {replacedBy: "other-block-id"} to point users at a successor block.

Example

block.ts

See also