Go to App
← Back to Documentation

Notification Routing

Flexible routing rules that determine which notifications go to which recipients based on event type, severity, and branch scope.

Event Matching

Routes match events based on type (obligation_due, ssl_expiry, etc.) and minimum severity threshold.

Branch Scope

Routes can be global (all branches) or branch-specific. Allows different alert destinations per location.

Connector Targeting

Each route specifies a connector (Email, Telegram, etc.) and recipient reference (email, chat_id, etc.).

Severity Levels

Routes use minimum severity thresholds. Events at or above the threshold will be sent through the route.

LowInformational, digest-worthy
MediumAction needed within lead time
HighUrgent, due or expiring soon
CriticalImmediate attention required

Route Configuration

interface NotificationRoute {
  id: uuid;                    // Route identifier
  tenantId: uuid;              // Organization
  branchId: uuid | null;       // Specific branch or all
  connectorId: uuid;           // Channel to use
  eventType: NotificationEventType;  // Event filter
  severityMin: Severity;         // Minimum severity
  recipientRef: string;        // Email, chat_id, webhook URL
  isActive: boolean;            // Enable/disable
}

Example Routing Rules

RuleConditionActionScope
Critical Alerts to ManagementSeverity = CriticalSend to Head Office Admin via Email + TelegramAll branches
SSL Failures to IT TeamEvent Type = SSL FailureSend to SSL recipients via EmailAll branches
Branch Manager AlertsEvent Type = Obligation DueSend to Branch Manager via preferred channelSpecific branch
Weekly DigestEvent Type = DigestSend summary to all usersAll branches

Route Resolution Algorithm

1. Event Occurs
System generates event with type and severity
2. Find Matching Routes
Query routes where: eventType matches AND severityMin <= event severity
3. Filter by Branch
Include routes with matching branchId OR global routes (branchId = null)
4. Create Deliveries
For each matching route, create a delivery via the connector

Routing Best Practices

  • Create severity-based tiers: Critical alerts to management, routine to operators
  • Use multiple channels: Critical alerts via Email + Telegram for redundancy
  • Branch-specific routes: Route branch issues to respective managers
  • Test connectors first: Verify connector health before creating routes