Skip to main content
See also: Triggers REST API reference for request/response shapes, status codes, and error semantics.

Overview

Triggers enable event-driven automation in KaireonAI. When a customer event occurs — a transaction, a profile update, a behavioral signal — a trigger can automatically enroll the customer in a journey, fire a real-time recommendation, call an external webhook, or update customer attributes.

How Triggers Work

  1. An event arrives from a connected data source (streaming connector, API call, or schema update)
  2. The trigger rule matches events by type and optional filters
  3. Conditions are evaluated to determine if the trigger should fire
  4. The configured action is executed

Runtime Behavior

When an event is received, the engine performs the following sequence:
  1. Event matching — All active trigger rules with a matching eventType are retrieved, ordered by priority (descending).
  2. Condition evaluation — For each matching trigger, the condition object is evaluated against the event payload. Conditions support nested all (AND) and any (OR) groups with field-level operators (eq, neq, gt, gte, lt, lte, in, exists).
  3. Cooldown check — If the trigger has a cooldownMs value greater than zero, the engine checks whether the same trigger has already fired for this customer within the cooldown window. If it has, the trigger is skipped.
  4. Action dispatch — If all conditions pass and the cooldown has not been exceeded, the configured action is dispatched (journey enrollment, recommend call, webhook POST, or attribute update).
  5. Audit logging — Every trigger firing is recorded in the audit log with the trigger ID, customer ID, event type, and action taken.
Multiple triggers can match the same event. They are evaluated in priority order, and each fires independently as long as its own conditions and cooldown are satisfied.

Event Types

Triggers listen for events from your connected data sources:

Action Types

enroll_journey

The deduplication option prevents enrolling a customer who is already active in the same journey. Options: skip_if_active (default), restart, allow_multiple.

fire_recommend

webhook

update_attribute

Cooldown Mechanics

Each trigger has a configurable cooldown period (cooldownMs, in milliseconds) to prevent rapid re-firing for the same customer. How cooldown works:
  1. When a trigger fires for a customer, the engine records the firing timestamp.
  2. On the next matching event for the same customer, the engine checks if now - lastFiredAt < cooldownMs.
  3. If the cooldown has not elapsed, the trigger is silently skipped for that customer. The event is not queued for later — it is dropped.
  4. The cooldown is per-customer, per-trigger. Customer A’s cooldown does not affect Customer B.
Without a cooldown, high-frequency events (e.g., page views, transaction streams) can cause a trigger to fire hundreds of times per customer. Always set an appropriate cooldown.

Priority

When multiple triggers match the same event, they are executed in priority order:

Worked Example

A retail bank wants to trigger a real-time recommendation whenever a customer completes a purchase over $500:
1

Event arrives

The Respond API records an outcome.recorded event for customer cust_78 with outcomeType: "conversion" and metadata.amount: 750.
2

Trigger matches

The engine finds the “High-Value Purchase” trigger with eventType: "outcome.recorded" and priority: 75.
3

Condition evaluates

The trigger’s condition is checked: { "all": [{ "field": "metadata.amount", "operator": "gt", "value": 500 }] }. The event’s amount (750) is greater than 500, so the condition passes.
4

Cooldown check

The trigger has cooldownMs: 86400000 (24 hours). The last firing for cust_78 was 3 days ago, so the cooldown has elapsed.
5

Action dispatches

The fire_recommend action executes Decision Flow df_cross_sell with channelId: "ch_push" and maxOffers: 1. The customer receives a personalized push notification with a cross-sell offer.

Field Reference

Condition Operators

Creating a Trigger

1

Navigate to Triggers

Go to Studio > Triggers in the sidebar.
2

Click Create Trigger

Click the + New Trigger button.
3

Name and describe

Enter a name and description for the trigger.
4

Select event type

Choose the event type that will activate this trigger.
5

Define conditions (optional)

Add filter conditions to narrow when the trigger fires (e.g., metadata.amount > 500).
6

Select action type

Choose the action: enroll in journey, fire recommendation, call webhook, or update attribute.
7

Configure action

Fill in the action-specific configuration (journey ID, Decision Flow, webhook URL, etc.).
8

Set cooldown and priority

Configure the cooldown period and execution priority.
9

Save and enable

Save the trigger. Toggle it to enabled when ready.

API Reference

Create a Trigger

Request body:
Response (201 Created):

List Triggers

Query parameters:

Update a Trigger

Delete a Trigger

Enable/Disable a Trigger

Use the update endpoint to change a trigger’s status:
Allowed status transitions: active to paused or disabled, paused to active or disabled, disabled to active.

Next Steps

Journeys

Build multi-step workflows that triggers can enroll customers into.

Runs

Execute Decision Flows in batch for campaign delivery.