pgflow 0.9.0: Control Plane and HTTP-Based Compilation
pgflow 0.9.0 introduces the ControlPlane edge function, enabling HTTP-based flow compilation without requiring a local Deno installation.
What Changed
Section titled “What Changed”The CLI no longer spawns Deno processes locally. Instead, compilation requests go through the ControlPlane edge function:
pgflow compile my_flow --> ControlPlane --> SQL migrationThis simplifies the development setup and lays groundwork for future auto-compilation features where workers will verify and compile flows at startup without any CLI involvement.
Breaking Changes
Section titled “Breaking Changes”Compile Command
Section titled “Compile Command”The pgflow compile command now takes a flow slug instead of a file path:
Before (0.8.x):
pgflow compile path/to/my_flow.ts --deno-json supabase/functions/deno.jsonAfter (0.9.0):
pgflow compile my_flowThe --deno-json flag has been removed.
New Install Experience
Section titled “New Install Experience”The installer now scaffolds a complete working setup:
This creates:
supabase/flows/- Directory for flow definitions with namespace importssupabase/flows/greet-user.ts- Example GreetUser flowsupabase/functions/pgflow/- Control Plane for compilationsupabase/functions/greet-user-worker/- Example worker ready to run
The installer shows a clear summary and asks for a single confirmation before making changes.
Namespace Imports for Flows
Section titled “Namespace Imports for Flows”ControlPlane now supports namespace imports, the recommended pattern:
import { ControlPlane } from '@pgflow/edge-worker';import * as flows from '../../flows/index.ts';
ControlPlane.serve(flows);Add flows by exporting from flows/index.ts:
export { GreetUser } from './greet-user.ts';export { MyOtherFlow } from './my-other-flow.ts';Upgrading from v0.8.x
Section titled “Upgrading from v0.8.x”Existing compiled flows continue to work - no recompilation needed.
To compile new flows with v0.9.0:
- Run
npx [email protected] installto add the ControlPlane andsupabase/flows/directory - Create new flow files in
supabase/flows/ - Export them from
supabase/flows/index.ts
Removed: —deno-json flag
Section titled “Removed: —deno-json flag”The --deno-json flag has been removed. Compilation now uses the ControlPlane
edge function instead of local Deno. If you used this flag in CI/CD scripts,
update them to use the new compilation approach.