# Automation Flow - How to avoid duplicates

In the Automation Flow it is possible to create an automation that prevents the duplicate creation of opportunities.

* You can also prevent duplicate opportunities directly through the CRM, [check the step-by-step here.](https://docs.sprinthub.com/topicos/geral/crm/crm-automacoes/crm-automacao-para-evitar-oportunidades-duplicadas)

In the following example we used segments, but you can also use tags, if applicable.

* [To learn how to create segments click here.](https://docs.sprinthub.com/topicos/relacionar/segmentos)
* [To learn how to create tags click here.](https://docs.sprinthub.com/topicos/configuracoes/tags)

1 - Go to Automation Flow, click +New and add a Name.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FitDe6BMY80g59WRjlHQe%2Fflux1.png?alt=media&#x26;token=92b79fdd-d838-40a0-b8ef-4ee75c13e78a" alt=""><figcaption></figcaption></figure>

2 - Select “Allow leads to restart the flow” YES, and “Published” at the end of the configuration.\
Indicate the main segment.&#x20;

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FnheL0X0qVOKstbWrsw1d%2Fflux2.png?alt=media&#x26;token=251fb960-e815-4c17-b9f7-e103efdc2150" alt=""><figcaption></figcaption></figure>

3 - Click “Open Builder”.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FIAIW6DBWJnANYOilInqg%2Fop22.png?alt=media&#x26;token=9be5d740-d1b3-4e0e-aba6-c225f72cedd0" alt=""><figcaption></figcaption></figure>

Add the **Condition**: “Does the lead have an opportunity?” >> The Lead does NOT have an opportunity.\
On the **positive output** of this first block, we will add **one more Action**: “Create opportunity >> Configure the opportunity as shown below:

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2F8nOwMGB3VyN1UgfKwXxl%2Fop2.png?alt=media&#x26;token=66f84dc4-8dc7-42e1-81aa-64abc15d0f3a" alt=""><figcaption></figcaption></figure>

\
In **negative output**, then add the action “Notify an employee” >> Select an employee to be notified, in the case of leads that ALREADY HAVE opportunities.\
Save the automation.<br>
