Workflow SDK vs AWS Step Functions

AWS Step Functions is a mature, managed orchestrator that runs state machines defined in Amazon States Language (ASL), a declarative JSON DSL. The authoring model is the main contrast with the Workflow SDK: you assemble a state machine (JSON or a visual editor) instead of writing plain control-flow code.

Choose the Workflow SDK when you want orchestration as ordinary TypeScript (await, if, Promise.all, try/catch) that lives in your app, portable off a single cloud, with built-in streaming. Choose Step Functions when you're deep in the AWS ecosystem and want a managed engine with native optimized integrations to 200+ AWS services and the broadest compliance footprint.

At a glance

Workflow SDKAWS Step Functions
AuthoringPlain TypeScript: "use workflow" orchestrators calling "use step" functionsDeclarative ASL JSON (or Workflow Studio visual editor / CDK), not plain code
Durability modelEvent log + deterministic replayManaged state machine. Standard = exactly-once, up to 1 year; Express = at-least-once, up to 5 minutes
Control flowawait, if/switch, Promise.all, try/catchTask / Choice / Wait / Parallel / Map states wired with Next
Where it runsYour platform (Vercel managed or self-host)AWS-managed; tasks run in Lambda or 200+ integrated AWS services
LanguagesTypeScript / JS (Python beta)ASL JSON for the machine; tasks can be any language (via Lambda)
Human-in-the-loopcreateHook() / createWebhook().waitForTaskToken callback (Standard only)
StreamingNative durable, resumable streaming to clientsNo native client streaming
VersioningRuns pinned to immutable deploymentPublished versions are immutable; aliases route (≤2 versions) for canary/rollback; in-flight executions keep their start-time definition
PortabilityApache-2.0; runs anywhere Node runsProprietary and AWS-only; ASL is AWS-specific, resulting in high lock-in
PricingSDK free; pay your platformStandard: $0.025 / 1K state transitions. Express: $1 / M requests + GB-second duration
Limits50 MB payload; 2 GB/run; no duration cap (Vercel World limits)256 KB payload between states; Standard 25K history events / 1 year; Express 5 minutes
AIWorkflowAgent in the AI SDK; durable streamingBedrock integration + a preview AgentCore "InvokeHarness" task; no native client streaming

What the limits mean in practice: The 256 KB cap on payloads between states is the binding constraint for AI workloads. Virtually any model context or tool transcript has to round-trip through S3 with claim-check plumbing, and Standard executions cap history at 25K events. The Vercel World limits are 50 MB per payload and 2 GB of state per run.

Code vs. JSON

In Step Functions, even "call one Lambda" requires a state-machine shell, and ASL states (Choice, Wait, Parallel, Map) express the orchestration logic. In the Workflow SDK, ordinary TypeScript handles orchestration: transitions are await, branches are if, parallelism is Promise.all, and error handling is try/catch. This keeps orchestration in the same language, repo, and tests as the rest of your app, and removes the orchestrator/compute split (per-task Lambdas, IAM roles, callback queues).

The tradeoff is that Step Functions' optimized service integrations call AWS services (DynamoDB, SQS, EventBridge, Bedrock, ecs:runTask.sync, and others) declaratively. In the Workflow SDK, these become ordinary SDK calls inside "use step" functions, and you own the credentials, retries, and any polling.

Migrating from Step Functions

This guide assumes Standard workflows. Express workflows have different semantics (at-least-once, 5-minute max, no execution history) and may be better kept on Step Functions or moved to a queue consumer.

AWS Step FunctionsWorkflow SDKNote
State machine (ASL JSON)"use workflow" functionThe workflow function is the state machine.
Task state / Lambda"use step" functionSide effects go in steps; no separate Lambda.
Choice stateif / else / switchNative control flow.
Wait statesleep()sleep('1m') or sleep(date).
Parallel statePromise.all()Standard concurrency.
Map statefor loop / bounded Promise.all (e.g. p-limit) / start() per item for large fan-outMatch the original concurrency mode.
Retry / Catch (MaxAttempts, BackoffRate, IntervalSeconds)maxRetries, RetryableError, FatalError; try/catch for compensationRetry logic moves to step boundaries; backoff curves use retryAfter. See Errors & Retrying.
.waitForTaskTokencreateHook() / createWebhook()Hooks for typed signals; webhooks for HTTP.
Child state machine (StartExecution)Call start() directly from the workflowChild runs are tagged with $parentRunId / $rootRunId automatically.

A single Task state and its Lambda collapse into two directive-tagged functions:

workflows/order.ts
export async function processOrder(orderId: string) {
  'use workflow';
  const order = await loadOrder(orderId);
  if (order.total > 1000) await reviewManually(order); // Choice → if
  await chargePayment(order);
}

async function loadOrder(id: string) {
  'use step';
  return fetch(`https://example.com/api/orders/${id}`).then((r) => r.json());
}

A .waitForTaskToken callback becomes a hook without an SQS queue, task token, or callback Lambda:

workflows/refund.ts
import { createHook } from 'workflow';

export async function refundWorkflow(refundId: string) {
  'use workflow';
  using approval = createHook<{ approved: boolean }>({
    token: `refund:${refundId}:approval`,
  });
  return await approval; // resumed via resumeHook(), not SendTaskSuccess
}

Install the migration skill to translate a state machine automatically:

npx skills add https://github.com/vercel/workflow --skill migrating-to-workflow-sdk

Step Functions features without a direct Workflow SDK equivalent

Each row is a Step Functions capability the Workflow SDK does not replicate one-to-one, paired with how to cover it on the Workflow SDK side:

Step Functions featureHow to cover it with the Workflow SDK
Express workflowsAt-least-once and 5-minute duration fit the durable-replay model poorly; keep them on Step Functions or move to a queue consumer
Distributed Map (up to 10,000 concurrent children, S3 item sources)Fan out with start() per item directly from the workflow, then bound concurrency with p-limit
Optimized AWS service integrationsBecome ordinary SDK calls inside steps; .sync waits become explicit polling or hooks
Per-state IAM rolesSteps share the deployment's credentials; scope secrets at deploy time

Compiled from public documentation. Step Functions pricing/limits are region-specific (figures are us-east-1); verify against the AWS pricing page. Not based on head-to-head benchmarks.