Best Practices
Designing the workflow itself (channels, severity,critical, digest, conditions, templates)? Seedesign-workflow/. This file covers trigger-side best practices only — idempotency, retries, payload design, and topic vs bulk choice.
Idempotency
transactionId is unique to each workflow trigger (event). Novu generates unique transactionId if not provided during trigger. It can be used for idempotennt workflow run and to cancel the pending workflow run later
Error Handling
Retry Strategy
For transient failures (5xx errors, network timeouts), use exponential backoff:401— Invalid API key404— Workflow not found422— Payload validation failure
Payload Design
- Keep payloads small — include IDs and references, not full objects
- Use the workflow’s
payloadSchemato enforce structure - Avoid sensitive data in payloads (they may be logged/stored)
Topic vs. Bulk Triggers
| Use Case | Approach |
|---|---|
| Same notification to a group | Topic trigger |
| Different payloads per subscriber | Bulk trigger |
| All subscribers in the environment | Broadcast |
| More than 100 unique events | Chunked bulk triggers |