Step Inputs
Inputs are defined using JSON Schema, providing a strong run-time validation system for your workflows.
This ensures that you as the developer, and your non-technical peers are speaking the same language. Those responsible for styling and copy can edit with confidence, knowing their changes are tested in code.
Inputs vs Payload
Inputs - For Non-Technical Peers and Developers. Managed in the Novu Web UI, defined by developers and used by non-technical peers.
Examples - Color of a button, text of a button, should a section be shown, digest duration, static text content, the order of the email sections, and etc…
Payload Schema - For Developers. Passed during the novu.trigger
method, and controlled by the developer.
Examples - User ID, Post ID, Comment, Order ID, 2FA token and etc…
Step Inputs
Step input schema is defining the input passed during the step
method. Those inputs can be modified and persisted in the Novu Web UI.
The snippet below shows configuration for the Workflow payload schema and the Step input schema. If you don’t provide a schema, Typescript will infer the data type to unknown
, reminding you of the best practice to specify your schema.
Learn more about JSON Schema here, including the powerful validation features to ensure your Content renders perfectly, every time.
Other validators, including Zod and more, coming soon. Any validator that supports transformation to JSON Schema can be added.
JSON Schema Examples
To Learn more about advanced examples, visit our JSON Schema page.