API Reference Durable v#2.0.2
View SourceModules
A durable, resumable workflow engine for Elixir.
Operational events worth an operator's attention, kept for a week in
durable.activity — the record behind "what happened to my queues?".
Configuration management for Durable.
Context management for workflow execution.
Provides macros for defining workflow steps using a pure pipeline model.
Helper functions for expressing time durations in workflow definitions.
Provides the workflow macro for defining durable workflows.
Structs representing workflow and step definitions.
Represents a compensation handler for a step.
Represents a single step in a workflow.
Represents a complete workflow definition.
The main workflow executor.
Backoff strategies for step retry logic.
Executes compensation handlers for saga pattern rollbacks.
Executes individual workflow steps with retry logic and log capture.
Helper functions for working with workflow data in the pipeline model.
Captures Logger output and IO operations during workflow step execution.
Logger handler for capturing workflow step logs.
GenServer that acts as a group_leader to capture IO operations.
Migrations for Durable workflow engine.
Base module for Durable internal migrations.
Keeps this instance's row in durable.nodes fresh, so operators can see
which nodes are alive and which queues each runs.
Reports each step attempt as an OpenTelemetry span.
Gives a step attempt's span the ids Durable has already stored.
Workflow composition: call child workflows from parent steps.
Deletes finished runs older than the :prune config, once an hour. Steps,
pending inputs, events and wait groups go with their run (foreign keys
cascade); child runs keep living and are pruned on their own age.
Thin wrapper around Phoenix.PubSub for broadcasting Durable lifecycle events.
Query functions for workflow executions.
The contract every read function of Durable keeps, and the one place that checks it.
Behaviour for queue adapters.
PostgreSQL-based queue adapter using the workflow_executions table.
Supervises queue pollers and worker supervisors.
GenServer that polls a queue for jobs and starts workers to execute them.
Once a minute, records every queue's depth — ready, scheduled, running,
waiting — in durable.queue_samples, so backlog can be charted over time
(Durable.Stats.queue_history/1).
Periodically recovers jobs with stale locks.
Executes a single workflow job in an isolated process.
Wrapper for Ecto repo calls with centralized options.
GenServer that polls for due scheduled workflows and triggers them.
CRUD operations for scheduled workflows.
Provides the @schedule decorator for declaring workflow schedules.
Aggregate health of a Durable instance, read straight from its tables — the numbers behind the dashboard's Overview and Workflow pages, available to your own alerts and dashboards too.
An operational event, recorded by Durable.Activity.
One row per running Durable instance, refreshed by Durable.NodeRegistry.
The id is the instance's node id, which pollers also stamp into
workflow_executions.locked_by.
Ecto schema for pending event records.
Ecto schema for pending input records.
Cluster-wide queue state. A row exists only once a queue has been paused or
resumed; a queue with no row is active. Every node's claim query checks
paused_at, so pausing here stops the queue on all nodes at once.
A queue's depth at one minute, written by Durable.Queue.Sampler.
Ecto schema for scheduled workflow records.
Ecto schema for step execution records.
Ecto schema for wait group records.
Ecto schema for workflow execution records.
The main supervisor for a Durable instance.
The :telemetry events Durable emits. This list is a contract: names,
measurements and metadata keys only change in a major version.
Helpers for testing workflows.
Wait primitives for durable workflows.
Background worker that revives workflows whose sleep/1 or
schedule_at/1 wait has elapsed.
Background worker that enforces timeouts for pending inputs and events, and
wakes waiting runs that passed their workflow timeout: so they fail now
rather than when their wait ends. A run past its timeout: on a queue no
live node polls is handed to a queue that is polled, since no worker will
ever claim it where it is. The worker that claims it there fails it.
Mix Tasks
Health check for a Durable instance. Surfaces the classes of stuck state that recovery doesn't always fix on its own
Generates a new Durable internal migration.
Deep-dive on a single workflow execution. Use this as the first stop when a workflow is stuck or behaving unexpectedly — it prints the header, step timeline (including wait/resume pairs), pending inputs and events, parent/children, and any error.
Installs Durable into your project
Lists outstanding pending inputs and pending events across all workflows. Use this to answer "what is waiting on me?" without clicking through the dashboard.
Unblocks a workflow that is waiting on wait_for_input/2 (or any of
its convenience wrappers like wait_for_approval, wait_for_choice,
wait_for_text, wait_for_form).
Starts a NEW workflow execution with the same module, queue, and input as an existing one. This matches what the dashboard's "Retry" button does — it does not resume the original execution in place.
Delivers an event to a workflow that is suspended on
wait_for_event/2, wait_for_any/2, or wait_for_all/2.
Cancels a running, pending, or waiting workflow execution.
Deletes old workflow executions from the database.
Generates an Ecto migration that upgrades Durable's internal database schema.
Lists workflow executions with optional filters.
Displays Durable's internal migration status for an Ecto repo.
Starts a workflow execution.
Shows Durable queue status and workflow summary.