Functions
A function is a small program that the platform stores, versions and runs for you. You write
it in Go, Rust, TypeScript or Java against a FlowCatalyst function SDK, publish it, and point the
live alias at a version. From then on the platform wires it up: subscriptions deliver events to
it, schedules fire it, other functions dispatch work to it, and callers invoke it over HTTP. There
is no server of yours to run.
Functions exist for the glue that every event-driven system accumulates: map a partner’s payload into your own event, enrich an event and pass it on, call a vendor API on a schedule, answer a small HTTP endpoint. Each of those is too small to justify a service with its own deployment, credentials and monitoring, and too important to leave in a script on someone’s laptop.
First-party code only
Section titled “First-party code only”Functions are first-party code: written, reviewed and published by the people who operate the platform, to provide services to their customers. Customers do not publish or run code of their own, and nothing in the platform or the SDKs is built to let them.
That decision shapes the rest of this page. The sandbox (WebAssembly, declared capabilities, limits and deadlines) exists for fault isolation, least privilege and fair sharing between the operator’s own functions. A function that loops forever, leaks memory or calls a host it should not must hurt only itself. The sandbox is not designed, hardened or tested to contain a hostile author, and publishing a version is a privileged operation for the platform’s own staff. Letting a third party run code would be a different product with different isolation (separate machines, per-tenant pools, CPU quotas), which FlowCatalyst does not have.
How a function gets work
Section titled “How a function gets work”flowchart LR
ev["Event<br/>(subscription)"] -->|signed delivery| r
sch["Schedule<br/>(cron)"] -->|signed firing| r
disp["Another function<br/>(fn.dispatch)"] -->|dispatch job| r
caller["Person or service<br/>(platform token)"] -->|HTTP| r
anyone["Anyone<br/>(open endpoint)"] -->|HTTP| r
subgraph r["Function runner"]
fn["Function version<br/>behind an alias"]
end
fn -->|declared only| caps["Config and secrets, databases,<br/>allowed hosts, events it may emit,<br/>jobs it may dispatch, a platform token"]
Work arrives in two ways. Deliveries (events through a subscription, cron firings, dispatch jobs) go through the normal messaging pipeline: they are signed, retried with backoff, kept in order per message group and visible as dispatch jobs. Calls (from a person or service holding a platform token, or from anyone on an open endpoint) are plain HTTP requests answered directly.
Whatever the source, the function reaches only what it declared. The runner holds every credential; the function never sees a database password, an AWS key or a signing secret.
Addresses, versions and aliases
Section titled “Addresses, versions and aliases”| Concept | Meaning |
|---|---|
| Address | {application}.{name}, for example billing.invoice-pdf. The application owns the function. The address never changes. |
| Version | One published build, numbered 1, 2, 3 and so on. A version is immutable and its number is never reused. |
| Alias | A name that points at a version. live is what subscriptions, schedules and ordinary calls reach. Other aliases (qa, canary) are reachable over HTTP only. |
Publishing changes nothing that is running. Promoting a version to live is the moment it
takes effect, and also the moment its declared subscriptions and schedules are created, updated or
removed to match. Promoting an older version back restores its wiring too, so a rollback is a
single alias change. A version must be loaded by a runner before it can be promoted, and promotion
is refused while a config key, secret or database the version declares has no value.
The platform keeps a function’s 20 most recent untagged versions
(FC_FUNCTIONS_KEEP_VERSIONS) and deletes older ones after each publish. A version an alias points
at is tagged and is never deleted, so the way to keep a build is to point an alias at it.
Why aliases. Separating “published” from “live” lets you load a build, call it through qa,
and only then send real traffic to it. Because wiring follows live, the code and the events it
receives never drift apart: there is no window in which a new subscription delivers to old code.
Declared in code
Section titled “Declared in code”Everything a function needs is declared in its code, through the SDK: its endpoints, the event types it subscribes to, its schedules, the config and secret keys it reads, its databases, the hosts it may call, the event types it may emit and the functions it may dispatch to. The SDK turns those declarations into a describe document inside the built artifact, and the platform reads it at publish without running anything.
There is no separate manifest to keep in step with the code, so the declarations cannot drift from what the code does. The platform, the runner and promotion all parse the describe document strictly: an unknown key is refused, never ignored. Schedules use the same six-field cron as scheduled jobs (seconds first).
Endpoints and how callers authenticate
Section titled “Endpoints and how callers authenticate”Every endpoint names exactly one auth mode. There is no default.
| Mode | Who calls it | What the runner checks before your code runs |
|---|---|---|
webhook |
Subscriptions, schedules and dispatch jobs | The delivery signature (HMAC-SHA256 over timestamp and body, 300-second freshness). POST only |
platform |
People and services holding a platform API access token | The token is valid and an API credential (an id_token is refused). The function then checks the caller’s permissions and client access itself |
none |
Anyone | Nothing. For health checks and third-party webhooks the function verifies itself |
A webhook endpoint verifies with the signing secret of one service account: by default the application’s own, or one set on the function. Deliveries are signed by whoever the delivery path names, so a function that receives dispatch jobs through a connection must verify with that connection’s service account. A function whose account is deactivated refuses every delivery and logs why; it never falls back to another account quietly.
Runtimes
Section titled “Runtimes”A version’s runtime is a tag that names its artifact format. It is fixed by the function’s first version: publishing a jar for a function that has WebAssembly versions, or the reverse, is refused.
| Runtime | Written in | Artifact | Runs in |
|---|---|---|---|
wasm |
Go (standard Go, wasip1), Rust |
A WebAssembly module built for ABI v1 | The function runner (an fc-server subsystem) |
js |
TypeScript or JavaScript | A bundled script, run by a QuickJS engine compiled to WebAssembly | The function runner |
jvm |
Java 25 | A jar with the describe document inside | The ingestor runtime’s function host |
The function runner executes wasm and js on wazero, a WebAssembly engine written in pure
Go, in development (fcdev) and in deployed runners alike. Each call runs in its own instance with
a memory cap. Compiled modules are stopped at their deadline by wazero itself; the platform’s own
JavaScript engine stops itself at the deadline, watched by the host, which avoids paying wazero’s
preemption cost on every JavaScript instruction.
Java functions run inside the ingestor runtime, one instance of the function class per version, each call on its own virtual thread. They share everything else with the other runtimes: addresses, versions, aliases, declarations, settings and promotion.
Runners serve runner pools. A function names its pool, a runner reports which runtimes it supports, and promotion is refused when no live runner of the pool can run the version’s runtime.
What a function can reach
Section titled “What a function can reach”| Capability | The rule |
|---|---|
| Config and secrets | Only declared keys. Values are platform settings per function. Secrets are write-only and may be references to AWS Secrets Manager or Parameter Store |
| Databases | Only declared names. The connection string is a platform setting and the pool belongs to the runner |
| Outbound HTTP | Only to declared hosts, checked on every redirect. Loopback, link-local and metadata addresses are refused |
| Emitting events | Only declared types of the function’s own application, each with a deduplication id |
| Dispatching work | Only declared (function, path) pairs within the same application. The platform builds the job; the declared connection signs it |
| Calling other applications | A function that declares it receives an access token of its application’s service account from its host, to call another first-party application that accepts FlowCatalyst tokens |
| Trace logs | Named contexts that record nothing until an operator switches one on (Audit, traces and logs) |
Every call has a deadline (30 seconds by default), and it reaches into database, HTTP and emit calls: when the time is up, everything the call started stops.
Answers, limits and failure
Section titled “Answers, limits and failure”A delivery’s outcome is read from the function’s answer: any 2xx is delivered, 429 with
Retry-After tries again later without spending an attempt, 422 with
FlowCatalyst-Outcome: reject gives up at once, and anything else (including a crash or a timeout)
is a failed attempt, retried up to the subscription’s or schedule’s limit.
| Limit | Default |
|---|---|
| Memory per instance | 64 MB |
| Concurrent calls per function per runner | 16 (beyond it, 429) |
| Timeout | 30 s (an endpoint may lower it) |
| Request body | 1 MiB |
Limits are platform settings of the function, not part of the artifact. A function that runs out of memory fails only its own call; its neighbours carry on. Instances are reused for speed but recycled after 10,000 calls, trimmed when idle and discarded after any failure, so module-level state is at best a cache.
Read next
Section titled “Read next”- Your first function: write, run and deploy one.
- Write a function and Declare endpoints, auth, subscriptions and schedules.
- Publish, promote and use aliases.
- The function stability promise: what will not change under you.
- Function runners and engines: how the runner works inside.
- Function describe document and ABI.
- Decisions: functions are first-party code, one contract, several engines, JVM functions in the ingestor.