Documentation Index
Fetch the complete documentation index at: https://mintlify.com/eersnington/sideffect/llms.txt
Use this file to discover all available pages before exploring further.
Step is used to create reusable typed workflow activities. Each step has a name, an input schema, an output schema, and a run function that performs the work. Sideffect validates both the payload and the result against their schemas automatically, so your run function always receives the correct shape and always returns the correct shape. Import Step directly from sideffect.
Step.make(name, options)
Creates a reusable StepDefinition. The returned definition can be passed to step.do(...) in any workflow, decorated with Rollback.with(...) via .pipe(), or composed with other helpers.
Human-readable name for the step. This string appears in the Cloudflare
Workflows dashboard timeline and in any schema decode error messages.
Examples:
"fetch image", "send email", "add numbers".Effect Schema for the
step’s input. Sideffect decodes the raw payload value with this schema before
calling
run. If decoding fails, a NonRetryableError is thrown and the
workflow is not retried.Effect Schema for the step’s output. Sideffect decodes the value returned by
run with this schema before returning it to the workflow. If decoding fails,
a NonRetryableError is thrown.The step implementation. Receives the decoded
payload and a StepContext
(see below). May return a direct value, a Promise, or an Effect.Effect.StepContext<Env> extends Cloudflare’s native WorkflowStepContext and adds:ctx.env— Worker environment bindings, typed from your project’sCloudflare.Env.ctx.ctx— Worker execution context.ctx.workflowStep— rawNativeWorkflowStepAPI for advanced use cases.
ctx.attempt— current retry attempt number (1-based).ctx.step.name— the step name.ctx.config— the step config (timeout, retries) if configured.
StepDefinition<Payload, Result, Env> with a .pipe() method for applying transformations such as Rollback.with(...).
StepOptions
Passed as the third argument to step.do(stepDefinition, payload, options?) inside a workflow run function. All fields are optional and delegate directly to Cloudflare’s WorkflowStepConfig.
Cloudflare retry configuration for the step. The shape is defined by
Cloudflare’s
WorkflowStepConfig type from cloudflare:workers.Maximum execution time for the step. A Cloudflare duration string (e.g.
"5 minutes") or a number of milliseconds.When
true, Cloudflare treats step logs and output as sensitive and redacts
them from the Workflows dashboard.StepOptions are only applied when you pass them at call-time via
step.do(myStep, payload, options). They are not stored on the
StepDefinition itself, so you can reuse the same step definition with
different options in different parts of a workflow.