Add Zod to your project
Install Zod Packages
zod-to-json-schema package to generate JSON schemas from your Zod definitions.Controls and Payload UI
When you define acontrolSchema for a step, Novu will automatically generate a UI for the controls in the workflow editor.
- Form Input Title - Will be derived from the key of the Zod schema. Unfortunately Zod does not support custom titles at this point.
- Form Input Type - Will be derived from the Zod schema type, with support for
string,number,boolean, andenumandarraytypes. - Default Value - Will be derived from the Zod schema default value.
- Validation - Will be derived from the Zod schema validation rules, including
min,max,email,url,regexand etc…