# PgFlow v0.4.0 - Table of Contents > Workflows, background jobs and cron in Elixir and Postgres powered by PGMQ. ## Pages - [PgFlow](readme.md) - [PgFlow Architecture](architecture.md) - [Comparison with Alternatives](comparison.md) - [PgFlow Dashboard](dashboard.md) - [PgFlow: Elixir vs Supabase (TypeScript/Deno)](elixir_vs_supabase.md) - [LiveView Integration](live_client.md) ## Modules - [PgFlow](PgFlow.md): PgFlow is an Elixir implementation of the pgflow workflow engine. - [PgFlow.Client](PgFlow.Client.md): Client API for interacting with PgFlow runs. - [PgFlow.Config](PgFlow.Config.md): Configuration validation and management for PgFlow. - [PgFlow.Context](PgFlow.Context.md): Context struct passed to step handler functions. - [PgFlow.CronSummary](PgFlow.CronSummary.md): Typed operational statistics and schedule data for a PgFlow cron definition. - [PgFlow.DSL.Validation](PgFlow.DSL.Validation.md): Compile-time validation helpers for PgFlow DSL macros. - [PgFlow.DefinitionSummary](PgFlow.DefinitionSummary.md): Typed operational statistics for a stored PgFlow definition. - [PgFlow.Definitions](PgFlow.Definitions.md): Typed operational reads for persisted PgFlow definitions and schedules. - [PgFlow.Flow](PgFlow.Flow.md): A macro-based DSL for defining pgflow workflows. - [PgFlow.Flow.Definition](PgFlow.Flow.Definition.md): Represents a compiled flow definition. - [PgFlow.Flow.Shape](PgFlow.Flow.Shape.md): Serializes compiled flow definitions into the upstream camelCase JSON shape consumed by `pgflow.ensure_flow_compiled/2`, `_create_flow_from_shape/2`, and `_compare_flow_shapes/2`. - [PgFlow.Flow.Step](PgFlow.Flow.Step.md): Represents a single step in a flow definition. - [PgFlow.FlowCompiler](PgFlow.FlowCompiler.md): Compiles flow definitions into SQL statements. - [PgFlow.FlowRegistry](PgFlow.FlowRegistry.md): Registry for flow definitions using an ETS table. - [PgFlow.FlowStarter](PgFlow.FlowStarter.md): Supervised GenServer that registers flow and job modules with exponential backoff and jitter. - [PgFlow.FlowStarter.ModuleState](PgFlow.FlowStarter.ModuleState.md): Registration snapshot for one flow/job module, as returned by `PgFlow.FlowStarter.module_status/1` and embedded in `status/0` results. - [PgFlow.HelpersMigration](PgFlow.HelpersMigration.md): Manages database migrations for PgFlow's extension SQL functions. - [PgFlow.Job](PgFlow.Job.md): A macro-based DSL for defining pgflow background jobs. - [PgFlow.JobCompiler](PgFlow.JobCompiler.md): Compiles job definitions into SQL statements. - [PgFlow.LiveClient](PgFlow.LiveClient.md): LiveView-native client for tracking flow and job runs in real-time. - [PgFlow.Logger](PgFlow.Logger.md): Structured logging for PgFlow, aligned with the TypeScript reference implementation. - [PgFlow.Metrics](PgFlow.Metrics.md): Typed operational overview metrics for PgFlow. - [PgFlow.Migration](PgFlow.Migration.md): Installs the pgflow core schema (tables, triggers, functions) into a consumer app's database via EctoEvolver. - [PgFlow.Migrations.Core.V01](PgFlow.Migrations.Core.V01.md): Version 1 of the core pgflow schema. - [PgFlow.Migrations.Core.V02](PgFlow.Migrations.Core.V02.md): Upstream core delta through 94490709; see the bundled manifest. - [PgFlow.Migrations.Versions.V01](PgFlow.Migrations.Versions.V01.md): PgFlow extensions migration version 1. - [PgFlow.Migrations.Versions.V02](PgFlow.Migrations.Versions.V02.md): PgFlow extensions migration version 2. - [PgFlow.Migrations.Versions.V03](PgFlow.Migrations.Versions.V03.md): PgFlow extensions migration version 3. - [PgFlow.Migrations.Versions.V04](PgFlow.Migrations.Versions.V04.md): PgFlow extensions migration version 4. - [PgFlow.Migrations.Versions.V05](PgFlow.Migrations.Versions.V05.md): PgFlow extensions migration version 5. - [PgFlow.OverviewMetrics](PgFlow.OverviewMetrics.md): Typed real-time metrics for PgFlow's operational overview. - [PgFlow.Queries.Flows](PgFlow.Queries.Flows.md): SQL query interface for pgflow flow operations. - [PgFlow.Queries.Helpers](PgFlow.Queries.Helpers.md): Shared utilities for database queries. - [PgFlow.Queries.Pgmq](PgFlow.Queries.Pgmq.md): SQL query interface for pgmq-specific operations. - [PgFlow.Queries.Workers](PgFlow.Queries.Workers.md): SQL query interface for pgflow worker operations. - [PgFlow.RunHistoryCell](PgFlow.RunHistoryCell.md): Typed result for one step in a run history projection. - [PgFlow.RunSummary](PgFlow.RunSummary.md): Typed operational summary for a PgFlow run. - [PgFlow.Runs](PgFlow.Runs.md): Typed operational reads for PgFlow runs, states, and tasks. - [PgFlow.Schema.Dep](PgFlow.Schema.Dep.md): Schema for the pgflow.deps table. - [PgFlow.Schema.Flow](PgFlow.Schema.Flow.md): Schema for the pgflow.flows table. - [PgFlow.Schema.Run](PgFlow.Schema.Run.md): Schema for the pgflow.runs table. - [PgFlow.Schema.Step](PgFlow.Schema.Step.md): Schema for the pgflow.steps table. - [PgFlow.Schema.StepState](PgFlow.Schema.StepState.md): Schema for the pgflow.step_states table. - [PgFlow.Schema.StepTask](PgFlow.Schema.StepTask.md): Schema for the pgflow.step_tasks table. - [PgFlow.Schema.Worker](PgFlow.Schema.Worker.md): Schema for the pgflow.workers table. - [PgFlow.SchemaCheck](PgFlow.SchemaCheck.md): Verifies that a database matches the pgflow schema contract expected by this library release. - [PgFlow.Signal.Notify](PgFlow.Signal.Notify.md): Manages PostgreSQL LISTEN/NOTIFY for pgmq queue notifications. - [PgFlow.Sql.Splitter](PgFlow.Sql.Splitter.md): Splits a raw PostgreSQL script into individual top-level statements. - [PgFlow.Supervisor](PgFlow.Supervisor.md): Main supervisor for PgFlow components. - [PgFlow.Telemetry](PgFlow.Telemetry.md): Telemetry events emitted by PgFlow. - [PgFlow.Telemetry.PubSub](PgFlow.Telemetry.PubSub.md): Bridges PgFlow telemetry events to Phoenix.PubSub. - [PgFlow.Type.JSON](PgFlow.Type.JSON.md): Ecto type for values that PostgreSQL stores in `jsonb` columns. - [PgFlow.Upstream.Bundle](PgFlow.Upstream.Bundle.md): Builds the deterministic V02 core delta from the pinned upstream checkout. - [PgFlow.Upstream.Claim](PgFlow.Upstream.Claim.md): Recorded eight-column `start_tasks/4` body from core V02. - [PgFlow.Worker.Bootstrap](PgFlow.Worker.Bootstrap.md): Compiles and verifies flow definitions before an Elixir worker registers. - [PgFlow.Worker.Executor](PgFlow.Worker.Executor.md): Task execution logic for flow steps. - [PgFlow.Worker.Lifecycle](PgFlow.Worker.Lifecycle.md): Worker lifecycle state machine. - [PgFlow.Worker.Server](PgFlow.Worker.Server.md): GenServer that polls pgmq and executes flow tasks. - [PgFlow.Worker.StalledTaskRecovery](PgFlow.Worker.StalledTaskRecovery.md): Periodically recovers stalled tasks stuck in 'started' status. - [PgFlow.Worker.TaskRow](PgFlow.Worker.TaskRow.md): Decodes one `pgflow.step_task_record` row into the fields the worker dispatches on. - [PgFlow.WorkerSummary](PgFlow.WorkerSummary.md): Typed operational summary for a persisted PgFlow worker. - [PgFlow.WorkerSupervisor](PgFlow.WorkerSupervisor.md): Supervisor for PgFlow workers. - [PgFlow.Workers](PgFlow.Workers.md): Typed operational reads and cleanup for persisted PgFlow workers. - [PgFlowDashboard](PgFlowDashboard.md): A Phoenix LiveView dashboard for monitoring PgFlow workflow execution. - [PgFlowDashboard.Cache.MetricsCache](PgFlowDashboard.Cache.MetricsCache.md): ETS-based cache for expensive dashboard aggregations. - [PgFlowDashboard.Components.DataTable](PgFlowDashboard.Components.DataTable.md): Sortable, filterable data table component. - [PgFlowDashboard.Components.DependencyGraph](PgFlowDashboard.Components.DependencyGraph.md): Server-rendered SVG DAG visualization component. - [PgFlowDashboard.Components.GanttTimeline](PgFlowDashboard.Components.GanttTimeline.md): Gantt timeline component showing step execution timing within a run. Renders as SVG for crisp visuals and easy theming. - [PgFlowDashboard.Components.HealthBadge](PgFlowDashboard.Components.HealthBadge.md): Health status badge component for workers. - [PgFlowDashboard.Components.JsonViewer](PgFlowDashboard.Components.JsonViewer.md): Server-rendered, syntax-styled JSON with an optional copy action. - [PgFlowDashboard.Components.Layouts](PgFlowDashboard.Components.Layouts.md): Layout components for the PgFlow Dashboard. - [PgFlowDashboard.Components.MetricCard](PgFlowDashboard.Components.MetricCard.md): Dashboard metric card component. - [PgFlowDashboard.Components.ProgressBar](PgFlowDashboard.Components.ProgressBar.md): Progress bar component for run progress visualization. - [PgFlowDashboard.Components.RunHistoryGrid](PgFlowDashboard.Components.RunHistoryGrid.md): GitHub-style activity grid showing run history by step. - [PgFlowDashboard.Components.StatusBadge](PgFlowDashboard.Components.StatusBadge.md): Status badge component with WCAG AA compliant colors. - [PgFlowDashboard.Components.TypeBadge](PgFlowDashboard.Components.TypeBadge.md): Type badge component for distinguishing between flows, jobs, and crons. - [PgFlowDashboard.Config](PgFlowDashboard.Config.md): Configuration validation and management for PgFlowDashboard. - [PgFlowDashboard.Hooks](PgFlowDashboard.Hooks.md): JavaScript hooks for PgFlow Dashboard. - [PgFlowDashboard.Live.CronsLive.Index](PgFlowDashboard.Live.CronsLive.Index.md): Crons list page with statistics and schedule info. - [PgFlowDashboard.Live.CronsLive.Show](PgFlowDashboard.Live.CronsLive.Show.md): Cron detail page with schedule info, run history grid, and recent runs table. - [PgFlowDashboard.Live.FlowsLive.Index](PgFlowDashboard.Live.FlowsLive.Index.md): Flows list page with statistics. - [PgFlowDashboard.Live.FlowsLive.Show](PgFlowDashboard.Live.FlowsLive.Show.md): Flow detail page with dependency graph and run history grid. - [PgFlowDashboard.Live.JobsLive.Index](PgFlowDashboard.Live.JobsLive.Index.md): Jobs list page with statistics. - [PgFlowDashboard.Live.JobsLive.Show](PgFlowDashboard.Live.JobsLive.Show.md): Job detail page with run history grid and recent runs table. - [PgFlowDashboard.Live.LiveHelpers](PgFlowDashboard.Live.LiveHelpers.md): Shared hooks and utilities for PgFlowDashboard LiveViews. - [PgFlowDashboard.Live.OverviewLive](PgFlowDashboard.Live.OverviewLive.md): Overview dashboard page showing key metrics and recent activity. - [PgFlowDashboard.Live.RunsLive.Index](PgFlowDashboard.Live.RunsLive.Index.md): Runs list page with LiveFilter-based filtering. - [PgFlowDashboard.Live.RunsLive.Show](PgFlowDashboard.Live.RunsLive.Show.md): Run detail page with step states and dependency graph. - [PgFlowDashboard.Live.WorkersLive](PgFlowDashboard.Live.WorkersLive.md): Workers monitoring page. - [PgFlowDashboard.Live.WorkersLive.Show](PgFlowDashboard.Live.WorkersLive.Show.md): Worker detail page showing worker info and task history. - [PgFlowDashboard.Migration](PgFlowDashboard.Migration.md): Manages PgFlowDashboard database migrations with version tracking. - [PgFlowDashboard.Migrations.Versions.V01](PgFlowDashboard.Migrations.Versions.V01.md): PgFlowDashboard migration version 1. - [PgFlowDashboard.Migrations.Versions.V02](PgFlowDashboard.Migrations.Versions.V02.md): Adds skipped_steps counts and skip_reason on step lists. - [PgFlowDashboard.Migrations.Versions.V03](PgFlowDashboard.Migrations.Versions.V03.md): PgFlowDashboard migration version 3. - [PgFlowDashboard.Migrations.Versions.V04](PgFlowDashboard.Migrations.Versions.V04.md): PgFlowDashboard migration version 4. - [PgFlowDashboard.Router](PgFlowDashboard.Router.md): Router macro for mounting the PgFlow Dashboard. - [PgFlowDashboard.Supervisor](PgFlowDashboard.Supervisor.md): Supervisor for PgFlowDashboard processes. ## Mix Tasks - [mix pgflow.check_schema](Mix.Tasks.Pgflow.CheckSchema.md): Verifies that the pgflow database schema exists and is compatible with this version of the Elixir implementation. - [mix pgflow.gen.flow_migration](Mix.Tasks.Pgflow.Gen.FlowMigration.md): Generates an Ecto migration that registers a PgFlow flow in the database. - [mix pgflow.gen.helpers_migration](Mix.Tasks.Pgflow.Gen.HelpersMigration.md): Generates an Ecto migration that installs PgFlow's extension SQL functions. - [mix pgflow.gen.job_migration](Mix.Tasks.Pgflow.Gen.JobMigration.md): Generates an Ecto migration that registers a PgFlow job in the database. - [mix pgflow.gen.pgmq_migration](Mix.Tasks.Pgflow.Gen.PgmqMigration.md): Downloads the pgmq SQL-only install bundle from the official pgmq/pgmq repository at task-runtime, persists it into the consuming app's `priv/` tree, and generates an Ecto migration that applies it. - [mix pgflow.gen.postgres_extensions_migration](Mix.Tasks.Pgflow.Gen.PostgresExtensionsMigration.md): Generates a single Ecto migration that runs `CREATE EXTENSION` for the Postgres extensions pgflow relies on. - [mix pgflow.setup](Mix.Tasks.Pgflow.Setup.md): Generates an Ecto migration in the consumer app that installs the pgflow schema by calling `PgFlow.Migration.up/0` and `PgFlow.HelpersMigration.up/0` in the correct order. For historical SQL compatibility, it can optionally call `PgFlowDashboard.Migration.up/0` as well. - [mix pgflow.stamp](Mix.Tasks.Pgflow.Stamp.md): Marks an existing pgflow schema as installed under EctoEvolver's tracking model without re-running V01 DDL. - [mix pgflow.sync_upstream](Mix.Tasks.Pgflow.SyncUpstream.md): Builds a deterministic core SQL delta from a reviewed upstream checkout. - [mix pgflow.test.reset](Mix.Tasks.Pgflow.Test.Reset.md): Resets the test database by stopping and restarting containers. - [mix pgflow.test.setup](Mix.Tasks.Pgflow.Test.Setup.md): Sets up the test database by starting Docker containers and running migrations. - [mix pgflow.test.teardown](Mix.Tasks.Pgflow.Test.Teardown.md): Stops and removes the test database Docker containers. - [mix pgflow_dashboard.gen.indexes](Mix.Tasks.PgflowDashboard.Gen.Indexes.md): Generates an Ecto migration that adds performance indexes to pgflow tables for faster dashboard queries. - [mix pgflow_dashboard.gen.migration](Mix.Tasks.PgflowDashboard.Gen.Migration.md): Generates an Ecto migration that installs PgFlowDashboard.