Channel Steps Interface

All channels follow the same shared interface:

stepId
string
required

This is the unique identifier for the step in the workflow context. It is used to reference and display the step in the dashboard interface.

resolver
Promise
required

This is an async function that returns the content of the step which called Outputs. Each channel has its own output schema.

options
StepOptions

Additional step configuration.

Options Object

This is an optional configuration object that defines: Controls Schema, Provider Overrides, skip and other configurations.

skip
(controls: InferProperties<controlSchema>) => boolean | Promise<boolean>

A function that returns a boolean value to skip the step. This is helpful when you want to use previous step results or other custom logic to skip the step from executing.

controlSchema
JsonSchema | ZodSchema

This defined the UI Controls exposed in the dashboard for the step. They can be nested and of any JSON Schema supported structure.

providers
ProvidersOverride

This object used to access and override the underlying deliver providers SDKs. This is useful when you want to customize the content of the notification with properties that are unique to the provider.

disableOutputSanitization
boolean
default: "false"

A flag to disable output sanitization for the step. This is useful when you want to return unescaped HTML content to the provider or the <Inbox/> component.

Providers Overrides Object

This object used to access and override the underlying deliver providers SDKs. This is useful when you want to customize the content of the notification with properties that are unique to the provider.

An example of this is the slack provider, which allows you to customize the content of the notification with Slack blocks to create a rich notification experience.

type ProvidersOverride = {
  [key: ProviderEnum]: ProviderCallback;
};

type ProviderCallback = (
  params: ProviderOverridesParams
) => ProviderOverrideOutput | Promise<ProviderOverrideOutput>;

type ProviderOverridesParams = {
  controls: StepControls;
  output: StepOutput;
};

type ProviderOverrideOutput = {
  // A map of the properties used by the Provider.
  // These properties are strongly typed and validated
  // against the underlying provider SDK.
  [key in KnownProviderKey]: KnownProviderValue;
  // The passthrough object is used to pass through
  // the original request to the provider.
  // These properties are not validated.
  _passthrough?: {
    body: Record<string, unknown>;
    headers: Record<string, unknown>;
    query: Record<string, unknown>;
  };
};

The _passthrough object and the known provider values are deeply merged prior to sending the request to the provider, with the _passthrough object taking precedence.

Was this page helpful?