Flow

Architecture

Server, worker, queue, database, and blob storage — how the pieces fit.

REST / SSE /api/hub jobs, read / write claim jobs, events run get / put get / put Client UI server Server PostgreSQL Worker flow-sandboxQuickJS on wasmtime Blob storage

Components

UI server — The Next.js app and the only entry point: it forwards API calls under /api/hub to the server, which is reachable on the internal network only.

Server — HTTP API, request validation (OpenAPI), cron scheduler, SSE streaming. It enqueues jobs and applies their results to its own tables.

Worker — A Node process that claims jobs from Postgres: deploy indexing, build agent prompts, and flow runs, which it executes in its flow-sandbox. See Flow execution.

PostgreSQL — Source of truth for flows, executions, schedules, and API tokens, and the job queue: workers claim jobs with SELECT … FOR UPDATE SKIP LOCKED and write their output as job events, which the server streams to SSE clients.

Blob storage — Flow bundles, uploaded files and finished runs' output.