Introducing durable workflows

Background jobs start simple and end up as a pile of queues, cron entries, and retry tables. Durable workflows replace that pile with plain code: you write the steps in order, and the platform makes sure each one runs to completion, even when a deploy or a crash interrupts it.

Durable workflows are generally available today on every plan.

How a workflow runs

A workflow is a function made of named steps. When a step finishes, its result is saved as a checkpoint. If the process stops, the next run skips every finished step and continues from the last checkpoint, with the same inputs.

workflows/send-invoices.ts
import { workflow, step } from "@cloud/workflows";

export default workflow("send-invoices", async () => {
  const accounts = await step("load", () => loadAccounts());
  const invoices = await step("render", () => renderInvoices(accounts));
  await step("send", { retries: 5, timeout: "2m" }, () => sendAll(invoices));
});

Steps should be safe to retry. A good rule is to make each step write its result in one place, with an idempotency key, so a retry never sends the same invoice twice.

Start one from your app

Workflows start from an API call, a schedule, or another workflow. The call returns a run id right away, so your request handler never waits on the work itself.

app/billing.ts
import { workflows } from "@cloud/sdk";

const run = await workflows.start("send-invoices", { month: "2026-10" });
console.log(run.id); // wf_run_8f2c...

Debug a failed run

Every run has a timeline in the dashboard with the input, output, duration, and logs of each step. When a step fails after its last retry, the run pauses instead of disappearing. Fix the bug, deploy, and replay the run from the failed step.

bash
cloud workflows replay wf_run_8f2c --from send

Limits and pricing

Workflows are billed as regular compute. Checkpoints and replays are included. A single run can last up to 30 days, and a step can return up to 1 MB of data. See the changelog for the full list of limits.

Share:

Written by

Maya Chen

Product lead, Workflows

Maya leads the workflows team and writes about background jobs, retries, and the product decisions behind each release.

Newsletter

Engineering notes, once a month

Release highlights, deep dives from the platform team, and guides you can use the same day. No spam.

gats-fo-lex

Unsubscribe anytime. Read our Privacy Policy.

Free tier · No credit card

Push code today. Be live before your coffee cools.

Connect a repository, pick a region, and get a production URL with HTTPS, logs, and autoscaling already switched on.

$ git push origin main

  1. Build34 s
  2. Deploy12 s
  3. Health checks3 s

your-app.example.com

Buy NowTheme Details