## Overview

An **automation rule** runs actions automatically when an event happens and the conditions you set
are met. It's the most direct way to remove repetitive work: assigning conversations, adding labels,
sending messages, resolving conversations, moving CRM deals, or notifying external systems via
webhook.

Every rule follows the structure **trigger → conditions → actions**:

- **Trigger**: the event that starts the evaluation (for example, "conversation created").
- **Conditions**: filters that must be true for the rule to act.
- **Actions**: what the platform does when the trigger fires and the conditions pass.

## Prerequisites

- Admin permission to access the Automation area under Settings.
- At least one inbox with conversations, so triggers have something to evaluate.
- For actions that depend on other modules (CRM, Catalog, Tasks, Follow-ups), the matching module must
  be enabled on the account.

## Step by step

1. Under Settings, open the **Automation** area and create a new rule.
2. Give the rule a clear **name** and description.
3. Choose the **trigger** (event). The main ones are:
   - **Conversation created**, **Conversation updated**, **Conversation resolved**, **Conversation
     opened**;
   - **Message created** (incoming or outgoing);
   - CRM, Catalog, and Task events when those modules are active.
4. Add **conditions**. Combine fields (status, priority, inbox, labels, browser language,
   contact/conversation attributes, CRM fields) with operators such as **equal to**, **not equal to**,
   **contains**, or **does not contain**.
5. Define one or more **actions** (see the list below).
6. **Save** and activate the rule. Test with a real conversation to confirm the behavior.

## Settings & options

Available actions (they vary by trigger and active modules):

| Action | What it does |
| --- | --- |
| Assign agent | Routes the conversation to a specific agent. |
| Assign team | Routes the conversation to a team. |
| Add label | Tags the conversation with one or more labels. |
| Send message | Sends a message to the contact. |
| Send email to team | Notifies the team by email. |
| Send transcript by email | Emails the conversation history. |
| Mute conversation | Mutes the conversation. |
| Resolve conversation | Closes the conversation automatically. |
| Send attachment | Attaches a file to the conversation. |
| Fire webhook | Sends the event to an external endpoint. |

When the modules are active, module-specific actions appear: move a deal between stages, assign and set
value/priority in the **CRM**, add a product to a deal in the **Catalog**, create tasks, and enroll the
contact in a **Follow-ups** sequence.

- **"AND" conditions**: every condition must be true for the rule to act.
- **Order**: actions run in the order they appear in the rule.
- **Enable/disable**: you can pause a rule without deleting it.

## Use cases

- **Channel routing**: conversations created on the sales WhatsApp go to the Sales team.
- **Keyword triage**: if the message contains "invoice", add the "billing" label.
- **After hours**: when a conversation is created outside business hours, send an automatic message.
- **Queue hygiene**: resolve conversations with no reply for a long time and notify the team.
- **CRM**: when a lead's conversation is created, create a deal and assign it to the right rep.

## Tips, limits & best practices

- Use descriptive names and keep each rule focused on a single goal.
- Avoid **conflicting rules** that try to do opposite things on the same conversation.
- For actions that send automatic messages, respect channel limits (WhatsApp anti-ban best practices).
- Test in a sandbox inbox before applying the rule to production.
- Document for the team what each rule does — it makes future maintenance easier.

## Troubleshooting

- **The rule didn't fire**: confirm the trigger and that **all** conditions are true; check the rule is
  active.
- **The action didn't run**: verify the referenced agent, team, or label still exists; and that the
  action's module (CRM, Catalog, etc.) is enabled.
- **The rule acted on the wrong conversation**: the conditions are too broad. Refine the filters.
- **The webhook didn't arrive**: check the endpoint URL and that it responds successfully.

## See also

- [Automation & Flows overview](/hc/ajuda/articles/automation-flows-overview-en)
- [Macros: reusable actions](/hc/ajuda/articles/automation-flows-macros-en)
- [Flow Builder: visual conversational flows](/hc/ajuda/articles/automation-flows-flow-builder-en)
- [Smart Routing](/hc/ajuda/articles/automation-flows-smart-routing-en)