Developer platform

Multi-step jobs that never lose their place.

Sign-up flows, order fulfilment, billing runs and AI pipelines as plain JavaScript. Each step’s result is saved, steps retry with backoff, and a workflow can sleep for days or wait for a payment or an approval. Nothing runs, and nothing is billed, while it waits.

// lyrcloud.json: "workflows": { "ORDERS": "orders" }, "email": "EMAIL"
export default {
  async fetch(request, env) {
    const run = await env.ORDERS.create({ params: await request.json() });
    return Response.json({ id: run.id });
  },
  workflows: {
    async orders(event, step, env) {
      const order = await step.do('charge card', { retries: { limit: 5, delay: '30 seconds' } },
        () => chargeCard(event.payload));
      await step.sleep('let the warehouse pack it', '2 hours');
      const shipped = await step.waitForEvent('shipped', { type: 'shipped', timeout: '7 days' });
      await step.do('email the customer', () => env.EMAIL.send({
        from: 'Shop <orders@example.com>', to: order.email,
        subject: 'On its way!', text: `Tracking: ${shipped.payload.tracking}`,
      }));
      return { tracking: shipped.payload.tracking };
    },
  },
};

// $ lyrcloud workflows event orders <id> shipped --payload '{"tracking":"1Z…"}'
β€³ Workflows

What you get

Steps that remember

Wrap work in step.do(). After a sleep, a retry or a crash, finished steps return their saved results and the workflow carries on.

Retries with backoff

Set a limit, a delay and constant, linear or exponential backoff per step. After the last try, the error reaches your code to handle.

Sleep for days

step.sleep('3 days') or step.sleepUntil(date), for reminders, trials and follow-ups.

Wait for events

step.waitForEvent() pauses until a webhook, payment or human approval arrives, with a timeout.

Every step visible

Inputs, results, errors and attempts for every instance in the dashboard and lyrcloud workflows status.

Included in every plan

Launch: 10 workflows, 20,000 steps a month. Scale: 100 and 2M. Enterprise: 1,000 and 20M. Past that, $2 per 100,000 steps from Lyrcloud credit.

Works with the rest of Lyrcloud

🌐

Domains

Register or transfer a domain with free WHOIS privacy and Lyrcloud DNS, paid by card or with Lyrpay.

Learn more
⚑

Global CDN

Response caching, static files and whole static sites for your edge functions, with cache headers you control and purges from the CLI.

Learn more
πŸ”’

Application Security

Rate limits, IP rules, a firewall for common attacks, bot checks and secure headers for your edge functions, set in lyrcloud.json and enforced before your code runs.

Learn more

Try Workflows free.

Create a free account in under a minute. No credit card required.