Build a Workflow
Learn how to build a Novu Workflow
This is where you can find and manage your existing workflows.
This will open the initial workflow creation screen. Here you define:
- Name of the workflow
- This is also referred to as the workflow
Identifier
- This is also referred to as the workflow
- Tags (optional)
- Description of the workflow (optional)
Once you've filled in the required fields, click on Create Workflow.
This is where you can start adding steps to your workflow. The first step will always be the "Workflow Trigger".
You can add the following steps by clicking on + which is the add step icon :
Channels
- In-app
- Push
- Web push
- Mobile push
- Chat
- Enterprise messaging platforms (e.g. Slack, Microsoft Teams, etc.)
- Consumer messaging tools (e.g. WhatsApp, Telegram, Discord, etc.)
- SMS
If a channel step you've added is not configured in your Novu account, you'll see an Error.
Actions
- Digest
- Delay
- Custom (Coming soon, currently only available in the Novu Framework)
Each step in the workflow requires a template that defines the notification or message content and payload. The editor enables you to preview the rendered output of your content.
Content creation and templates
- Each channel step has its own template configuration options, tailored to the limitations and requirements of the specific channel.
- The editor provides a live preview to show how the final message will appear.
- You can use system variables for personalization, including:
- Subscriber variables: firstName, lastName, email, phone, avatar.
- Actor variables: for details about the event initiator.
- Step variables: for data specific to the workflow execution.
- Brand variables: for aligning with your organization's visual identity.
- Tenant variables: for organization-specific data.
Dynamic content
- Inject dynamic data into your templates using payload variables.
- These variables can be utilized in message content, subjects, and sender names for enhanced personalization.
Important: When using dynamic content with payload variables, ensure that the required payload is passed when triggering the workflow.
Once you've finished configuring your template, don't forget to click the Save step
button to apply your changes.
There are three main ways to trigger a workflow:
- Via the Novu Dashboard
This method is ideal for conducting quick tests directly from the Dashboard. It's a simple and convenient way to verify basic functionality. - Using the trigger code snippet
Copy the code snippet and execute it in your local environment or an online sandbox. This approach allows for more thorough testing, enabling you to integrate the trigger with your application logic and live data for a realistic evaluation. - Integrating the trigger in your application
Once all tests are complete, you can implement the trigger method directly in your application. This allows you to test the workflow in a real-world scenario, ensuring it functions seamlessly with your app's actual environment and users.
Novu operates in a multi environment setup, with the currently available environments:
- Development: Acts as a staging and test environment, where your non-technical peers can view and modify controls.
- Production: For triggering workflows to your customers.
After you've tested your workflow in the Development environment, you can promote it to Production.
Manage payload schema
The Payload Schema in Novu allows you to define, manage, and validate the structure of incoming data for each workflow. By creating a schema, you ensure that dynamic payloads sent to workflows are predictable, type-safe, and consistent across environments.
With a defined schema in place, you can:
- Prevent unexpected runtime errors caused by invalid or missing data.
- Build reliable conditional logic using type-aware operators.
- Generate accurate previews powered by intelligent mock data.
- Enable autocomplete suggestions when referencing payload variables.
The schema acts as a contract between your systems and Novu, ensuring that every payload sent into your workflow conforms to expected rules. It provides your team with clear visibility into which variables exist, how they’re structured, and what validations are applied.
Payload schemas are especially useful when building complex workflows that rely on dynamic content, reusable blocks, or strict validation requirements.
Define workflow schema
You can define the expected payload schema in three ways: manually, by importing a JSON sample, or by creating inline variables. When adding or editing a schema property, you can mark it as required.
If a property is marked as required, then it must be included in the payload when triggering the workflow using novu.trigger()
.
Add Schema properties manually
You can manually define each property in your payload by specifying:
- Property name (It must be a string)
- Property type (string, integer, number, boolean, enum, array, object, null)
Each property you define becomes part of the payload schema, and helps Novu suggest accurate variables when configuring channels steps or digest actions.
Import from JSON
If you already have a sample payload, then you can quickly define the schema by importing it as a JSON object. Novu infers property names, types, and structures for you.
Create an inline variable
When referencing a variable that doesn’t exist in the schema (for example, payload.title
) while editing a workflow step, follow these steps:
- Novu will prompt you to create the variable inline.
- Click Insert to add the variable to your schema with a default type of string.
- (Optional) After insertion, edit the variable in the manage schema tab. You can:
- Changing its type.
- Marking it as required.
- Adding validation rules.
Enforce schema validation
Schema validation is enabled on a per-workflow basis. When active, Novu validates incoming payloads against the schema when the workflow is triggered.
This means:
- Missing required properties will cause the request to fail.
- Data types must match exactly. For example, a string cannot be passed where a number is expected.
- Invalid values are rejected before the workflow executes.
This validation is applied at the HTTP trigger level, and prevents invalid data from entering the workflow entirely.
Schema configuration options
When defining a schema property, the available configuration fields vary depending on the selected type.
General fields (for all types)
- Property name
- Property type
- Required property checkbox
- Default value – Optional fallback if no value is provided
- Min length and max length
Type-specific configuration
Depending on the selected type, additional configuration options appear:
- String:
- Format: None, date-time, date, time, duration, email, hostname, ipv4, ipv6, uuid, uri-reference, uri-template, json-pointer, relative-json-pointer, regex
- Pattern: Regex-based validation
- Enum: Add choices, which are a list of predefined, allowed values. This restricts the field to only those values.
- Array: Select the Array item type, which defines the data type of each array element.
- Object: Add nested properties, each with their own type, required status, and validation options.