Unify Data
Logo
Event Stream Schema

Event Stream Schema

Logo

3 mins read READ

Every event stream carries events that follow a schema you define. The schema lists the fields an event can contain, the type of data each field holds, and which field (if any) uniquely identifies an event. Automations that publish to or consume from the stream see exactly this schema, and it also determines the columns shown in the stream's logs.

Overview

You build and manage a stream's schema from its Schema tab. Each field you add needs a Key and a Field Type, and you can layer on a Display Label, help text, optionality, and conditional visibility to make the schema easier to work with. Once fields are in place, you save your changes to apply them, or discard them to return to the last saved version.

Define the fields of an event

On the Schema tab, add a field and fill in the Add New Field form: a Key, a Display Label, and a Field Type. The Key must start with a letter and can only contain letters, numbers, and underscores after that — this is the identifier automations use to reference the field, so keep it short and descriptive. The Display Label is what people see when they view the field, so it can be more descriptive or human-friendly than the Key.

If the schema is still empty, you can also click Use Code Snippet to build the schema from JSON instead of adding fields one at a time.

Available field types

Choose from String, Number, Integer, Boolean, Date, Date Time, Single Select Dropdown, Multi Select Dropdown, Object, File, and Array. You can nest fields under an existing Object field with Nest under to model structured data, mark any field except the primary key as optional with Is Optional, and add Help Text so other people understand what to enter or expect.

For Single Select Dropdown and Multi Select Dropdown fields, set Dropdown Value Type to Static to enter your own values and labels, or to Lookup to take the options from another object in Object to Lookup. With Lookup, you can also turn on Enforce Foreign Key Constraint.

Array fields

For an Array field, choose an Array Type for its elements: String, Number, Integer, Boolean, Date, Date Time, or Object.

Default value

Use Default value to set the value a field takes by default.

Set a primary key

Turn on Primary Key for one field so every event carries a unique identifier. Only identifier-like types qualify — String, Number, and Integer — so choose one of these types if you plan to use the field as the primary key. Other field types can't be set as the primary key, and a primary key field can't be optional.

Control field visibility

Beyond marking a field optional, you can use Control Visibility to make its visibility conditional on the values of other fields. This lets you keep the schema focused by showing a field only when it's actually relevant, rather than always displaying every field regardless of context.

Edit a field after creation

A field's Key and Field Type are locked once you create it — if you need a different type, create a new field instead of trying to change the existing one. Everything else stays editable: you can update the Display Label, toggle optionality, revise help text, and adjust visibility conditions whenever you need to.

Save or discard schema changes

The Save and Discard Changes buttons are at the top right of the Schema card. Both stay disabled until you actually make a change, so there's no risk of accidentally saving or discarding when nothing has changed. Save applies your edits to the schema; Discard Changes reverts everything back to the last saved state, undoing any edits you haven't saved yet.

Notes

  • A field's Key must start with a letter and can only contain letters, numbers, and underscores — plan Keys before you create fields, since you can't change one later.

  • A field's type is fixed once created. If you need a different type, add a new field rather than trying to convert an existing one.

  • Only String, Number, and Integer fields can be set as the primary key, and a primary key field can't be optional.

  • Schema changes don't take effect until you click Save — navigating away or discarding will lose unsaved edits.

FAQs

Can I rename a field after creating it?

You can't change its Key, but you can update its Display Label at any time, which is what most people see when working with the field.

Why can't I set a Boolean or Date field as the primary key?

Only identifier-like types — String, Number, and Integer — can uniquely identify an event, so those are the only types available for the primary key.