> ## Documentation Index
> Fetch the complete documentation index at: https://fliqr.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Automation Rules: Trigger Flows from Events in Fliqr AI

> Automation Rules map platform events — keywords, button clicks, tag changes, webhooks — to actions like starting a Flow or updating a contact.

Flows define what to say; Automation Rules define when to say it. A rule listens for a specific event and, when that event fires, executes one or more actions — starting a Flow, sending a message, tagging a contact, or assigning a conversation to a team member. Without rules, your Flows sit idle. This page explains every trigger and action type, how to layer conditions onto rules, and how to avoid common configuration mistakes.

## Overview

Rules are evaluated top-to-bottom every time an event occurs. Fliqr AI checks each enabled rule in sequence and executes the first one whose trigger and conditions match. This means:

* Rule order determines priority.
* A contact who matches rule #2 never reaches rule #3 if rule #2 fires.
* The **Default Reply** is a special rule that runs only when no other rule matches.

This evaluation model keeps rules predictable but requires careful ordering when multiple rules share similar triggers.

## Trigger Types

| Trigger                        | Fires when…                                                                        |
| ------------------------------ | ---------------------------------------------------------------------------------- |
| **Keyword match**              | An inbound message contains a specified word or phrase (exact, contains, or regex) |
| **Button / Quick Reply click** | A contact taps a button with a specific payload value                              |
| **New contact**                | A new contact subscribes on any channel, or a specific channel                     |
| **Tag applied**                | A tag is added to a contact's record                                               |
| **Custom field value set**     | A CUF is written to (any write, or only when the value equals a specific string)   |
| **Inbound message (any)**      | Any message arrives from a contact — useful for session-opener logic               |
| **Scheduled time**             | A fixed date/time or a recurring schedule (daily, weekly)                          |
| **Webhook event**              | An external system posts a payload to a Fliqr AI webhook URL                       |

### Keyword match tips

Keyword triggers support three matching modes:

* **Exact** — the entire message equals the keyword (case-insensitive). Use this for menu selections.
* **Contains** — the keyword appears anywhere in the message. Useful for common intents like "price" or "hours".
* **Regex** — full regular expression matching for complex patterns (e.g., order IDs, phone numbers).

## Action Types

Each rule can execute one or more actions in sequence:

| Action                    | Effect                                                                    |
| ------------------------- | ------------------------------------------------------------------------- |
| **Start a Flow**          | Triggers a published Flow for the matching contact                        |
| **Send a message**        | Delivers a one-off text, image, or template message                       |
| **Apply / remove tag**    | Updates the contact's tag list                                            |
| **Set custom field**      | Writes a static value to a CUF                                            |
| **Assign to team member** | Routes the conversation to a specific agent or team inbox                 |
| **Send notification**     | Sends an internal alert to a team member via email or in-app notification |

## Conditions

You can narrow any rule with one or more conditions evaluated before the action fires. Conditions use AND/OR logic and can test:

* **Tag** is / is not present
* **Custom field** equals / contains / is greater than / is less than / is empty
* **Channel** is (WhatsApp, Instagram, etc.)
* **Contact created** before / after a date

\[SCREENSHOT: Automation rule editor with trigger type dropdown, condition builder, and action selector]

Conditions let you reuse the same keyword trigger for different audiences. For example, a "pricing" keyword rule with condition `tag is customer` can send an upgrade Flow, while a second "pricing" rule without that condition sends a lead-capture Flow.

## The Default Reply

The Default Reply is the fallback rule that fires when no other rule matches an inbound message. Every channel should have one configured. Its most common uses are:

* Handing the contact off to an AI Agent for open-ended handling.
* Sending a holding message ("We received your message and will respond shortly") while a team member reviews.
* Directing the contact to your main menu Flow.

<Warning>
  Leaving the Default Reply unconfigured means contacts who send messages that match no rule receive no response. On channels like WhatsApp and Instagram, this creates a poor experience and can negatively affect your messaging quality rating. Always configure a Default Reply before going live.
</Warning>

## Steps: Create an Automation Rule

<Steps>
  <Step title="Go to Automation">
    In the left sidebar, click **Automation**. The list shows all existing rules in their current evaluation order.
  </Step>

  <Step title="Add a new rule">
    Click **Add Rule**. A rule editor opens with trigger, condition, and action panels.
  </Step>

  <Step title="Select a trigger">
    Choose the trigger type from the dropdown. For keyword triggers, enter the keyword and select the match mode (exact, contains, or regex). For webhook triggers, copy the generated webhook URL to paste into your external system.
  </Step>

  <Step title="Add conditions (optional)">
    Click **Add Condition** to restrict when the rule fires. Combine multiple conditions with AND (all must be true) or OR (any must be true).
  </Step>

  <Step title="Choose an action">
    Click **Add Action** and select the action type. If you choose **Start a Flow**, select the published Flow from the dropdown. You can chain multiple actions — for example, apply a tag and then start a Flow.
  </Step>

  <Step title="Save and enable">
    Click **Save**. The rule is created in a disabled state. Toggle it on to activate it. Drag rules in the list to reorder them — the rule at the top is evaluated first.
  </Step>
</Steps>

<Tip>
  Rule order matters — rules are evaluated top-to-bottom and the first matching rule wins. Put your most specific rules (keyword + condition) above your broad rules (any inbound message). Place the Default Reply last in the list — it should only fire when nothing else matches.
</Tip>

<Note>
  Rules run only on channels that the trigger applies to. A keyword rule set to WhatsApp only will not fire when the same contact messages via Instagram. If you want channel-agnostic rules, leave the channel filter blank.
</Note>

## What's next

<CardGroup cols={2}>
  <Card title="Flows" icon="diagram-project" href="/docs/core-concepts/flows">
    Build the Flows that your Automation Rules will trigger when events fire.
  </Card>

  <Card title="Pipelines" icon="columns-3" href="/docs/core-concepts/pipelines">
    Automatically move contacts into sales or support pipeline stages when rules fire.
  </Card>
</CardGroup>
