StepflowStepflow

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

OptionTypeDefaultDescription
idstringrequiredUnique workflow identifier
retriesnumber0Number of retry attempts
retryDelaynumber1000Delay between retries (ms)
timeoutDurationundefinedMaximum execution time

On this page