|
1 |
| -# pgflow |
| 1 | +<p align="center"><a href="https://pgflow.dev" target="_blank" rel="noopener noreferrer"><img src="logo.png?raw=true" alt="pgflow logo"></a></p> |
2 | 2 |
|
3 |
| -Postgres-centric workflow engine with deep integration with Supabase |
| 3 | +### Where complex becomes clockwork. |
4 | 4 |
|
5 |
| -#### 🌐 check docs at [pgflow.dev](https://pgflow.dev) |
| 5 | +> "Things just happen. What the hell. And the reason things just happen is that a hundred billion other things just happened, all working unheeded and unseen, to make sure that they do." |
| 6 | +> |
| 7 | +> –- Terry Pratchett, Last Continent, reflecting on the elegant machinery of complex systems |
6 | 8 |
|
7 |
| -> [!NOTE] |
8 |
| -> This project and all its components are licensed under [Apache 2.0](./LICENSE) license. |
| 9 | +## Overview |
| 10 | + |
| 11 | +pgflow is a workflow orchestration system that runs directly in your Postgres database - ideal for building reliable AI workflows, background jobs, and data pipelines on Supabase without external services. |
| 12 | + |
| 13 | +The system combines: |
| 14 | + |
| 15 | +- **[SQL Core](./pkgs/core/)** - Workflow state management natively in Postgres with ACID compliance |
| 16 | +- **[TypeScript DSL](./pkgs/dsl/)** - Type-safe workflow definitions with automatic inference |
| 17 | +- **[Edge Worker](./pkgs/edge-worker/)** - Auto-respawning task processor that handles retries and concurrency |
| 18 | +- **[CLI Tools](./pkgs/cli/)** - One-command setup with automatic schema migrations |
| 19 | + |
| 20 | +## Documentation |
| 21 | + |
| 22 | +The pgflow documentation is [available on pgflow.dev](https://pgflow.dev). |
| 23 | + |
| 24 | +## Getting help |
| 25 | + |
| 26 | +File an issue on [GitHub](https://github.com/pgflow-dev/pgflow/issues/new) or join our [Discord](https://discord.gg/NpffdEyb). |
| 27 | + |
| 28 | +## Why pgflow? |
9 | 29 |
|
10 |
| -## Monorepo |
| 30 | +When you need more than just isolated background jobs, but don't want the complexity of external orchestration systems: |
11 | 31 |
|
12 |
| -This repository is a monorepo containing components of pgflow. |
13 |
| -Packages live in `pkgs/` |
| 32 | +- **Postgres as the Single Source of Truth** - All definitions, state, and history in your database |
| 33 | +- **Zero Infrastructure** - No external services, dashboards, or control planes |
| 34 | +- **Type-Safe Workflows** - Full compile-time safety between workflow steps |
| 35 | +- **Reliable Background Jobs** - Automatic retries with backoff and observability |
14 | 36 |
|
15 |
| -| Package | Description | |
16 |
| -| -------------------------------------- | ------------------------------------------------------------------------------------- | |
17 |
| -| [cli](./pkgs/cli/) | Command-line interface for installing pgflow and compiling flows | |
18 |
| -| [core](./pkgs/core/) | SQL Core for the workflow engine - foundational part of **pgflow** stack | |
19 |
| -| [dsl](./pkgs/dsl/) | Flow DSL - the TypeScript library used to define flows and their handlers | |
20 |
| -| [edge-worker](./pkgs/edge-worker/) | An auto-restarting task queue worker implemented for Supabase Edge Functions and PGMQ | |
21 |
| -| [website](./pkgs/website/) | Documentation Site | |
22 |
| -| [example-flows](./pkgs/example-flows/) | Small package containing various example flows, mainly for exploration | |
| 37 | +## What can you build? |
23 | 38 |
|
24 |
| -## NX Readme |
| 39 | +- **AI Workflows** - Chain LLMs, scrape data, reason across tools, and handle failures |
| 40 | +- **Background Jobs** - Process emails, files, and scheduled tasks with full visibility |
| 41 | +- **Data Pipelines** - Extract, transform, and load data with built-in dependency handling |
25 | 42 |
|
26 |
| -See [NX_README.md](./NX_README.md) for more information. |
| 43 | +## How pgflow works |
| 44 | + |
| 45 | +1. **Define workflows using TypeScript DSL** |
| 46 | +2. **Compile them to SQL migrations** |
| 47 | +3. **Deploy as Supabase Edge Functions** |
| 48 | +4. **Trigger workflows from your app or SQL** |
| 49 | + |
| 50 | +The execution system handles the rest - scheduling steps when dependencies complete, retrying failed tasks, and aggregating results automatically. |
| 51 | + |
| 52 | +## Packages |
| 53 | + |
| 54 | +| Package | Description | |
| 55 | +| -------------------------------------- | ----------------------------------------------------------------------- | |
| 56 | +| [cli](./pkgs/cli/) | Command-line interface for installing and compiling flows | |
| 57 | +| [core](./pkgs/core/) | SQL Core for the workflow engine - foundational tables and functions | |
| 58 | +| [dsl](./pkgs/dsl/) | TypeScript DSL for defining flows with type inference | |
| 59 | +| [edge-worker](./pkgs/edge-worker/) | Task queue worker for Supabase Edge Functions with reliability features | |
| 60 | +| [website](./pkgs/website/) | Documentation site | |
| 61 | +| [example-flows](./pkgs/example-flows/) | Example workflow definitions | |
| 62 | + |
| 63 | +## Resources |
| 64 | + |
| 65 | +- 📖 **Documentation**: [pgflow.dev](https://pgflow.dev) |
| 66 | +- 🚀 **Demo**: [pgflow-demo.netlify.app](https://pgflow-demo.netlify.app) |
| 67 | +- 🛠️ **Getting Started**: [pgflow.dev/getting-started](https://pgflow.dev/getting-started) |
| 68 | + |
| 69 | +> [!NOTE] |
| 70 | +> This project and all its components are licensed under [Apache 2.0](./LICENSE) license. |
0 commit comments