Skip to content

Identifiers

Every record FlowCatalyst creates has an id that is a TSID: a time-sorted identifier written as 13 characters of Crockford Base32. Entities in the control plane add a three-letter type prefix:

clt_0HZXEQ5Y8JY5Z a client
prn_0HZXEQ5Y8JY60 a principal
0HZXEQ5Y8JY61 an event (no prefix)

This page explains the format, which ids carry a prefix, and why the platform uses them.

A raw TSID is a 64-bit number, encoded as 13 Crockford Base32 characters (digits and upper-case letters, without I, L, O and U, which are easy to misread).

Bits Field Purpose
63 to 22 timestamp, 42 bits milliseconds since the Unix epoch
21 to 10 sequence, 12 bits orders ids made in the same millisecond
9 to 0 random, 10 bits separates ids made by different processes in the same millisecond

The timestamp sits in the high bits, so ids sort by creation time, and Crockford Base32 keeps that order when the ids are compared as strings. Within one process the generator is strictly increasing: inside a millisecond the sequence counts up, and if a process makes more than 4,096 ids in one millisecond it borrows the next millisecond rather than reuse a value. A wall-clock step backwards cannot cause a repeat either, because the generator only moves forward. Across processes, ids are ordered by millisecond and then by chance.

A typed TSID is {prefix}_{raw}, for example clt_0HZXEQ5Y8JY5Z. The prefix is lower case and three letters long.

Entities that people and applications refer to carry a prefix. A selection:

Prefix Entity Prefix Entity
clt_ client (tenant) evt_ event type
app_ application sub_ subscription
prn_ principal (user or service account) con_ connection
sac_ service account dpl_ dispatch pool
rol_ role sjb_ scheduled job
oac_ OAuth client sji_ scheduled-job instance
idp_ identity provider aud_ audit log entry
ptu_ portal identity pta_ portal app
fwu_ field worker fwd_ field device
fnc_ function fnv_ function version
ing_ ingestion prc_ process

The full list is in the ID prefixes reference.

The high-volume records of the data plane are bare 13-character TSIDs with no prefix: events, dispatch jobs and the rows of an application’s outbox. They are minted where they are written, often by the producer’s SDK before the platform sees them, and the batch endpoints accept the id the producer chose. A dispatch job raised by the fan-out gets a fresh bare TSID from the platform.

Ids are always generated, never typed in by a person. The platform generates them for the records it creates, and every SDK ships a generator in the same format (Go tsid, TypeScript outbox/tsid, PHP TsidGenerator, and the others), so an application can mint an id for an outbox row, or for its own entities with its own prefix (ord_, inv_), and the platform reads it the same way.

Two things in FlowCatalyst look like ids but are not:

  • Codes are chosen by people: an application’s code (orders), a client’s identifier (acme), an event type’s code (orders:sales:order:placed), a role’s name (orders:clerk). Codes are stable, readable names. Ids are opaque.
  • An OAuth client_id is chosen by whoever registers the OAuth client. It is not a TSID, has no prefix guarantee, and is not a client (tenant) id either.

Why time-sorted. Ids that grow with time are inserted at the end of a B-tree index instead of at random places, which keeps the hot part of the index small on tables that take millions of rows. A list sorted by id is also sorted by creation time, and anyone can see roughly when a record was made by decoding its id. A UUIDv4 has none of these properties, and is 36 characters instead of 13.

Why prefixes. A clt_ id and a prn_ id are both strings, on the wire and in the database. The prefix makes an id self-describing in a log line, an error message or a support ticket, and it turns “passed the principal id where the client id belonged” into something a reader can see at once. The platform’s own code goes further and gives each kind of id its own type, so the compiler catches the swap. The prefix also keeps a tenant (clt_) apart from an OAuth client_id, two different things that share the word “client”.

Why generated, and why codes beside them. A generated id never collides and never needs renaming. But a generated id differs in every environment, so anything that has to line up across environments uses codes instead: definition sync from application code matches subscriptions, connections and roles by code, and exporting definitions from one platform and importing them into another carries codes, not ids.