← All projects

go-workflows

Durable workflows for Go.

Active
GoSQLiteMySQLRedisOpenTelemetry

go-workflows is a Go library for writing durable, long-running workflows. It borrows concepts from Azure's Durable Task Framework (DTFx) and Temporal — workflows look like ordinary, sequential code, but the runtime persists every step so executions survive process crashes, deployments, and reschedules.

Why durable workflows

Modern services often have to orchestrate calls across many systems — long-running, with retries, timeouts, and human-in-the-loop steps. Doing that by hand with queues, state tables, and ad-hoc retry logic obscures the business logic and tends to break under failure. Durable workflow engines abstract that away: you write what looks like normal sequential code, and the engine handles persistence, recovery, and replay.

How it works

Workflows are recorded as an event-sourced history. When a workflow calls into the runtime — to schedule an activity, sleep, or wait for a signal — the engine pauses execution and writes an event. The activity runs (possibly on another machine), its result is appended to the history, and the workflow resumes by replaying events back to that point. Activities are plain Go code and may have side effects; workflows must be deterministic.

Architecture

The library is built around pluggable backends. A backend persists workflow events and is the coordination point between clients (which start workflows) and workers (which execute them). Both clients and workers can live in the same process for simple deployments, or be split across services.

Highlights

  • Sequential, readable workflow code Write workflows as ordinary Go functions; the runtime handles persistence and recovery.
  • Pluggable backends SQLite, MySQL, and Redis backends are supported. The in-memory backend is handy for tests.
  • Activities, signals, timers, sub-workflows All the primitives you expect from a durable execution engine.
  • Generic-friendly API Type-safe activity invocation using Go generics.
  • OpenTelemetry tracing Logical workflow execution shown as continuous spans across activities, sub-workflows, and retries.
  • Built-in diagnostics UI Inspect running and completed workflows, their event history, and pending tasks.

Related writing