> For the complete documentation index, see [llms.txt](https://distance.gitbook.io/distance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://distance.gitbook.io/distance/getting-started/automations/setting-up-an-automation.md).

# Setting up an automation

### **Introduction**

**Automations** in Distance let your team respond to customer activity, streamline follow-ups, and reduce repetitive manual work. They can be triggered by Distance events such as form submissions, dropped calls, or contact updates, as well as supported third-party integrations like QuickBooks, and can send SMS or email messages immediately or after a configured delay.

<div data-with-frame="true"><figure><img src="/files/UJ44w3kESTY2WUbOnpIU" alt=""><figcaption></figcaption></figure></div>

This helps your business maintain consistent, timely communication across different customer touchpoints.

***

### **Creating an automation**

Go to **Automations** from the left sidebar, then click **Create** in the upper-right corner.

<div data-with-frame="true"><figure><img src="/files/5TgCysVFBcgcV8GyKb0m" alt=""><figcaption></figcaption></figure></div>

This opens the **New automation** page.

<div data-with-frame="true"><figure><img src="/files/fJTsn2boxrCJpdWwiBZd" alt=""><figcaption></figcaption></figure></div>

***

### Overview

The **Overview** section contains the **Automation name** field.

<div data-with-frame="true"><figure><img src="/files/WqrkLJCpp9cdj84KbVCa" alt=""><figcaption></figcaption></figure></div>

Use this field to enter a name for your automation so it can be easily identified later.

***

### **When this happens...**

The **When this happens...** section defines the event that triggers the automation.

<div data-with-frame="true"><figure><img src="/files/dMI4rC5eQSPXTp0Bw6X6" alt=""><figcaption></figcaption></figure></div>

You can choose between two event sources: [**Distance event**](#distance-event) and [**Integration event**](#integration-event).

#### **Distance event**

Distance events are triggered by activity that happens directly within Distance.

<div data-with-frame="true"><figure><img src="/files/OUYMdhrElOBgMXGRQDrV" alt=""><figcaption></figcaption></figure></div>

Available **Event type** options include:

* **Form submitted** - Triggers the automation when a customer submits a form through the **Contact us** option in [**Live chat**](/distance/getting-started/automations/live-chat-setup/customizing-your-live-chat.md#contact-us).
* **Call dropped** - Triggers when a call ends in Distance, including both disconnected calls and completed conversations with the AI Voice agent.
* **Contact updated** - Triggers the automation when a contact record is updated in Distance, either through manual edits, imports, or automated updates to contact information or properties.
* **Trigger enrollment** - Triggers the automation through external workflows such as Zapier-based automations. This corresponds to the **Enroll in Trigger** Action event in [**Zapier**](/distance/getting-started/integrations/setting-up-integration-with-zapier.md), which is only available when Distance is used as an **Action step** rather than a **Trigger step** in a Zap.

#### **Integration event**

Integration events are triggered by external applications connected through [**Settings** → **Integrations**](/distance/getting-started/settings/integrations-tab.md).

<div data-with-frame="true"><figure><img src="/files/TsxiCHDQv8ieHzNC8mWS" alt=""><figcaption></figcaption></figure></div>

When **Integration event** is selected, the following dropdowns appear:

* **Integration** - Select the connected third-party platform that will trigger the automation.
* **Event** - Select the specific activity or event from that integration that should trigger the workflow.

Currently, only **QuickBooks** integrations are supported with the following Event options:

* **New estimate**
* **New invoice**
* **Invoice updated**
* **Invoice emailed**
* **Payment received**

These events correspond to activity generated directly within QuickBooks. For example, the automation can trigger when a new invoice is created, when an invoice is emailed to a customer, or when a payment is successfully recorded.

The **View integrations** opens the [**Settings** → **Integrations**](/distance/getting-started/settings/integrations-tab.md) page, where you can manage connected platforms.

<div data-with-frame="true"><figure><img src="/files/j211jWdYMsq7FrvLJSBA" alt=""><figcaption></figcaption></figure></div>

***

### **...send these messages**

The **...send these messages** section controls the messages and communication steps included in the automation.

<div data-with-frame="true"><figure><img src="/files/z3Wlop7pRupQsmXhREnR" alt=""><figcaption></figcaption></figure></div>

This section also includes the **Generate with AI** button for creating or refining messages automatically. For more information, see [**Generate with AI (Recommended)**](#generate-with-ai-recommended).

Each automation step contains the following fields:

#### **Message via**

Select whether the automation step should send the message through **SMS** or **Email**.

<div data-with-frame="true"><figure><img src="/files/Wged65MbglqI38pPLdKy" alt=""><figcaption></figcaption></figure></div>

#### **Send timing**

Choose whether the message should be sent **Immediately** or **After a delay**.

<div data-with-frame="true"><figure><img src="/files/FvtxevfvVgrlpzfI4hYg" alt=""><figcaption></figcaption></figure></div>

Delayed messages can be configured to send after a specified amount of time (**Seconds**/**Minutes**/**Hours**/**Days**) following the trigger event.

<div data-with-frame="true"><figure><img src="/files/PNw7hcA9DBPAvtENOfeI" alt=""><figcaption></figcaption></figure></div>

#### **Write your message**

Enter the message content that should be sent when the automation runs.

<div data-with-frame="true"><figure><img src="/files/GKUtygM4cIYgR2s9JmzG" alt=""><figcaption></figcaption></figure></div>

#### **Available variables**

Available variables display dynamic fields that can be inserted into the message.

<div data-with-frame="true"><figure><img src="/files/h5NAOdoAV8WeGpW2Z1Ci" alt=""><figcaption></figcaption></figure></div>

The variables will depend on the selected event type and integration source.

#### Multiple automation steps

Click Add step to create additional SMS or email steps within the same automation.

<div data-with-frame="true"><figure><img src="/files/WPnfo41rCf5c5eDOrH8A" alt=""><figcaption></figcaption></figure></div>

Each step can have its own delivery method, timing, and message content.

Steps can also be reordered using the **drag handle** beside each **Message via** section.

<div data-with-frame="true"><figure><img src="/files/UdmQ9ivNlMPmUxPEb65u" alt=""><figcaption></figcaption></figure></div>

***

### **When someone replies**

The **When someone replies** section controls how replies to automation messages are handled.

<div data-with-frame="true"><figure><img src="/files/uNEVE98iJuHtfllE62gi" alt=""><figcaption></figcaption></figure></div>

#### **Let AI respond automatically**

Allows an **AI Chat** agent to automatically respond to incoming replies and continue the conversation flow.

When selected, the **Reply handled by** dropdown appears so you can choose which **AI Chat** agent should manage responses.

<div data-with-frame="true"><figure><img src="/files/KYwQvta3iRstPLJxrtUC" alt=""><figcaption></figcaption></figure></div>

#### **Do not respond automatically**

Disables automatic AI responses. Customer replies will still appear in Distance, but your team will handle responses manually.

***

### **Publishing the automation**

After configuring the automation, click **Publish changes** in the upper-right corner to save and enable the workflow.

<div data-with-frame="true"><figure><img src="/files/qg3XAKlnJhUkhRXtuldI" alt=""><figcaption></figcaption></figure></div>

***

### **Generate with AI (Recommended)**

Click **Generate with AI** and **Describe the message you want to generate**, such as a response after a form submission, a follow-up after a dropped call, a message triggered when a contact is updated or enrolled in an automation, or messages based on integration events like QuickBooks activity (for example, new invoices or payments received).&#x20;

<div data-with-frame="true"><figure><img src="/files/MsXZztiuxK31YBVW5ogo" alt=""><figcaption></figcaption></figure></div>

You can also include specific details such as contact fields or custom properties, including name, service type, or appointment date.

Click **Generate message** to proceed.

<div data-with-frame="true"><figure><img src="/files/Yl87HUWdpM4hB4EVwpYN" alt=""><figcaption></figcaption></figure></div>

The AI will generate a message based on your input and automatically insert relevant variables where appropriate. Selecting Use this will replace the content in the message field.

<div data-with-frame="true"><figure><img src="/files/qSurtkx4Q9CkN7rCFOQE" alt=""><figcaption></figcaption></figure></div>

Review and edit the generated message as needed to ensure it matches your tone and intent. This helps keep messages consistent, personalized, and easy to create across both SMS and email automations.
