API Reference PgFlow v#0.1.0

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.

Compile-time validation helpers for PgFlow DSL macros.

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.

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.

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.

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.

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.

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.

Supervisor for 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.

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.

Database queries for cron-related data.

Database queries for flow-related data.

Database queries for job-related data.

Database queries for dashboard metrics with caching.

Database queries for run-related data.

Database queries for worker-related data.

Router macro for mounting the PgFlow Dashboard.

Schema for the pgflow_dashboard.runs_view view.

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 (and optionally PgFlowDashboard.Migration.up/0) in the correct order.

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.