API Reference Durable v#0.1.0-rc

View Source

Modules

A durable, resumable workflow engine for Elixir.

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.

Workflow composition: call child workflows from parent steps.

Thin wrapper around Phoenix.PubSub for broadcasting Durable lifecycle events.

Query functions for workflow executions.

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.

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.

Ecto schema for pending event records.

Ecto schema for pending input records.

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.

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.

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.