Skip to main content
You define workflows in your own code and run them in a worker you host. The worker connects to your project and runs each step; your project keeps every run’s state, so a run survives a worker restart. You need a project with Workflows on, a worker key (dtn_wk_) for the worker and a secret key (dtn_sk_) to send events.

1. Install the SDK

2. Define a workflow

A workflow is a handler made of named steps. A step that finished is never run again: after a restart the run carries on from the next one.
Two more steps cover a stage you leave out and a resource you wait on:

3. Connect a worker

ready settles once your project has the worker’s workflows. close() stops taking new steps and lets the ones in flight finish. See Workers for builds, reconnects and concurrency.

4. Send an event

Every workflow the event triggers starts a run. Follow it with client.runs.list({ workflow: "welcome-email" }) or live, as the reference shows.

Next

  • Events: names, platform events and delivery.
  • Schedules: start a workflow on a cron expression.
  • Wait tokens: pause a run until someone answers.
  • Limits: what a project may run at once.
  • MCP tools: manage workflows from an AI assistant.