The messaging pipeline
FlowCatalyst moves work from the application that produced it to the systems that must act on it.
The work is either an event (a fact: “order 1042 was placed”) that the platform fans out to
every subscriber, or a dispatch job (one request to one target) that an application, a
function or an ingestion asks for directly. Both end the same way: a signed HTTP POST to a
consumer, retried until it succeeds or an operator steps in.
This page is the map of that pipeline. Each part has its own concept page, linked below.
The parts
Section titled “The parts”| Part | What it does | Where it runs |
|---|---|---|
| Producer | Writes the event (or job) into its own outbox_messages table, in the same database transaction as the business change |
Your application, through an SDK or the framework |
| Outbox relay | Claims pending outbox rows, posts them in batches to the platform, deletes each row the platform accepts | fcdev outbox beside the application, or the fc-server outbox subsystem |
| Ingest | Checks and stores each event as a row (msg_events), or each job as a row (msg_dispatch_jobs); answers one result per item |
The platform API (/api/events/batch, /api/dispatch-jobs/batch) |
| Stream processor (fan-out) | Matches each new event against the active subscriptions and inserts one dispatch job per match | fc-server with FC_STREAM_PROCESSOR_ENABLED, one active copy |
| Dispatch scheduler | Claims due PENDING jobs in group order and publishes a pointer to each on its client’s queue |
fc-server with FC_SCHEDULER_ENABLED, one active copy |
| Queue | Carries the pointer from the scheduler to the router | SQS FIFO, NATS JetStream, or a PostgreSQL table |
| Message router | Polls the queues, puts each message into its dispatch pool and message group, applies concurrency and rate limits, calls the delivery callback | fc-server with FC_ROUTER_ENABLED, active and standby |
| Delivery callback | Claims the job, sends the real request to the consumer, records the attempt, moves the job on | The platform API (/api/dispatch/process), any number of copies |
| Consumer | Verifies the signature and does the work; answers 2xx, a failure, or “later” |
Your application’s webhook endpoint |
flowchart LR P[Producer app] -->|same transaction| OB[(outbox_messages)] OB --> R[Outbox relay] R -->|POST /api/events/batch| EV[(Events)] EV --> FO[Fan-out] FO -->|one per matching subscription| DJ[(Dispatch jobs)] API[API, functions, ingestion] -->|direct jobs| DJ DJ --> S[Dispatch scheduler] S -->|job pointer| Q[[Queue per client and priority]] Q --> RT[Router: pool, group, limits] RT -->|POST /api/dispatch/process| CB[Delivery callback] CB -->|signed POST| C[Consumer] CB -->|outcome| DJ
The diagram reads left to right. The producer’s outbox feeds the relay, which feeds stored events. The fan-out turns events into dispatch jobs, which also arrive directly from the API, functions and ingestions. The scheduler publishes a pointer per job to a queue, the router consumes it and calls the delivery callback, and the callback delivers to the consumer and writes the outcome back onto the job.
Two kinds of work, one delivery path
Section titled “Two kinds of work, one delivery path”- Events are published by applications, and by the platform itself for changes such as a new user. An event is stored as a fact and never changed. On its own it delivers nothing: only subscriptions turn it into deliveries, and an event that no subscription matches is simply kept. See events.
- Dispatch jobs are the unit of delivery. The fan-out creates one per matching subscription; an
application creates one directly when it wants a specific endpoint called; a function creates one
with
fn.dispatch; an ingestion turns each record it reads into one. Whatever made it, a job is scheduled, routed, delivered, retried and audited the same way. See dispatch jobs.
Scheduled jobs are a separate, simpler path: the scheduled-job scheduler fires them on a cron schedule and delivers each firing itself, without the queue or the router.
Why the pipeline is split this way
Section titled “Why the pipeline is split this way”The database holds the record; the queue holds a pointer. Every event and every job is a row in PostgreSQL. The queue message carries only the job’s id. Losing a queue message, or delivering it twice, never loses or duplicates a job: the scheduler re-publishes a job whose message went missing, and the delivery callback refuses to deliver a job that is already being delivered or is finished. An operator can always find a job, read every attempt and send it again.
One component decides when to retry. The delivery callback answers the router ack: true once
it has recorded an outcome, and a failed job goes back to PENDING with a later scheduled time. The
scheduler picks it up when that time comes. Because the queue never redelivers a failed job on its
own timer, there is never a second, competing retry.
The router stays generic. It needs no database: it reads its pool and queue configuration from the platform’s router-config document and calls one URL per message. Delivery, signing credentials and the retry policy live in the platform, beside the job record, so every attempt is recorded in one place.
Work is isolated per pool. Concurrency and rate limits belong to dispatch pools, and a full pool hands its messages back to the queue for later instead of blocking it. A slow consumer slows its own pool, not everyone else’s.
Where each guarantee comes from
Section titled “Where each guarantee comes from”The pipeline delivers at least once. Nothing is lost after the producer commits, and a delivery may occasionally be repeated.
| Guarantee | What provides it |
|---|---|
| An event exists if and only if the business change committed | The outbox row is written in the producer’s own transaction (the outbox) |
| No event is lost between the producer and the platform | The relay deletes a row only after the platform’s per-item result says it was accepted; a row claimed by a relay that died returns to pending after 5 minutes |
| A relay that sends a batch twice does not create two events | The platform drops an event whose deduplicationId it already holds (every SDK sets one by default, the outbox row id) |
| Every matching subscription gets a job | The fan-out inserts the jobs and marks the event fanned out in one transaction |
| A job whose queue message is lost is still delivered | Stale recovery returns a job left QUEUED for 15 minutes to PENDING, and one left PROCESSING with no outcome for 75 minutes |
| A delivery cut short by a crash is retried | The callback’s claim has a lease (the job’s timeout plus 30 seconds); a later copy of the message takes over a claim whose lease has run out |
| Two copies of a message do not deliver at the same time | The router drops a copy while another owns the message, and the callback’s claim is a conditional update that only one caller wins |
| Order within a message group | The relay, the leader-gated fan-out and scheduler, the queue and the router’s per-group buffer (ordering) |
| One consumer cannot starve the others | Dispatch pools and deferral (pools) |
| The consumer can tell who sent it | Each delivery is signed with a service account’s HMAC secret (delivery) |
What the pipeline does not do
Section titled “What the pipeline does not do”- It does not validate payloads. Event type schemas document the payload for consumers; ingest does not check events against them (events).
- It does not deliver exactly once. See the caution above.
- It does not trip a circuit breaker per consumer. A failing consumer gets retries with backoff
and then a
FAILEDjob for an operator. The router’s circuit breakers see only the URL the router calls, which for dispatch jobs is the platform’s own delivery callback. - It does not order messages without a group. Ordering is defined only within a message group.
Read next
Section titled “Read next”- Events and event types and the transactional outbox: the producer side.
- Subscriptions and connections and dispatch jobs: how events become deliveries.
- Dispatch pools, ordering and delivery: how deliveries are paced, ordered and received.
- Your first event, end to end: the whole path on
fcdev. - Component deep dives: outbox processor, stream processor, dispatch scheduler, message router.
- Decisions: transactional outbox, the router is a poller, leader-gated processors.