Skip to content

ironflow event

Manage event schemas and test upcasters.

Terminal window
ironflow event <subcommand> [flags]

Register a JSON schema for an event type at a specific version.

Terminal window
ironflow event schema register <event-name> [flags]

Arguments:

ArgumentRequiredDescription
event-nameYesThe event name (e.g., order.created)

Flags:

FlagShortTypeDefaultDescription
--versionintSchema version (required)
--filestringPath to JSON schema file
--schemastringInline JSON schema string
--descriptionstringSchema description
--server-sstringServer URL override

One of --file or --schema is required. Cannot use both.

Examples:

Terminal window
ironflow event schema register order.created --version 1 --file schema.json
ironflow event schema register order.created --version 1 --schema '{"type":"object"}'
ironflow event schema register order.created --version 2 --file schema-v2.json --description "Added address field"

The schema must be a JSON Schema the server can compile (draft 2020-12); a malformed document is rejected. Re-registering an existing (event name, version) overwrites it and reports updated rather than created.

The created/updated distinction is advisory. It is read before the upsert rather than derived from it, so two registrations racing on the same (event name, version) can both report created. The write itself is still correct — last one wins — and this is a display label on a command a human runs, not a value to branch on.

Registering a schema does not by itself enforce it. See IRONFLOW_EVENT_SCHEMA_ENFORCEMENT, which is off by default.

List registered event schemas.

Terminal window
ironflow event schema list [flags]

Flags:

FlagShortTypeDefaultDescription
--eventstringFilter by event name
--limitint100Maximum number of schemas to return
--jsonboolfalseOutput as JSON
--server-sstringServer URL override

Output:

EVENT VERSION DESCRIPTION REGISTERED
order.created 1 Order created event 2025-01-15 12:00:05
order.created 2 Added address field 2025-01-20 09:30:00

Examples:

Terminal window
ironflow event schema list
ironflow event schema list --event order.created
ironflow event schema list --json

Get detailed information about a registered event schema.

Terminal window
ironflow event schema get <event-name> [flags]

Arguments:

ArgumentRequiredDescription
event-nameYesThe event name to look up

Flags:

FlagShortTypeDefaultDescription
--versionint0Schema version (0 = latest)
--jsonboolfalseOutput as JSON
--server-sstringServer URL override

Output:

Event: order.created
Version: 2
Description: Added address field
Registered: 2025-01-20 09:30:00
Schema:
{"type":"object","properties":{"id":{"type":"string"},"address":{"type":"object"}}}

Examples:

Terminal window
ironflow event schema get order.created
ironflow event schema get order.created --version 2
ironflow event schema get order.created --json

Delete a registered event schema.

Terminal window
ironflow event schema delete <event-name> [flags]

Arguments:

ArgumentRequiredDescription
event-nameYesThe event name to delete

Flags:

FlagShortTypeDefaultDescription
--versionintSchema version (required)
--server-sstringServer URL override

Output:

Deleted schema order.created (v1)

Report whether event-schema enforcement is actually enforcing anything.

Enforcement is opt-in and off by default, and it has several ways to accept every payload without validating it. From outside, all of them look exactly like “every payload was clean”: an operator sets IRONFLOW_EVENT_SCHEMA_ENFORCEMENT=reject, sees zero rejections, and cannot tell which they are in. This command tells them apart (#1958).

Terminal window
ironflow event schema check [event-name] [flags]

Arguments:

ArgumentRequiredDescription
event-nameNoReport on one event name only (default: every schema)

Flags:

FlagShortTypeDefaultDescription
--windowint0Traffic sample window in hours (0 = default, 24)
--jsonboolfalseOutput as JSON
--server-sstringServer URL override

Verdicts:

VerdictMeaning
enforcingEvents at this version, all validated against this schema
partialSome events at this version validated against this schema
unvalidatedEvents at this version, none validated against this schema
unusedEvents of this name arrive, but at a different version
no-trafficNo events of this name in the window
permissiveThe schema compiles but accepts every payload
brokenThe stored schema does not compile; enforcement fails open

permissive is the one to read twice. A JSON Schema that compiles is not necessarily one that constrains: Draft 2020-12 treats an unrecognized keyword as an annotation, so {"foo":"bar"} is a valid schema that accepts every payload, exactly as {} does. Registering a sample payload by mistake succeeds and enforces nothing. Registration cannot reject these — {} is a legitimate permissive schema — so this report is where they surface. The check is a heuristic (it asks whether the schema rejects any of six probe documents), and it errs toward reporting permissive only when a schema really does accept every JSON type.

unvalidated means the events reached the store without being checked — because the mode was off, or the name was ungoverned at the time, or the stored schema would not compile. It is not a claim that the payloads were bad.

Output:

Enforcement mode: reject
Traffic window: last 24h
EVENT VER HASH VERDICT DETAIL
order.created 1 3f2a91c04b7e5d18 enforcing 340 events at v1 in the last 24h, all validated against this schema
order.created 2 9b1e77c2aa04f6d3 unused 340 events in the last 24h, none at v2 — they arrive at v1 (340). Version matching is exact, so this schema governs none of them.
user.signup 1 c40de9f1b2a83057 permissive schema compiles but rejects nothing — every payload satisfies it. Registering a sample payload instead of a schema looks exactly like this.

With the mode off, the table still renders and a banner says so — the verdicts then describe what would happen.

Counts are a sample of the newest matching events, not lifetime totals. When the sample hits its scan cap the header says (sampled).

Examples:

Terminal window
ironflow event schema check
ironflow event schema check order.created
ironflow event schema check --window 168
ironflow event schema check --json

Test how an event would be transformed between schema versions.

Terminal window
ironflow event upcast <event-name> [flags]

Arguments:

ArgumentRequiredDescription
event-nameYesThe event name to upcast

Flags:

FlagShortTypeDefaultDescription
--fromintSource version (required)
--tointTarget version (required)
--datastringEvent data as JSON
--data-filestringPath to JSON file with data
--jsonboolfalseOutput as JSON
--server-sstringServer URL override

Data input follows the same rules as emit (flag vs file vs stdin).

Output:

Steps applied:
FROM TO DESCRIPTION
1 2 added priority field
Result data:
{
"orderId": "123",
"customerId": "456",
"priority": "normal"
}

Examples:

Terminal window
ironflow event upcast order.created --from 1 --to 2 --data '{"orderId":"123"}'
ironflow event upcast order.created --from 1 --to 2 --data-file event.json
ironflow event upcast order.created --from 1 --to 3 --data '{}' --json