Automation Rules
What it is
Automation Rules are the event-driven processing engine of the BotBat CDP. Each rule follows a straightforward pattern: when a specific event occurs and certain conditions are met, one or more actions execute automatically. Rules operate in real time. As events stream into the CDP from websites, mobile apps, messaging channels, and API integrations, the rules engine evaluates each event against all active rules and fires matching actions immediately. This enables powerful use cases such as automatically updating profile properties, adding contacts to segments, sending real-time notifications, triggering multi-step workflows, applying labels, and maintaining data hygiene, all without any manual intervention.
The rules engine processes events sequentially according to rule priority. When multiple rules match the same event, they execute in priority order (lower number equals higher priority). This deterministic ordering ensures predictable outcomes even in complex rule configurations where one rule's output may affect another rule's conditions. Rules can be toggled between active and inactive states, allowing you to prepare rules in advance and activate them at the right moment.
The Rules tab provides an overview of all rules in your workspace, showing each rule's name, trigger event type, active/inactive status, and the date it last fired.

When to use
Automation rules are appropriate whenever you need the CDP to react to events in real time without human involvement. The following table outlines the most common use cases.
| Use Case | Description | Example |
|---|---|---|
| Auto-enriching profiles | Automatically set or update a profile property when a specific event occurs. | Set "last_purchase_date" whenever a "purchase_completed" event is recorded. |
| Real-time notifications | Alert a team member or channel instantly when a high-value event is detected. | Notify the sales Slack channel when a VIP customer visits the pricing page. |
| Automating segment membership | Add or remove profiles from segments based on specific customer actions. | Add a profile to the "Engaged Users" segment when they click a campaign link. |
| Enforcing data quality | Normalize and clean data in real time as it flows into the CDP. | Lowercase all email addresses and format phone numbers to E.164 on profile update events. |
| Triggering workflows | Kick off multi-step workflow sequences in response to a customer action. | Start a welcome email sequence when a "signup_completed" event fires. |
| Lead scoring | Increment or adjust a lead score each time a customer performs a qualifying action. | Add 10 points to the lead score for a "demo_request" event, 2 points for a "page_view." |
Creating a rule
To create a new rule, navigate to the Customers section in the main sidebar and select the Rules tab. Click "New Rule" and provide a descriptive name that reflects the rule's purpose. A good naming convention follows the pattern "[Event] / [Action] / [Context]," such as "purchase_completed / Set VIP label / Orders over $500." This makes it easy to scan the rules list and understand what each rule does without opening it.
Defining the trigger event
The first step in rule configuration is selecting the trigger event. This is the event type that causes the rule to be evaluated. BotBat provides a set of built-in event types, and you can also select any custom events that have been registered in your workspace.

The following table lists the most commonly used built-in event types.
| Event Type | Description |
|---|---|
page_view | Fired when a tracked customer visits a page on your website or web app. |
message_sent | Fired when a message is sent to or from a customer on any channel. |
link_clicked | Fired when a customer clicks a tracked link in a campaign message. |
form_submitted | Fired when a customer submits a tracked web form. |
purchase_completed | Fired when a purchase or transaction event is recorded for a customer. |
session_started | Fired when a new browsing or app session begins for a tracked customer. |
| Custom events | Any event type registered through the Events API or SDK integration. |
Adding conditions
Conditions are optional filters that narrow when the rule fires. Without conditions, the rule fires for every occurrence of the trigger event across every profile. Conditions can check event properties (e.g., event.amount > 100), profile properties (e.g., profile.plan = "premium"), or segment membership (e.g., "profile is in VIP Customers segment"). Multiple conditions can be combined with AND/OR logic for precise targeting.

Configuring actions
Actions define what happens when the rule fires. You can attach one or more actions to a single rule. Each action type serves a different purpose.

| Action Type | What It Does |
|---|---|
| Update profile property | Set, increment, decrement, or clear a property value on the profile. |
| Add to segment | Add the profile to a specified static segment. |
| Remove from segment | Remove the profile from a specified static segment. |
| Send notification | Send an alert to a team member or external channel (Slack, email, in-app notification). |
| Trigger workflow | Start a specified workflow with the profile as the target contact. |
| Apply label | Add a label or tag to the profile for manual categorization. |
| Log custom event | Record a derived event on the profile for downstream processing by other rules or analytics. |
Setting priority and activating
After configuring trigger, conditions, and actions, assign a priority number to the rule. Lower numbers indicate higher priority. When multiple rules match the same event, they execute in ascending priority order. This is important when one rule's action (e.g., setting a property) affects conditions evaluated by another rule.

Toggle the rule to "Active" to begin processing. The rule starts evaluating incoming events immediately. For safety, it is strongly recommended to test the rule before activating it in production.
Testing and monitoring rules
Before enabling a rule for your full audience, use a test profile to generate the trigger event and verify that the expected actions execute correctly. Check the test profile's timeline and properties to confirm the rule behaved as intended. This step is critical because a misconfigured rule can affect thousands of profiles within seconds of activation.
Once a rule is live, monitor its performance through the execution log on the rule detail page. The log shows a chronological record of every time the rule fired, including the timestamp, the profile involved, the actions executed, and any errors encountered. Use this log to identify unexpected behavior, troubleshoot failures, and verify that the rule is processing the expected volume of events.

Common pitfalls
Automation rules are powerful but can cause unintended consequences if not designed carefully. The table below highlights the most frequent issues and their prevention strategies.
| Pitfall | Risk | Prevention |
|---|---|---|
| Infinite loops | Rule A fires an action that triggers Rule B, which fires an action that triggers Rule A again, creating an endless cycle. | Map rule dependencies before creating new rules. Avoid rules that generate events matching their own or related triggers. |
| Missing priority ordering | When multiple rules react to the same event, unpredictable execution order causes inconsistent results. | Explicitly set priorities for all rules, especially those that share a trigger event or have dependencies. |
| Overly broad conditions | A rule with no conditions beyond the event type fires on every occurrence for every profile, leading to massive unintended updates. | Always add at least one condition to limit scope, or document explicitly why a broad rule is intentional. |
| Skipping testing | A misconfigured rule can modify thousands of profiles within seconds of activation. | Test every rule with a single test profile in a controlled environment before toggling to active. |
| Stale rules | Rules created for a specific campaign or experiment remain active long after they are needed, consuming processing resources and causing unexpected side effects. | Audit active rules quarterly. Disable or delete rules that no longer serve a purpose. |
Name your rules with a consistent convention like "[Event] / [Action] / [Context]" (e.g., "purchase_completed / Set VIP label / Orders over $500"). This makes it easy to scan the rules list and understand what each rule does without opening it. Combine this with regular audits to keep your rules engine clean and efficient.
- Rules List
- Create Rule
- Rule Trigger
- Rule Conditions
- Rule Actions
- Rule Priority
- Execution Log