Skip to content

Applications and integrations

An application (app_) is the unit of integration in FlowCatalyst: a system that publishes events, consumes them, declares what it owns on the platform, and signs its users and machines in through the platform. An order service, a warehouse application and a billing system are each an application.

Every application has a short, unique code, such as orders. The code prefixes everything the application owns, so ownership is visible in the name itself:

What Example
Event type orders:sales:order:placed
Role orders:admin
Permission orders:sales:order:cancel
Function address orders.price-quote
Push topic orders:order:ord_123

The prefix is enforced, not decorative. A credential bound to orders can publish only orders: event types, sync only orders roles, and a synced role can hold only orders: permissions.

An application declares most of what it owns in its own code, and pushes it to the platform with definition sync:

Resource How it gets there
Event types (with optional JSON schemas) Definition sync
Subscriptions Definition sync, or the console
Connections Definition sync (owned by the application), or the console
Dispatch pools Definition sync, or the console
Roles and the permissions they hold Definition sync
Scheduled jobs Definition sync
Processes Definition sync
Principals (its users and their roles) Principal sync, the user APIs, or sign-in through a federated identity provider
OpenAPI document Definition sync, versioned with change notes between versions
Documentation pages (Markdown) Definition sync, always the complete set
Push topic rules and ticket keys Definition sync, for the platform push gateway
Functions and ingestions Published and managed separately (functions, ingestion)

Sync is declarative: the code is the source of truth, and each sync makes the platform match it. A sync is idempotent, so applications run it on every deploy. Where a team adopts sync gradually, removeUnlisted decides whether resources the code no longer lists are removed; it only ever touches resources that came from sync, never ones an administrator made in the console. Documentation sync is the exception: the payload is always the whole set.

Connections and subscriptions synced from code are addressed by code, not id. An id differs in every environment, a code does not, so the same declaration works in development, test and production. Two independent axes describe them: a connection is global or client-scoped (bound to one client), and shared or application-owned (bound to one application).

Why declare in code. Definitions that live in the console drift between environments and are lost when someone forgets a step. Definitions that live next to the code that relies on them are reviewed with it, versioned with it and deployed with it.

An application has a type:

  • Application (APPLICATION): a system people sign in to. It can have interactive OAuth clients for its sign-in.
  • Integration (INTEGRATION): a connector or adapter with no users of its own. Only an integration can own ingestions, and it is not offered when creating an OAuth client.

Turning an application into an integration is always allowed. Turning an integration back into an application is refused (APPLICATION_TYPE_IN_USE) while it still owns an ingestion. The change is recorded in the audit log.

flowchart LR
  app["Application<br/>orders (app_)"]
  sa["Service account (sac_)<br/>webhook credentials:<br/>bearer token, HMAC secret"]
  prn["SERVICE principal (prn_)<br/>role platform:application-service<br/>applications = [orders]"]
  oc["Confidential OAuth client (oac_)<br/>client_credentials"]
  login["Login OAuth client (oac_)<br/>authorization code + PKCE"]
  app --- sa
  sa --- prn
  prn --- oc
  app -. "optional, for sign-in" .- login

The application service account. Provisioning a service account for an application creates, in one transaction:

  • a service account (sac_) with generated webhook credentials: a bearer token and an HMAC-SHA256 signing secret, used when the platform delivers to the application and when it signs the application’s scheduled-job firings;
  • its SERVICE principal (prn_), holding the built-in platform:application-service role, the least-privilege set an application needs (publish through its outbox, sync its definitions, read its own events and jobs, manage its own users and invitations, fire its own scheduled jobs, read and write its own configuration), every grant confined to its own application;
  • a confidential OAuth client (oac_) for the client-credentials grant, linked to the application. Its secret is shown once.

The application then authenticates as that service account to sync, publish and call the API (call the API). GET /api/applications/{id}/service-account returns the service account attached to an application (with its principal id and OAuth client_id, never a secret). It needs read access to the application and service-account:view; an application without a service account, or one the caller may not view, answers 404.

A login client (optional). An application that signs people in gets an interactive OAuth client: authorization code with PKCE, exact-match redirect URIs, and the openid, profile and email scopes. A public client (a single-page app or a native app) has no secret and must use PKCE; a confidential one has a secret. See tokens for what such a client receives.

The application service account is anchor-tier, so it works for every client that uses the application. It is not allowed to touch other applications. That confinement is a second axis of reach, independent of the tier:

  • A principal either reaches every application or a listed set. The token’s applications claim carries ["*"] for every application, otherwise id:code pairs such as app_0HZXEQ5Y8JY5Z:orders. (An older all_applications boolean is still emitted beside it and is deprecated.)
  • An application service account is provisioned with exactly one entry: its own application.
  • Every application-scoped route checks it. The definition-sync routes (/api/applications/{appCode}/…/sync) refuse another application with 403. The application admin routes (its events, dispatch jobs, users and invitations) answer 404 for another application’s code or records, so the answer does not reveal what exists.

Users reach every application by default. An administrator can restrict a user to a list, and a login client can be limited to its applications, which narrows what the client’s tokens describe.

Why a separate axis. Tier answers “which tenants”, applications answer “which systems”. An integration typically serves every client, so it must be anchor-tier, yet it must never edit another application’s roles or read another application’s jobs. Two axes express that; one cannot.

A client uses an application only when it is entitled to it, through a client config: one row per application and client, enabled or disabled. Entitlement bounds which application roles a client’s administrators may hand out, and decides who counts as the application’s users: the client-tier users homed at an entitled client who hold at least one of its roles. See tenancy.