> For the complete documentation index, see [llms.txt](https://help.cosmobots.io/help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.cosmobots.io/help/outros/dicas/enviar-o-usuario-para-um-fluxo-especifico-caso-ele-responda-2-ou-mais-vezes-errado..md).

# Enviar o usuário para um fluxo específico caso ele responda 2 ou mais vezes errado.

{% embed url="<https://drive.google.com/file/d/1-PMcEY_YFmNbxk2DWVAJ5yXYNLT1gS03/view?usp=sharing>" %}

1- Crie uma etapa javascript e insira a seguinte informação:

```
context.quantidade=1
```

2-Crie a mensagem que dará as opções ou fará a pergunta ao usuário e salve a resposta:

![](/files/-MjG9n7Mfrw8BqiD67lo)

3- Crie um filtro para validar a resposta do usuário colocando as condições que ela deve ser válida:

![](/files/-MjG9uEbRLRdiwIEXFbl)

4- Do lado não do filtro, crie outra etapa javascript com a seguinte informação:

```
context.quantidade+=1

if(context.quantidade<=2){
   context.resposta="ok"
   
}else{
   context.resposta="nok"
   
}

```

&#x20;5- Abaixo da etapa javascript , crie um novo filtro com a seguinte condição:

![](/files/-MjGANdC8dRloKJje9ta)

6- Do lado sim do filtro, crie uma etapa existente e encaminhe para a etapa em que o usuário responde a mensagem novamente, para ele ter a chance de responder novamente:

![](/files/-MjGAg4n3FU4bLLA_qdH)

7- Do lado não do filtro, configure a ação que você quer ocorra quando o usuário atingir o limite de respostas incorretas:

![](/files/-MjGAsFPAqNJv6NQx-Fh)

Vamos ver como ficou?

![](/files/-MjGB7L5XERRJW4InD-B)


---

# 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://help.cosmobots.io/help/outros/dicas/enviar-o-usuario-para-um-fluxo-especifico-caso-ele-responda-2-ou-mais-vezes-errado..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.
