Run durable workflows
Build workflows with the Workflow SDK that survive restarts, retry steps, sleep for days and wait on hooks, with every run traced in the dashboard.
Workflows lets your functions run long, multi-step work that survives failures: a step that fails is retried, a run can sleep for minutes or days, and it can pause until something outside calls back. Use it for signups, order pipelines, AI agents, or anything that outlasts one request.
Easel implements the same backend as Vercel Workflows, so an app built with the Workflow SDK runs unchanged. There's nothing to set up: no database to bring, and your functions are authenticated automatically. Workflows is in beta.
Write a workflow
Install the SDK and add it to your framework's config (here, Next.js):
A workflow is a function marked "use workflow"; each step it calls is a
function marked "use step":
Start a run from any function:
How runs work
- Steps retry. A step that throws is retried, 3 times by default (set
maxRetrieson the step to change it). ThrowFatalErrorto fail without retrying. - Sleeps cost nothing.
sleep()suspends the run; no function runs while it waits. - Hooks wait for the outside.
createHook()pauses untilresumeHook(token, payload)is called, from a webhook handler for example. A hook's token is unique in your project and environment while it's live.experimental_minRetentionkeeps it claimed after the run ends, andexperimental_forcetakes a token over from the run that holds it. - Streams. A step can write to
getWritable(), andgetRun(runId).getReadable()reads it live from anywhere. - Pinned to the deployment. A run keeps running the code of the deployment that started it, even after you deploy again.
Steps and resumes are delivered by Queues, so a workflow's functions show up in your invocations like any other.
See your runs
Open Workflows in your project's sidebar. Runs are listed newest first, with counts by status; search by workflow, run ID or hook token, filter by environment and time range, or turn on Live to watch new runs arrive.
Open a run to see its trace: each step, each retry attempt, each sleep and hook on one timeline. Select a span for its details, input, output and events. From a run you can:
- Wake Up Sleep on a sleeping run, to continue it now.
- Resolve Hook on a waiting hook, with a JSON payload, as
resumeHook()would. - Re-run it with the same input, Re-enqueue it if it's stuck, or Cancel it. You can also cancel several from the list.
- See its Events and its output Streams, live while it runs.
- Jump to its function logs with View Logs.
Encryption
Run data (inputs, outputs, errors, hook payloads and streams) is encrypted before it leaves your function, with a key unique to each run, as on Vercel. Your code doesn't change, and Easel only stores the encrypted bytes. In the dashboard, payloads show as Encrypted until you choose Decrypt on a run.
Retention and limits
A run's inputs, outputs, streams and trace are kept while it runs and then for your plan's retention period: 1 day on Hobby, 7 days on Pro. The run stays listed for 30 days after that, without its data. A run can have up to 25,000 events and 10,000 steps, and each payload can be up to 50 MB.
Pricing
Workflows bill three ways, at Vercel's rates: Workflow Events (each state change of a run or step), Workflow Data Written, and on Pro, Workflow Data Retained. Each plan includes 50,000 events and 1 GB written a month. See Pricing for the rates. The functions that run your steps bill like any other function.