> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/topics/artificial-intelligence/ai-agents/ai-agents-execute-automations.md).

# AI Agents - Execute Automations

## Activating the capability and creating an automation

To use AI automations, it is necessary to enable it and create a new one on the automations overview screen. Once enabled, the 'Agent Conditions' will be checked with every lead message.

<figure><img src="/files/18c3e73f8bfde8ee17b8de21e1e75ec7bda7fa9e" alt=""><figcaption><p><em>Run Automations capability.</em></p></figcaption></figure>

<figure><img src="/files/c35da3c2655966d73b57ed8049208313da6c8818" alt=""><figcaption><p><em>Automations screen.</em></p></figcaption></figure>

## Configuring - Initial Data

The initial data filled in will be visible on the automations screen and are fundamental to the process working properly. Both the 'Name' field and the 'Automation Description' — especially the latter — should clearly indicate the purpose of the automation so that the agent understands exactly what will be executed.

<figure><img src="/files/aeabf9d059ff28534d40be28284a11be0bce9ed8" alt=""><figcaption><p><em>Initial Data.</em></p></figcaption></figure>

## Configuring - Conditions and Actions

1. Agent Condition: Checks when the lead sends a message that matches the defined condition, considering both the context of the current conversation and the lead fields accessible by the AI. If the check is considered true, it will proceed to 'Automation Conditions', if any exist.
2. Automation Conditions: These are additional checks. If the combination of conditions is true, the actions will be executed.
3. Automation Actions: The actions within Sprinthub that will be executed.

In this example, it will be checked whether the lead showed interest in joining the Offers Club of a bookstore. If they express interest and have a registered email, an opportunity will be created for them in the 'Offers Club' pipeline.

<figure><img src="/files/ec37c28638031297964467b0baebae1d12568cac" alt=""><figcaption><p><em>Conditions and Actions.</em></p></figcaption></figure>

## Configuring - Action Repetition

For this automation, the option 'Only one trigger per conversation?' was enabled, ensuring that the action is not repeated during the same interaction. The option 'Keep checking conditions until they are met?' ensures that, even if the lead does not meet the 'Automation Conditions' on the first attempt, the AI can perform new checks as soon as they go through the 'Agent Conditions' again.

<figure><img src="/files/6e06964e5fc0f830cea0a2f68f3a3a04ea07f397" alt=""><figcaption><p><em>Action Repetitions.</em></p></figcaption></figure>

## Adapting the training and rules for the automation

It is important that the AI agent is aware that the company works with an Offers Club system, so that it correctly understands the automation and knows how to tell the lead whether or not this club exists.

It is also recommended, in the additional rules, to configure a notice to the lead informing them that they have been registered, if they request enrollment. In this way, in addition to the automation creating the opportunity, we ensure that the lead has been properly notified about their registration.

<figure><img src="/files/56d387346161c3f4865b071cc79114da67c5dbe9" alt=""><figcaption><p><em>Contextualization.</em></p></figcaption></figure>

## Testing the automation

Finally, during the conversation with the lead, the agent informed them about the possibility of enrollment. When the lead showed interest, they received a confirmation message. The execution of the 'Create Opportunity' action can be verified in the history.

<figure><img src="/files/3dee52d76d49575ca4918fb22708645a3463ff1c" alt=""><figcaption><p><em>Customer service with the lead.</em></p></figcaption></figure>

<figure><img src="/files/9789201c8c7a18222ba195ef4d5a04a355201111" alt=""><figcaption><p><em>Lead history.</em></p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sprinthub.com/en/topics/artificial-intelligence/ai-agents/ai-agents-execute-automations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
