API Reference PgFlow v#0.3.3

Copy Markdown View Source

Modules

PgFlow is an Elixir implementation of the pgflow workflow engine.

Client API for interacting with PgFlow runs.

Configuration validation and management for PgFlow.

Context struct passed to step handler functions.

Typed operational statistics and schedule data for a PgFlow cron definition.

Compile-time validation helpers for PgFlow DSL macros.

Typed operational statistics for a stored PgFlow definition.

Typed operational reads for persisted PgFlow definitions and schedules.

A macro-based DSL for defining pgflow workflows.

Represents a compiled flow definition.

Represents a single step in a flow definition.

Compiles flow definitions into SQL statements.

Registry for flow definitions using an ETS table.

Supervised GenServer that registers flow and job modules with exponential backoff and jitter.

Registration snapshot for one flow/job module, as returned by PgFlow.FlowStarter.module_status/1 and embedded in status/0 results.

Manages database migrations for PgFlow's extension SQL functions.

A macro-based DSL for defining pgflow background jobs.

Compiles job definitions into SQL statements.

LiveView-native client for tracking flow and job runs in real-time.

Structured logging for PgFlow, aligned with the TypeScript reference implementation.

Typed operational overview metrics for PgFlow.

Installs the pgflow core schema (tables, triggers, functions) into a consumer app's database via EctoEvolver.

Version 1 of the core pgflow schema.

PgFlow extensions migration version 1.

PgFlow extensions migration version 2.

PgFlow extensions migration version 3.

PgFlow extensions migration version 4.

Typed real-time metrics for PgFlow's operational overview.

SQL query interface for pgflow flow operations.

Shared utilities for database queries.

SQL query interface for pgmq-specific operations.

SQL query interface for pgflow worker operations.

Typed result for one step in a run history projection.

Typed operational summary for a PgFlow run.

Typed operational reads for PgFlow runs, states, and tasks.

Schema for the pgflow.deps table.

Schema for the pgflow.flows table.

Schema for the pgflow.runs table.

Schema for the pgflow.steps table.

Schema for the pgflow.step_states table.

Schema for the pgflow.step_tasks table.

Schema for the pgflow.workers table.

Manages PostgreSQL LISTEN/NOTIFY for pgmq queue notifications.

Splits a raw PostgreSQL script into individual top-level statements.

Main supervisor for PgFlow components.

Telemetry events emitted by PgFlow.

Bridges PgFlow telemetry events to Phoenix.PubSub.

Ecto type for values that PostgreSQL stores in jsonb columns.

Task execution logic for flow steps.

Worker lifecycle state machine.

GenServer that polls pgmq and executes flow tasks.

Periodically recovers stalled tasks stuck in 'started' status.

Decodes one pgflow.step_task_record row into the fields the worker dispatches on.

Typed operational summary for a persisted PgFlow worker.

Supervisor for PgFlow workers.

Typed operational reads and cleanup for persisted PgFlow workers.

A Phoenix LiveView dashboard for monitoring PgFlow workflow execution.

ETS-based cache for expensive dashboard aggregations.

Sortable, filterable data table component.

Server-rendered SVG DAG visualization component.

Gantt timeline component showing step execution timing within a run. Renders as SVG for crisp visuals and easy theming.

Health status badge component for workers.

Server-rendered, syntax-styled JSON with an optional copy action.

Layout components for the PgFlow Dashboard.

Dashboard metric card component.

Progress bar component for run progress visualization.

GitHub-style activity grid showing run history by step.

Status badge component with WCAG AA compliant colors.

Type badge component for distinguishing between flows, jobs, and crons.

Configuration validation and management for PgFlowDashboard.

JavaScript hooks for PgFlow Dashboard.

Crons list page with statistics and schedule info.

Cron detail page with schedule info, run history grid, and recent runs table.

Flows list page with statistics.

Flow detail page with dependency graph and run history grid.

Jobs list page with statistics.

Job detail page with run history grid and recent runs table.

Shared hooks and utilities for PgFlowDashboard LiveViews.

Overview dashboard page showing key metrics and recent activity.

Runs list page with LiveFilter-based filtering.

Run detail page with step states and dependency graph.

Workers monitoring page.

Worker detail page showing worker info and task history.

Manages PgFlowDashboard database migrations with version tracking.

PgFlowDashboard migration version 1.

Adds skipped_steps counts and skip_reason on step lists.

PgFlowDashboard migration version 3.

Router macro for mounting the PgFlow Dashboard.

Supervisor for PgFlowDashboard processes.

Mix Tasks

Verifies that the pgflow database schema exists and is compatible with this version of the Elixir implementation.

Generates an Ecto migration that registers a PgFlow flow in the database.

Generates an Ecto migration that installs PgFlow's extension SQL functions.

Generates an Ecto migration that registers a PgFlow job in the database.

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.

Generates a single Ecto migration that runs CREATE EXTENSION for the Postgres extensions pgflow relies on.

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.

Marks an existing pgflow schema as installed under EctoEvolver's tracking model without re-running V01 DDL.

Resets the test database by stopping and restarting containers.

Sets up the test database by starting Docker containers and running migrations.

Stops and removes the test database Docker containers.

Generates an Ecto migration that adds performance indexes to pgflow tables for faster dashboard queries.

Generates an Ecto migration that installs PgFlowDashboard.