# A.I. Agents - Run Automations

## Enabling the skill and creating an automation

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

<figure><img src="/files/18c3e73f8bfde8ee17b8de21e1e75ec7bda7fa9e" alt=""><figcaption><p><em>Skill Execute Automations.</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 entered will be visible on the automations screen and are essential for the process to function. Both the 'Name' field and the 'Automation Description' — especially the latter — should clearly indicate the automation's purpose so 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 A.I. 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' funnel.

<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 a single trigger per conversation?' was enabled, ensuring the action is not repeated during the same service. The option 'Check conditions until they are met?' ensures that, even if the lead does not meet the 'Automation Conditions' on the first attempt, the A.I. can perform new checks as soon as they again pass the 'Agent Conditions'.

<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 A.I. agent is aware that the company operates an Offers Club system, so it correctly understands the automation and can inform the lead whether this club exists or not.

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. This way, besides the automation creating the opportunity, we ensure the lead was 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 mentioned 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>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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
