Deployment topologies
fc-server is one binary whose subsystems are switched on and off by environment variables. A
topology is a choice of how many copies of it to run and which subsystems each copy runs. The same
image serves every role.
The subsystems and their switches
Section titled “The subsystems and their switches”| Subsystem | Switch | Default | Scales out | Needs the database |
|---|---|---|---|---|
| Platform API, console, OAuth/OIDC, delivery callback, housekeeping | FC_PLATFORM_ENABLED |
on | Yes, stateless | Yes |
| Dispatch scheduler | FC_SCHEDULER_ENABLED |
off | No: single active | Yes |
| Stream processor (projections, event fan-out, partition manager) | FC_STREAM_PROCESSOR_ENABLED |
off | No: single active | Yes |
| Scheduled-job scheduler | FC_SCHEDULED_JOB_ENABLED |
off | No: single active | Yes |
| Outbox processor | FC_OUTBOX_ENABLED |
off | No: single active | Yes |
| Router | FC_ROUTER_ENABLED |
off | No: active and standby | No (except to consume Postgres-broker queues) |
| Push gateway | FC_PUSH_ENABLED |
off | Yes | Yes |
| Function runner | FC_FUNCTIONS_ENABLED |
off | Yes, per runner pool | No |
| Ingestion API and runtime API | FC_INGESTION_ENABLED |
off | With the platform API | Yes |
| MCP server | FC_MCP_ENABLED |
off | n/a (a local tool) | No |
Four rules shape every layout:
- Single-active subsystems stay single. The dispatch scheduler, the stream processor, the
scheduled-job scheduler, the outbox processor and the router each keep ordering or firing state in
memory and must have exactly one active copy. Run one copy, or run several with
FC_STANDBY_ENABLED=trueso they elect a leader through Redis. Two active copies without standby break message-group ordering and fire scheduled jobs twice. See leader-gated processors. - The platform API is on unless you switch it off. A worker or router process must set
FC_PLATFORM_ENABLED=false, or it also serves the API and console. - Platform housekeeping runs where the platform API runs. The auth purger, the stranded-sibling reaper, job-key, trace and ingestion retention all run on every process with the platform API enabled. They are safe to run on many replicas at once.
- The partition manager must run somewhere. It is part of the stream processor. The migrations create monthly partitions about a year ahead; without a partition manager, inserts into the event and dispatch-job tables start failing when they run out. See database operations.
All-in-one
Section titled “All-in-one”One process with everything on: the simplest layout, fine for development, test environments and small production installations.
flowchart LR LB[Load balancer] --> S["fc-server<br/>platform + scheduler + stream<br/>+ scheduled jobs + router"] S --> PG[(PostgreSQL<br/>incl. Postgres broker)] S --> C[Consumer endpoints]
| Variable | Value |
|---|---|
FC_SCHEDULER_ENABLED, FC_STREAM_PROCESSOR_ENABLED, FC_SCHEDULED_JOB_ENABLED, FC_ROUTER_ENABLED |
true |
FLOWCATALYST_CONFIG_URL |
http://127.0.0.1:8080/api/dispatch/router-config |
FC_ROUTER_CLIENT_ID, FC_ROUTER_CLIENT_SECRET |
A service account holding the platform:router role |
FC_ROUTER_PLATFORM_URL |
http://127.0.0.1:8080 |
FC_ROUTER_AUTH_USER, FC_ROUTER_AUTH_PASS |
Always set them: the router’s operator surface under /router shares the public API port |
Run one replica. A second replica of an all-in-one process needs standby, and at that point the
split layout below is usually clearer. The docker-compose.yml in the repository is a scaffold of
this layout (PostgreSQL, Redis and one fc-server), not a production recipe.
Split by tier
Section titled “Split by tier”The usual production layout: a stateless API tier that scales on request load, a worker tier for the single-active background subsystems, and a router tier.
flowchart LR LB[Load balancer] --> API1[API replica] LB --> API2[API replica] W1["Worker<br/>scheduler, stream,<br/>scheduled jobs"] --> Q[(Dispatch queues)] W2["Worker standby"] -.-> Q Q --> R1[Router leader] Q -.-> R2[Router standby] R1 -- "POST /api/dispatch/process" --> API1 R1 -- "router-config" --> API2 API1 --> C[Consumer endpoints] API1 --> PG[(PostgreSQL)] API2 --> PG W1 --> PG W1 & W2 & R1 & R2 --- RD[(Redis: leader election)]
The router does not deliver to consumers itself: it calls the platform’s delivery callback, and the API replica that receives the call delivers the job and records the outcome. Delivery load therefore lands on the API tier.
API tier (two or more replicas behind the load balancer):
| Variable | Value |
|---|---|
FC_PLATFORM_ENABLED |
true (the default) |
FC_INGESTION_ENABLED |
true if you run ingestions |
| everything else | off (the defaults) |
Worker tier (two replicas with standby, or exactly one without):
| Variable | Value |
|---|---|
FC_PLATFORM_ENABLED |
false |
FC_SCHEDULER_ENABLED, FC_STREAM_PROCESSOR_ENABLED, FC_SCHEDULED_JOB_ENABLED |
true |
FC_DISPATCH_PROCESSING_ENDPOINT |
The API tier’s internal URL plus /api/dispatch/process. It is stamped on every queue message and must be reachable from the router |
FC_DISPATCH_QUEUE_TYPE and friends |
As for your queue backend; the API tier must use the same values, because it serves the router-config document |
FLOWCATALYST_APP_KEY |
The same value as the API tier. The scheduler signs each message with a key derived from it, and the API tier verifies the signature |
FC_STANDBY_ENABLED, FC_STANDBY_REDIS_URL |
For two replicas |
Router tier (two replicas with standby, or one):
| Variable | Value |
|---|---|
FC_PLATFORM_ENABLED |
false |
FC_ROUTER_ENABLED |
true |
FLOWCATALYST_CONFIG_URL |
The API tier’s /api/dispatch/router-config |
FC_ROUTER_CLIENT_ID, FC_ROUTER_CLIENT_SECRET |
A service account with platform:router |
FC_ROUTER_PLATFORM_URL |
The API tier’s base URL (also enables the settled-group hook) |
FC_ROUTER_AUTH_USER, FC_ROUTER_AUTH_PASS |
Basic auth for the router’s dashboard and operator API |
FC_STANDBY_ENABLED, FC_STANDBY_REDIS_URL |
For two replicas |
A router-only process needs no database for SQS queues. With the Postgres broker, the router-config
document names the platform database as the queue location, so the router needs network access to
PostgreSQL. A separately run router learns about a new client’s queue at its next config fetch
(FC_ROUTER_CONFIG_INTERVAL_SECONDS, 30 seconds by default); a router in the same process as the
platform is told within about a second.
You can fold tiers together where it suits you, for example the router into the worker tier. Keep the four rules above.
High availability
Section titled “High availability”High availability adds a second copy of every single-active subsystem and Redis for the election.
- Each subsystem elects on its own lock key: the router on
FC_STANDBY_LOCK_KEY(defaultfc:server:leader), the others on that key plus a suffix (:scheduler,:stream,:scheduled-job,:outbox). Leaders of different subsystems may therefore land on different replicas. That is fine. - Failover takes up to about 40 seconds. A leader refreshes its 30-second lock every 10 seconds. A leader that dies stops refreshing; its lock expires within 30 seconds, and a standby takes it at its next 10-second attempt. A leader that shuts down cleanly releases its lock, and the standby takes it at its next attempt.
- Election fails closed. A process that cannot reach Redis gives up leadership at once and does no single-active work until it can. A Redis outage therefore pauses dispatch, fan-out, scheduled jobs and routing (the API tier keeps serving).
- Losing leadership drains. The router stops polling, lets in-flight deliveries finish (up to
FC_DRAIN_TIMEOUT_SECONDS, 60 seconds), and hands its buffered messages back to the broker.
See leader failover for what to check when a failover does not happen.
Separate services
Section titled “Separate services”Function runners
Section titled “Function runners”The function runner is part of the same binary. A runner-only process sets FC_PLATFORM_ENABLED=false
and FC_FUNCTIONS_ENABLED=true, needs no database, and authenticates to the platform as a service
account holding platform:function-runner. Runners serve one runner pool each
(FC_FUNCTIONS_POOL); the platform addresses each pool through FC_FUNCTIONS_RUNNER_URL, a URL
template with {pool}. Functions written in Java run in the ingestor runtime instead. See
running function runners.
Ingestor runtimes
Section titled “Ingestor runtimes”A separate Java service with its own image, run as a fleet of one or more instances. It polls the platform and needs nothing from you but a service account, network access to the platform and to its sources, and (for JVM functions) a route from the platform to its port 8091. See running ingestor runtimes.
Push gateway
Section titled “Push gateway”FC_PUSH_ENABLED=true serves server-sent-event streams under /api/push/*. It can run beside the
platform API or as its own service (FC_PLATFORM_ENABLED=false), with any number of replicas: the
single relay that reads the push outbox elects itself with a PostgreSQL lock, not Redis. A separate
gateway service must use the same signing keys and issuer as the platform (it validates the
platform’s tokens and refuses to start with neither the keyring nor a configured key): with the
keyring it reads the same database and needs the same FLOWCATALYST_APP_KEY; with
FC_JWT_KEY_STORE=config it needs the same configured key, and every gateway replica must share
FC_PUSH_STREAM_SECRET. Set the load balancer’s idle timeout above the 25-second heartbeat. See
push gateway.
MCP server
Section titled “MCP server”FC_MCP_ENABLED serves a read-only MCP endpoint for language-model tools, bound to 127.0.0.1 by
default. It is a developer convenience and normally not deployed.
Platform notes
Section titled “Platform notes”- ECS: one service per tier, each with its own task definition from the same image. Put the API
tier behind an Application Load Balancer. Point
FC_DISPATCH_PROCESSING_ENDPOINT,FLOWCATALYST_CONFIG_URLandFC_ROUTER_PLATFORM_URLat the API tier’s internal address (Service Connect or an internal load balancer), not the public one. - EKS: one Deployment per tier; the same rules apply.
- SQS FIFO queues are created by the platform on first publish to each client and priority, so
the task role needs
sqs:CreateQueueon the prefix as well as send, receive, delete and change-visibility. - Router self-registration. With
FC_ALB_ENABLED=true(plusFC_ALB_TARGET_GROUP_ARN,FC_ALB_TARGET_ID,FC_ALB_TARGET_PORT), a router registers itself with a target group when it becomes leader and deregisters when it loses leadership or shuts down, so a load balancer in front of the router tier always reaches the leader’s dashboard. - Stop timeout. Give router tasks a stop timeout longer than
FC_DRAIN_TIMEOUT_SECONDS, and ingestor tasks at least 60 seconds.
- GKE: one Deployment per tier, as for any Kubernetes. Use internal Services for the URLs the worker and router tiers call.
- Cloud Run suits the API tier only if you accept that the API processes scale to zero (set a minimum instance count, as housekeeping runs there). Do not run the worker or router tier on Cloud Run unless CPU is always allocated and the minimum instance count is at least one.
- Queue: the Postgres broker, so the router tier needs a private path to Cloud SQL (the Cloud SQL Auth Proxy or private IP).
- Redis: Memorystore, reachable from the worker and router tiers.
- Kubernetes: one Deployment per tier. Liveness:
GET /healthon the API port (alwaysUPwhile the process serves). Do not use the router’s/router/health/readyas the readiness probe of a process that also serves the API: it answers503whenever the router is degraded, which would take the API out of service too. - Pod disruption budgets keep at least one standby of each single-active tier running during node maintenance.
- VMs: run the container under systemd or a similar supervisor that restarts it on exit; the binary exits on a fatal start-up error and expects to be restarted.
Read next
Section titled “Read next”- Requirements and configuring a deployment.
- Scaling and capacity: when to add replicas, and where that does not help.
- fc-server: the binary’s start-up order and subsystem wiring.
- Decision: one binary, subsystem toggles.