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

# Set up AI Custom Event triggers in automation

> Use the AI Custom Event trigger so your AI agent can run a bitCRM automation during a conversation, based on a custom skill in AI Studio.

The **AI Custom Event** trigger lets your AI agent start a bitCRM automation in the middle of a conversation. You add the trigger in bitCRM, then tell the AI agent when to run it with a custom skill in AI Studio.

## Before you start

* Open [Automation](https://app.bitbybit.studio/bitcrm/automation-new).
* Make sure you have an AI agent set up in **AI Studio**.

## Step 1: Add the AI Custom Event trigger

* Click **Create new automation**, or open an existing automation.
* Click **Trigger** and choose **AI Custom Event**.
* Enter a **Trigger name** (required). Use a name that says what the automation does, for example "Product interest detected".
* Click **Save**.

<img src="https://mintcdn.com/asmaraku/1O91wDqYuDyPLKl-/images/bitcrm-ai-custom-event-trigger-modal.png?fit=max&auto=format&n=1O91wDqYuDyPLKl-&q=85&s=939948d91f746490ca2c97f168f3217c" alt="Trigger window with AI Custom Event selected, an empty Trigger name field, and a note to set it up in AI Studio" width="548" height="366" data-path="images/bitcrm-ai-custom-event-trigger-modal.png" />

## Step 2: Build and activate the automation

* Add the steps the automation should run after the trigger.

<img src="https://mintcdn.com/asmaraku/1O91wDqYuDyPLKl-/images/bitcrm-ai-custom-event-automation-flow.png?fit=max&auto=format&n=1O91wDqYuDyPLKl-&q=85&s=130f5440442b4fe4a36026a5f8b7b6a9" alt="Automation flow that starts with an AI Custom Event trigger, followed by a time delay and a WhatsApp Cloud API message" width="1315" height="373" data-path="images/bitcrm-ai-custom-event-automation-flow.png" />

* Click **Save automation**.
* In the **Automation** list, make sure the automation's switch is on.

<img src="https://mintcdn.com/asmaraku/1O91wDqYuDyPLKl-/images/bitcrm-ai-custom-event-automation-active.png?fit=max&auto=format&n=1O91wDqYuDyPLKl-&q=85&s=1436759655a5eb9ce9028c13df083394" alt="Automation list with the AI Custom Event automation switched on" width="1236" height="272" data-path="images/bitcrm-ai-custom-event-automation-active.png" />

Only active automations with an AI Custom Event trigger can be picked by the AI agent.

## Step 3: Connect the automation to your AI agent

* Go to **AI Studio** and open your AI agent.
* Open the **Skills** tab and click **Add skill**.

<img src="https://mintcdn.com/asmaraku/1O91wDqYuDyPLKl-/images/ai-studio/ai-agent-skills-add-skill.png?fit=max&auto=format&n=1O91wDqYuDyPLKl-&q=85&s=b69c6264811bb133913a78fcafaa2e96" alt="Skills tab in AI Agent Studio with the Add skill button highlighted" width="817" height="527" data-path="images/ai-studio/ai-agent-skills-add-skill.png" />

* Select **Custom skill** and click **Add skill**.

<img src="https://mintcdn.com/asmaraku/1O91wDqYuDyPLKl-/images/ai-studio/ai-agent-select-custom-skill.png?fit=max&auto=format&n=1O91wDqYuDyPLKl-&q=85&s=fd1f6de3259fcec5d774d3846a78d680" alt="Select skill window with Custom skill selected and the Add skill button highlighted" width="787" height="370" data-path="images/ai-studio/ai-agent-select-custom-skill.png" />

* Fill in the skill's **Name** and **Description**.
* In **Instructions**, describe when the AI agent should run the automation, and type **@** to mention it. For example: "If the customer asks about or shows interest in red shoes, run @Product interest detected".

<img src="https://mintcdn.com/asmaraku/1O91wDqYuDyPLKl-/images/ai-studio/ai-agent-custom-skill-mention-automation.png?fit=max&auto=format&n=1O91wDqYuDyPLKl-&q=85&s=c68b17b4f32f76d67d56d48dba59318f" alt="Custom skill page with instructions that mention an automation, and the Automations list shown after typing @" width="826" height="662" data-path="images/ai-studio/ai-agent-custom-skill-mention-automation.png" />

For the full custom skill setup, see [Add and manage skills in AI agent studio](/ai-studio/how-to-setup-skillset-in-ai-studio).

## When the automation runs

The automation runs when the AI agent decides the situation in your custom skill has happened. It does not run when:

* No active custom skill mentions the automation.
* The automation is inactive.
* The customer has no valid phone number or email.

<Warning>
  If you delete an automation that a custom skill mentions, your AI agent can no longer run it. The custom skill shows **Needs attention — part of this skill no longer works** until you mention another automation.
</Warning>

## Related articles

* [Add and manage skills in AI agent studio](/ai-studio/how-to-setup-skillset-in-ai-studio)
* [How to set up a trigger](/bitcrm/how-to-set-up-a-trigger)
* [How to create an automation](/bitcrm/how-to-create-an-automation)
