- An unclassified error has no
id. It follows the catch-all outcome, along with every other unclassified error. - A classified error has an
id, with a corresponding<ErrorOutcome />in the block configurator. The workflow author can then handle that error on its own outcome.
execute and finish.
Unclassified errors
Return an error with noid when you do not expect the workflow author to handle that error on its own outcome:
When the workflow author turns on continue on error, an unclassified error follows the catch-all outcome instead of failing the run.
Classified errors
When a specific error should have its own outcome, add an<ErrorOutcome /> in the configurator, then return that same id in the error payload from execute (or finish) handlers.
Surface the error outcome
ErrorOutcome comes from Workflows.useConfigurator, alongside Outcome. Render one for each error the workflow author should be able to handle:
configurator.tsx
Rendering the
<ErrorOutcome /> only lists the error in the workflow author’s error-handling
dropdown. It does not add an outcome until the workflow author chooses to handle that
error.label is required on ErrorOutcome. On Outcome it is optional when the block has a single success outcome.
Return the error
Fromexecute or finish, return the same id with an errorMessage and a data payload:
execute.ts
id must match an <ErrorOutcome /> in the configurator. data is that outcome’s payload and must match its schema. Pass null when the schema is null.
retryable is optional, as on an unclassified error. The workflow author decides whether this outcome is handled. When they handle it, the run continues down that error outcome, and downstream steps can use data.
See also
- Configurator: declaring outcomes in the workflow editor
- Executing a step: the
executehandler - Finishing a deferred step: the
finishhandler - Outcome schema: typing the
datafield