docs/framework/schema/zod.mdx
Novu Framework allows you to use Zod to define the Control and Payload schemas for your workflows. (Supports Zod v3)
<Note>
Novu Framework supports Zod v3. Make sure you're using this version for optimal performance and feature support.
</Note>
</Step>
<Step title="Use Zod in your workflow">
```typescript
export const testWorkflow = workflow('test-workflow', async ({ step, payload }) => {
await step.email('send-email', async (controls) => {
return {
subject: controls.subject,
body: 'Hello World',
};
},
{
controlSchema: z.object({
subject: z.string().default('A Successful Test on Novu from {{userName}}'),
}),
});
}, {
payloadSchema: z.object({
userName: z.string().default('John Doe'),
}),
});
```
</Step>
When you define a controlSchema for a step, Novu will automatically generate a UI for the controls in the workflow editor.
string, number, boolean, and enum and array types.min, max, email, url, regex and etc...