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

# Setting up Automation Rules

> Guide to set up automation rules in Periskope

## Components

Automation rules consist of three main components that need to be set up:

1. Triggers
2. Conditions
3. Actions

## Setting up Automation Rules

**1. Add new rule**

1. Go to the Automation Rules page in Periskope.

![Automation Rules](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/automationrulesetup.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=82735b63fe6f1ab18c2478e96ae5af19)

Automation Rules

2. Click on the "+ New Rule" button. You can also add a rule by pre-filled templates available on the screen.

![Automation Rules](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/rulesetupnew.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=ad567e3de8177c95e2cf3086ac7f0f44)

New Rule

A total of 18 different preset templates that can be set up in just a few minutes, divided into 6 buckets:

1. Automated Ticketing
2. Automated Replies
3. Automated Assignments
4. Automated Flagging
5. Automated Escalation
6. Automated Notifications

![Automation Rules](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/PopularTemplates.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=dc107610ee066ba77c1052d641bd0a4b)

Automation Rule Templates

**2. Add Rule name**

On the top of the rule setup page, add a name for the rule.

![Automation Rules](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/AutomationRuleName.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=f4ac61ed7423ccd7ad02c30fe39294c3)

Set up a Name

**3. Choose a Trigger**

In the "Trigger" section, select the event from the window that will initiate the rule. For example, "New Message Received."

![Automation Rules](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/AutomationRuleTrigger.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=326143bb4f23e45215572b2ff49f3795)

Available triggers

**4. Add conditions**

Define the conditions that must be met for the rule to execute. You can add multiple conditions using logical operators like AND, OR, and nested conditions.

![Conditions](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/AutomationRuleConditions.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=081f855472f690798dc340b8ba6e72a2)

Choose Condition(s)

> [!NOTE]
>
> You can also add `delays` before evaluating the conditions to allow for time-based criteria.

![Conditions](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/AutomationRuleConditionTime.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=1fb8a3a41a342958ceb1bb9c045a318b)

> [!TIP]
>
> For example, you can create a condition that checks if the message contains specific keywords and is received from a specific user.

**5. Add actions**

Specify the actions that will be executed when the conditions are met. You can add multiple actions and set delays for each action.

![Actions](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/AutomationRuleActions.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=60af023b69aa9a5a0d9508634e42b218)

Actions

**6. Save and Publish**

Save the rule and publish it to start automating the workflow.

![Automation Rules](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/AutomationRuleSavePublish.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=08b73b2a93c77668d26e4ddd0a694a71)

Save & Publish

## Example: Automated replies on message with keywords (urgent, important) 📃

Let's consider an example of setting up an automation rule:

**Scenario**: Automatically send a message if a new message is received and contains certain keywords.

**1. Define the Trigger**

1. Select "New Message Received" as the trigger.

**2. Set the Conditions**

Define a condition: Check if the message contains specific keywords, e.g., urgent, help.

Use logical operators if needed: For example, message contains 'urgent' OR 'important'.

Optionally, set a delay before checking the condition (e.g., 5 minutes).

![Conditions](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/ExampleConditions.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=f4316d4160830fbab84cdbe3180e81c6)

Choose Condition(s)

**3. Add Actions**

Select the action: 'Send Message' Action.

Specify the message to send, such as: "We have received your message and are processing your request."

Optionally, add a delay for when the action should be executed; and even some form of media (Image, Video, Document or Audio)

![Conditions](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/ExampleActions.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=9045fedb31cbd6eed773264151976783)

Set up Action

**4. Finish**

Save the rule and activate it to start automating the workflow.

### Final Rule:

* **Trigger**: When `New Message Received`
* **Conditions**: If message contains `urgent` OR `important`
* **Action**: Then send a message "We have received your message and are processing your request."

![Conditions](https://mintcdn.com/bharatkumarramesh/n6-6KkopVbLMcGqC/images/ExampleSavePublish.png?fit=max\&auto=format\&n=n6-6KkopVbLMcGqC\&q=85\&s=104dcf6f925e73d7ddfe1735c2a72ae6)

Save & Publish


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.