- Each tenant has its own email or SMS provider account.
- You use different sender credentials for different locales or subscriber plans.
- A chat connection, such as Slack or Teams, should only receive messages for a specific tenant.
Add conditions in the dashboard
- Go to Integrations and open an integration, or add a new one.
- In the side panel, click Integration conditions.
- Add your rules using AND and OR groups, then click Done.
- Save the integration.
An integration with conditions can’t be the primary integration. Saving conditions removes the primary flag, and marking an integration as primary removes its conditions. For email and SMS, keep one primary integration without conditions so Novu has something to fall back to.
How Novu picks the integration
Novu checks conditions at the moment the step sends a message, not when you save the integration. The behavior depends on the channel.Email and SMS
Email and SMS send through one integration per message. Novu picks it in this order:- If the trigger passes
integrationIdentifierinoverrides.emailoroverrides.sms, Novu uses that integration. Conditions aren’t checked at all for that step, including any conditions on the integration you passed. - If the trigger doesn’t pass
integrationIdentifier, Novu goes through the active integrations that have conditions, starting with the highest priority. When two have the same priority, the newer one goes first. The first integration whose conditions match sends the message. - If no conditions match, Novu uses the primary integration.
sendgrid-acme doesn’t exist or isn’t active, Novu doesn’t fall back to conditions or the primary integration. The step fails, and the activity feed shows that no active integration was found.
For more on passing an integration in overrides, see Targeting a specific provider for email and Target a specific provider for SMS.
Chat and push
Chat and push can send through more than one integration for the same subscriber, so there’s no single integration to pick and no primary fallback. For chat connections stored as channel endpoints, such as Slack, Teams, and Telegram, Novu checks each integration before sending. Endpoints on integrations without conditions always receive the message. Endpoints on integrations whose conditions don’t match are skipped. If every integration has conditions and none match, nothing is sent. For push, and for older chat setups where the webhook URL or token is saved on the subscriber, Novu sends through whichever integration holds those credentials. Conditions on that integration don’t stop the send. If you don’t want a tenant to receive push or chat through an integration, don’t save their credentials on it. PassingintegrationIdentifier in the email or SMS overrides has no effect on chat. Chat endpoints still go through their own condition checks.
What conditions can use
Conditions can read subscriber, context, and workflow data. They can’t use payload values or results from earlier steps. If you need those, use step conditions instead. Integrations that already hadpayload.* rules saved before this change will keep working, but you can’t add new ones.
These fields are available in the dashboard:
You can also use other
context.* and subscriber.* paths, like context.tenant.data.plan or subscriber.data.region. Payload paths and workflow.* fields not listed above are rejected.
To set context.tenant.id, pass a tenant in the trigger’s context:
"acme-corp" or { id: "acme-corp" } both set context.tenant.id to acme-corp. See Contexts and Multi-tenancy for more.
Example: a separate email provider for one tenant
Say your default email provider is SendGrid, and your customer Acme wants their emails sent from their own account.- Keep your default SendGrid integration active and primary, with no conditions.
- Add a second email integration using Acme’s credentials. Don’t make it primary.
- Open Integration conditions on the Acme integration and add
context.tenant.idequalsacme-corp. - Trigger your workflow with
context: { tenant: "acme-corp" }. Those emails go through Acme’s integration, and everything else goes through your default SendGrid integration.
Manage conditions with the API
Conditions are saved as JSON Logic in the integration’srules field. You can set rules when you create or update an integration with the Integrations API.
workflow.* fields are rejected.
Updating an integration with rules removes its primary flag and replaces any older conditions. Creating an integration is different. If it’s the first active email or SMS integration in the environment, Novu can still make it primary even if you pass rules. When that happens and the rules don’t match, Novu still sends through it as the primary fallback. To avoid this, create your primary integration first without conditions, then add the integrations that have conditions.
Related
Integrations
How integrations, primary, and active flags work
Step conditions
Skip or run workflow steps based on payload and subscriber data
Contexts
Pass tenant and other context on the trigger
Multi-tenancy
Isolate Inbox, preferences, and providers per tenant