Architecture overview
FlowCatalyst is one Go server, fc-server, with a set of subsystems that can run together in one
process or apart in many. Around it sit a few separate runtimes (function runners, the Java
ingestor runtime), the stores they share (PostgreSQL first of all), and the applications that use
it through SDKs and frameworks. This page is the map. Each part has its own page under
Platform.
The system in context
Section titled “The system in context”flowchart LR
subgraph people["People and devices"]
users["Users in browsers"]
ops["Operators and administrators"]
field["Field devices"]
portal["A client's customers<br/>(portal users)"]
end
subgraph apps["Your applications"]
producer["Producer app<br/>(SDK or framework)"]
consumer["Consumer app<br/>(webhook receiver)"]
end
sources["Outside data sources<br/>SFTP, S3, queues, APIs, HTTP"]
idps["Organisation identity providers<br/>(OIDC)"]
llm["LLM clients"]
subgraph fc["FlowCatalyst"]
api["API and console"]
msg["Messaging pipeline"]
idp["Identity plane<br/>OAuth 2.0 / OIDC"]
capab["Functions, ingestion, push"]
end
producer -- "events (outbox)" --> api
msg -- "signed HTTP deliveries" --> consumer
api --- msg
users -- "sign in" --> idp
portal -- "sign in" --> idp
field -- "PIN, device-bound tokens" --> idp
idp -- "federated login" --> idps
producer -. "tokens, definition sync" .-> idp
consumer -. "tokens" .-> idp
ops -- "console /ui" --> api
sources --> capab
capab --- msg
capab -- "server-sent events" --> field
capab -- "server-sent events" --> users
llm -- "MCP (read only)" --> api
Applications see two faces of the platform: an HTTP API to publish events, sync their definitions and call platform services, and an identity provider to sign their users in and to authenticate themselves. They never see the queue underneath.
Control plane and data plane
Section titled “Control plane and data plane”FlowCatalyst separates what is configured from what flows.
| Control plane | Data plane | |
|---|---|---|
| What it holds | Clients, applications, principals, roles and permissions, OAuth clients, identity providers, event types, subscriptions, connections, dispatch pools, scheduled jobs, functions and their versions, ingestion definitions, platform configuration | Events, dispatch jobs and their attempts, scheduled-job instances, queue messages, push messages, audit log, login attempts, traces |
| Who writes it | Administrators in the console, and applications through definition sync at deploy time | Applications publishing events, ingestion runtimes, functions, and the platform’s own background processors |
| Rate of change | Low. Cached by the processors (for example the fan-out’s subscription cache, 5 seconds by default) | High. Partitioned by month in PostgreSQL and pruned by retention |
| Served by | The API server, the console, the router-config document the router polls | The stream processor, the dispatch scheduler, the router, the delivery callback, the scheduled-job scheduler |
The split is why an application can declare its subscriptions in code and redeploy freely: the control plane is reconciled to match, and the data plane picks the change up within seconds without a restart.
One binary with subsystem toggles
Section titled “One binary with subsystem toggles”fc-server contains every subsystem. Environment variables decide which ones a process runs.
There are no configuration files: everything comes from the environment
(reference).
| Subsystem | Toggle | Default in fc-server |
Default in fcdev |
|---|---|---|---|
| Platform API and console | FC_PLATFORM_ENABLED |
on | on |
| Stream processor | FC_STREAM_PROCESSOR_ENABLED |
off | on |
| Dispatch scheduler | FC_SCHEDULER_ENABLED |
off | on |
| Message router | FC_ROUTER_ENABLED |
off | on |
| Scheduled-job scheduler | FC_SCHEDULED_JOB_ENABLED |
off | on |
| Outbox processor | FC_OUTBOX_ENABLED |
off | off (fcdev outbox runs it standalone) |
| Function runner | FC_FUNCTIONS_ENABLED |
off | on |
| Push gateway | FC_PUSH_ENABLED |
off | on |
| MCP server | FC_MCP_ENABLED |
off | off |
| Ingestion API (the runtime is separate) | FC_INGESTION_ENABLED |
off | on |
Why one binary. A single artifact means a single version to deploy, test and roll back, and
no drift between “the router build” and “the API build”. A small installation runs one process
with everything on. A large one runs the same image several times with different toggles: an API
tier, a worker tier, a router tier. The code paths are the same in development and production, so
what works under fcdev works deployed. A process that runs only the router needs no database
connection at all; fc-server skips connecting, migrating and seeding when no database-backed
subsystem is enabled.
The stores
Section titled “The stores”| Store | Used for | Required? |
|---|---|---|
| PostgreSQL | Everything durable: the control plane, events, dispatch jobs, attempts, audit, identity, functions, ingestion state, the push log (default driver), and optionally the queue itself. Migrations run at start-up (goose). Large tables are partitioned by month in process, so no extensions are needed (no pg_partman, no pg_cron). |
Yes |
| Queue | Carries a pointer per dispatch job from the dispatch scheduler to the router. Three backends: Amazon SQS FIFO, NATS JetStream, or a PostgreSQL table in the platform’s own database. The scheduler publishes to SQS when FC_DISPATCH_QUEUE_TYPE=SQS, otherwise to the built-in PostgreSQL queue. One queue per client and priority. |
Yes, but the PostgreSQL queue needs nothing extra |
| Redis (or Valkey) | Leader election when high availability is on (FC_STANDBY_ENABLED); the cluster-wide rate-limit store when FC_REDIS_URL is set (otherwise PostgreSQL); the push log when FC_PUSH_DRIVER=redis. |
Only for HA, or by choice |
| Object store | Function artifacts (FC_FUNCTIONS_ARTIFACT_STORE, a file:// or s3:// URL). |
Only for functions |
| Secret stores | The database password from AWS Secrets Manager (optional); secret values in platform configuration may be references to AWS Secrets Manager or Parameter Store, resolved at read time. Secrets held by the platform are encrypted with the application key (FLOWCATALYST_APP_KEY). |
Optional |
Why PostgreSQL holds the record. Every event and every dispatch job is a row. The queue carries only a pointer to a job, so losing or replaying a queue message never loses a job, and an operator can always find a job, see its attempts and send it again. It also keeps the requirements small: managed PostgreSQL exists on every cloud.
How an event flows, end to end
Section titled “How an event flows, end to end”sequenceDiagram
autonumber
participant App as Producer app
participant ADB as App database
participant Relay as Outbox relay
participant API as Platform API
participant DB as Platform database
participant Stream as Stream processor
participant Sched as Dispatch scheduler
participant Q as Queue
participant Router as Message router
participant Cb as Delivery callback
participant Sub as Consumer endpoint
App->>ADB: business change + outbox_messages row, one transaction
Relay->>ADB: claim pending rows
Relay->>API: POST /api/events/batch
API->>DB: insert events (one result per item)
API-->>Relay: results
Relay->>ADB: delete accepted rows
Stream->>DB: fan-out: match subscriptions, insert dispatch jobs (PENDING)
Sched->>DB: claim PENDING jobs in group order
Sched->>Q: publish job pointer (per client and priority)
Sched->>DB: mark QUEUED
Router->>Q: poll
Router->>Router: pick pool, queue in message group, apply rate limit
Router->>Cb: POST /api/dispatch/process {messageId}
Cb->>DB: claim job (PROCESSING)
Cb->>Sub: signed POST (envelope or raw data)
Sub-->>Cb: 2xx, or failure
Cb->>DB: record attempt, then COMPLETED, or PENDING with a later time, or FAILED
Cb-->>Router: 200 {ack: true}
Router->>Q: acknowledge
What each step is for:
- Write the event with the data. The SDK or framework writes the event as a row in the
application’s own
outbox_messagestable, in the same transaction as the business change. If the transaction rolls back, there is no event; if it commits, the event will be sent. This closes the gap between “saved the order” and “told the world” that a direct HTTP call leaves open (the outbox). - Relay it. A relay claims pending rows, posts them in batches to the platform
(
/api/events/batch,/api/dispatch-jobs/batch,/api/audit-logs/batchby row type), and deletes each row once the platform has accepted it. The batch answer has one result per item, in order, so a single bad item does not hold up the rest. For an application’s own PostgreSQL the relay isfcdev outbox, run beside the application. Thefc-serveroutbox subsystem runs the same processor over the platform’s own database, or over MongoDB. Within one message group the relay keeps order and never gives up on a row the platform could not take: a retryable failure holds the group with a backoff (1 second up to 5 minutes) and retries without limit, and a row the platform refuses blocks its group, across restarts, until an operator unblocks or skips it. - Store the fact. The API checks the caller’s permission, that
type,sourceanddataare present, that an application’s credential publishes only its own application’s event types (the<application-code>:prefix) and that the caller may act for the client. It does not validate against the event type’s schema. An event of an unregistered type is still stored, and the fan-out matches its type text against subscription patterns all the same: registering an event type documents it, it is not a gate. - Fan out. The stream processor’s fan-out reads new events, matches them against active subscriptions and inserts one dispatch job per match, stamping the event as fanned out in the same transaction. The stream processor also maintains read-optimised copies of events and jobs for the console and API lists, and creates and drops monthly partitions.
- Schedule. The dispatch scheduler claims
PENDINGjobs whose time has come, in group order, holds back jobs behind a failed one in aBLOCK_ON_ERRORgroup, skips paused connections, and publishes a pointer to each job on its client’s queue. Each message group is always handled by the same lane, so a group’s jobs are published in order. - Route. The router polls every queue, hands each message to the dispatch pool it names, and keeps each message group in a first-in, first-out buffer. The pool’s concurrency limit and rate limit apply here. A full pool hands messages back to the broker for later (a deferral) instead of blocking the queue for every other pool (pools).
- Deliver. For a dispatch job the router does not call the consumer itself. It calls the
platform’s delivery callback,
/api/dispatch/process, which claims the job, sends the real request to the consumer with the signature headers, records the attempt and moves the job on. Before delivering it enforces the job’s delay (not_before), age limit (expires_at; an expired job is markedEXPIREDwithout an attempt) and pool status (a suspended or archived pool holds its jobs). Success completes the job; a failure reschedules it with backoff, and a job past its retry limit becomesFAILEDfor an operator. - Acknowledge. The callback answers
200 {ack: true}whatever the consumer said, and the router removes the queue message. Retries are driven by the platform through the job’s next scheduled time, never by the queue, so exactly one component decides when a job is tried again.
Why the router calls back into the platform. The platform owns the job record, the signing credentials and the retry policy. Keeping delivery there means the router stays a generic “queue to HTTP” engine that needs no database, and every attempt is recorded in one place. The router’s own outcome handling (in-place retry, release of a whole group, circuit breakers) still governs any message whose target is a real URL rather than the callback.
Where the guarantees come from.
| Guarantee | Where it is enforced |
|---|---|
| No event lost after commit | The outbox row is in the producer’s transaction; the relay deletes it only after the platform accepts it |
| At-least-once delivery | Jobs live in PostgreSQL; stale-job recovery re-queues a job whose queue message was lost; a delivery that dies mid-flight is retried |
| Order within a message group | The relay’s group distributor, the leader-gated fan-out and scheduler, the scheduler’s per-group lanes, a FIFO queue (or the PostgreSQL queue’s earliest-first claim), and the router’s per-group buffer |
| Isolation between consumers | Dispatch pools: concurrency, rate limit and deferral per pool |
| Who sent it | Each delivery is signed with the HMAC secret of a service account: the subscription’s own, else its connection’s, else the application’s |
Other ways work enters the pipeline. Not everything starts as an event:
- An application can create dispatch jobs directly (through the outbox or the API) when it wants a specific endpoint called, with the same delivery, retry and ordering.
- An ingestion turns records read from outside sources into dispatch jobs, or into events.
- A function can create dispatch jobs and emit events.
- The platform emits its own events (for example changes to principals) into the same pipeline, so applications can subscribe to them.
- Scheduled jobs are fired by the scheduled-job scheduler, which delivers signed firings to their targets itself.
The full model is under The messaging pipeline.
Ordering, high availability and leader election
Section titled “Ordering, high availability and leader election”Per-group order is kept in memory by several components, so each of them must have exactly one
active copy. With FC_STANDBY_ENABLED=true every such subsystem runs its own Redis leader
election on its own key (fc:server:leader:stream, …:scheduler and so on); only the leader
works, and the others wait to take over. If an election cannot be held, the subsystem fails
closed and does nothing, because two active copies would break the ordering it exists to protect.
| Leader-gated (one active copy) | Safe to run many copies |
|---|---|
| Stream processor (fan-out, projections, partition manager, on one election) | API server and console |
| Dispatch scheduler | Delivery callback (it is part of the API) |
| Scheduled-job scheduler | Housekeeping sweeps (idempotent) |
| Outbox processor | Function runners |
| Message router (pools start only on leadership) | Ingestor runtimes (polled sources are leased one at a time) |
| Push gateway tasks (one relay, chosen by a database lock) |
Identity beside messaging
Section titled “Identity beside messaging”sequenceDiagram
autonumber
participant B as Browser
participant App as Your application
participant FC as FlowCatalyst identity
participant Org as Organisation IdP
participant API as Platform API
B->>App: open a protected page
App-->>B: redirect to /oauth/authorize (PKCE)
B->>FC: enter email
alt email domain mapped to an organisation IdP
FC-->>B: redirect to the organisation IdP
B->>Org: sign in
Org-->>FC: id_token (issuer, audience, nonce checked)
else platform credentials
B->>FC: password or passkey, then a second factor if required
end
FC-->>B: redirect back with an authorization code
App->>FC: exchange the code at /oauth/token
FC-->>App: id_token (roles narrowed to this app, 5 minutes)
App->>App: start its own session
Note over App,API: Machine to machine
App->>FC: client_credentials (service account)
FC-->>App: access token (token_use = api, tier, permissions)
App->>API: call the API with the bearer token
The platform is a complete OAuth 2.0 and OpenID Connect provider. Applications never see a password: they redirect people to the platform, get an id_token back, and run their own session from it. Machines authenticate with the client-credentials grant as service accounts. Two kinds of token are kept apart on purpose: the id_token tells an application who signed in (and which of that application’s roles they hold), while only an API access token can call the platform API. A browser token that leaks cannot drive the API (tokens).
Federation, second factors (TOTP, email PIN, passkeys), per-client login branding and delegated administration all live here. Two further identity planes sit beside the main one:
- Portal identities (
/portal/*) for a client’s own customers, kept apart from platform users (portal identity). - Field workers (
/field/*) who sign in on shared or enrolled devices with a PIN or a badge, holding device-bound tokens (field-worker identity).
Why identity sits in the platform. The messaging side already needs to know who is acting: who may publish an event type, who may subscribe, which client a job belongs to, which service account signs a delivery. Those are the same principals, tenants and permissions that decide who may sign in to an application. Keeping both in one place gives one tenancy model, one set of roles (synced from each application’s code), one audit trail and one place to review access. It also means every application gets password policy, second factors and single sign-on without building any of it.
Capabilities at the edge
Section titled “Capabilities at the edge”Three capabilities extend the core, each with its own runtime:
| Capability | What it does | Where it runs |
|---|---|---|
| Functions (concept) | Small first-party programs (Go, Rust, TypeScript, Java) that the platform stores, versions and runs. Subscriptions deliver events to them, schedules fire them, and callers invoke them over HTTP. | The function runner (an fc-server subsystem) runs WebAssembly and JavaScript; Java functions run in the ingestor runtime. Runners fetch their desired state from the platform’s control-plane API. |
| Ingestion (concept) | Reads data from SFTP, S3, SQS, RabbitMQ, polled tables and APIs, HTTP pushes, Camel routes and extensions; splits payloads into records; turns each record into a dispatch job or an event. | The platform stores definitions, versions, leases and reports. A separate Java runtime built on Apache Camel (the ingestor) reads the sources and talks to the platform only through its runtime API, so it can sit behind a firewall. |
| Push (concept) | Server-sent events to browsers, apps and field devices: a small signal that something changed, never the state itself. | The push gateway (an fc-server subsystem) hosts the framework’s push module for many applications. Applications built on the framework can also host push themselves. |
Where SDKs and frameworks plug in
Section titled “Where SDKs and frameworks plug in”| Touch point | What uses it |
|---|---|
| Outbox table in the application’s database | Every SDK’s outbox writer; the framework’s write path writes events, dispatch jobs and audit rows there in the use case’s transaction |
POST /api/events/batch, /api/dispatch-jobs/batch, /api/audit-logs/batch |
The outbox relay; SDKs can also publish directly |
Definition sync endpoints (/api/applications/{appCode}/…/sync) |
SDKs and the framework’s FlowCatalyst module, at deploy time: event types, subscriptions, connections, roles, dispatch pools, scheduled jobs, processes, principals, OpenAPI documents, documentation pages |
| Signed deliveries to the application | SDK webhook verifiers; the framework’s receivers for dispatch jobs and scheduled-job firings |
/oauth/* and OIDC discovery |
SDK auth helpers and session guards (Laravel, TypeScript); the framework’s sessions-and-login module |
/api/* with a service-account token |
SDK platform clients (users, invitations, configuration, ingestions, application admin pages) |
/field/* |
The field libraries (web, React Native, Android) |
/api/push/* |
Push readers in the field libraries and the framework UI |
fcdev |
Local development of all of the above, and fcdev fn / fcdev ingest for functions and ingestions |
The family page says which library to use when.
Local and production shapes
Section titled “Local and production shapes”flowchart TB
subgraph local["Local development: one fcdev process"]
direction LR
fcdev["fcdev<br/>API, console, stream, scheduler,<br/>router, scheduled jobs, functions, push"]
epg[("Embedded PostgreSQL<br/>platform data + queue")]
ing["Ingestor child process<br/>(own Java runtime)"]
fcdev --- epg
fcdev --- ing
end
subgraph prod["Production: one image, several roles"]
direction LR
lb["Load balancer"]
apit["API tier<br/>FC_PLATFORM_ENABLED<br/>N replicas"]
work["Worker tier<br/>stream + dispatch scheduler<br/>+ scheduled jobs<br/>(leader-gated)"]
rt["Router tier<br/>(active + standby)"]
fnr["Function runners<br/>per pool"]
push["Push gateway tasks"]
ingp["Ingestor runtimes<br/>(Java image)"]
pg[("Managed PostgreSQL")]
q[("Queue<br/>SQS FIFO, NATS or PostgreSQL")]
redis[("Redis / Valkey<br/>leader election")]
obj[("Object store<br/>function artifacts")]
lb --> apit
lb --> push
lb --> fnr
apit --- pg
work --- pg
work --> q
rt --> q
rt -- "delivery callback" --> apit
work --- redis
rt --- redis
fnr -- "control plane" --> apit
fnr --- obj
ingp -- "runtime API" --> apit
push --- pg
end
Local. fcdev runs every subsystem in one process against an embedded PostgreSQL that it
downloads on first start: no Docker, no queue service, no Redis. The PostgreSQL queue stands in for
SQS, the router reads its configuration from the same process, and an ingestor runtime runs as a
child process when ingestion is on. The console is at http://localhost:8080.
See fcdev.
Production. The same fc-server image runs in as many roles as the load needs. A typical split:
- an API tier with the platform on, scaled horizontally behind a load balancer;
- a worker tier with the stream processor, the dispatch scheduler and the scheduled-job scheduler, active and standby through Redis;
- a router tier, active and standby, configured with
FLOWCATALYST_CONFIG_URLpointing at the platform’s router-config document, a service-account credential to fetch it, andFC_DISPATCH_PROCESSING_ENDPOINTpointing at the API tier’s delivery callback; - function runners per runner pool, push gateway tasks, and ingestor runtimes (a separate Java image) as needed.
A small installation can run all of that as one fc-server process with everything switched on.
See Deployment topologies.
Cloud equivalents. FlowCatalyst needs a container platform, PostgreSQL, a queue and (for HA) Redis. The platform itself is cloud-neutral; a few integrations are AWS-specific today.
| Need | On AWS | On Google Cloud | Anywhere |
|---|---|---|---|
| Run the containers | ECS or EKS | GKE or Cloud Run | Kubernetes |
| PostgreSQL | RDS or Aurora PostgreSQL | Cloud SQL for PostgreSQL | Any PostgreSQL |
| Queue | SQS FIFO | NATS JetStream (self-run) | NATS JetStream, or the PostgreSQL queue |
| Redis | ElastiCache (Redis or Valkey) | Memorystore | Redis or Valkey |
| Function artifacts | S3 | an s3://-compatible store, or a shared file:// path |
the same |
| Database password, secret references | Secrets Manager, Parameter Store | environment variables or files | environment variables or files |
| Router load-balancer registration | ALB self-registration (FC_ALB_*) |
not available | not needed |
Read next
Section titled “Read next”- Components at a glance: every component in one table.
- The messaging pipeline: the model behind the event flow above.
- Message router: how the router polls, pools, defers and orders.
- fc-server and subsystems: ports, start-up order and leader election.