Workflows
Define durable workflows with Stepflow
Workflows
A workflow is a sequence of steps that execute in order, with automatic checkpointing and retry logic.
Creating a Workflow
Use createWorkflow to define a workflow:
import { createWorkflow } from "@stepflowjs/core";
const myWorkflow = createWorkflow(
{
id: "my-workflow",
retries: 3,
retryDelay: 1000,
timeout: "30m",
},
async (ctx) => {
// Workflow logic here
}
);Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
id | string | required | Unique workflow identifier |
retries | number | 0 | Number of retry attempts |
retryDelay | number | 1000 | Delay between retries (ms) |
timeout | Duration | undefined | Maximum execution time |