Skip to main content

Workflow

Long-running multi-step processes that survive crashes, retry on failure, and resume from the last completed step. Backed by Temporal.

What you'll learn​

  • When to use Workflow vs. Scheduler vs. event consumers
  • The shape of a workflow definition
  • How to trigger one

When to use what​

NeedUse
Run something once in 5 minutesScheduler
Run something every Monday at 9amScheduler
React to an event from another serviceEvent consumer (SDK)
Orchestrate a 10-step deal-close that takes daysWorkflow
A step needs human approval and may pause for a weekWorkflow
Multiple steps each retry independentlyWorkflow

Workflow definition​

import { defineWorkflow, step } from '@burdenoff/platform-sdk/workflow';

export const onboardingWorkflow = defineWorkflow({
name: 'tenant-onboarding',
steps: [
step('createTenant', async (ctx, input) => { /*...*/ }),
step('provisionWorkspaces', async (ctx, { tenantId }) => { /*...*/ }),
step('inviteAdmins', async (ctx, { tenantId, admins }) => { /*...*/ }),
step('sendWelcomeEmail', async (ctx, { tenantId }) => { /*...*/ }),
],
});

Each step is independently retried. State is durable.

Triggering a workflow​

const handle = await client.workflow.start('tenant-onboarding', {
workflowId: `onboard-${tenantId}`,
args: [{ tenantName: 'Acme', admins: ['[email protected]'] }],
});

const result = await handle.result(); // resolves when the workflow completes

Inspecting workflows​

burdenoff workflow list --status running
burdenoff workflow describe <workflow-id>

In the web app: Developer Console → Workflows.

Next steps​