> For the complete documentation index, see [llms.txt](https://studio.docs.ai.vonage.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://studio.docs.ai.vonage.com/sms/nodes/advanced/counter.md).

# Counter

The **Counter** node will **count the number of times the node was triggered**, and allow you to modify the flow according to that number. This will grant the agent the ability to create more complex conversation flows, and create dynamic effects on the flow.

Use this node if you want to enable different outcomes for each time the user passes a certain node. The counter node has to be placed right after the node you want to influence.

![](https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_81A0PNZfdawu_TPAO%2F-Mb1hoas81DaA6cfWhk9%2F-Mb1iSZoJ7zGSIqTP7Af%2FScreen%20Shot%202021-05-31%20at%2017.00.19.png?alt=media\&token=c0f26937-14f7-4fff-8db4-b53817c3e1e3)

You can **specify the number of scenarios**, the minimum being one and the maximum being five. Connect the exit points of the tabs in the counter node with the entry points of the new nodes you chose for your flow.

### When to use the Counter node?

If the agent misclassified in a Collect Input node with a sys.any parameter and an attached Classification node, it will go straight to “Missed” in the Classification node.&#x20;

In this scenario, because we are using sys.any, we collect virtually any input in the Collect Input node, it is not possible to reprompt the user.&#x20;

Therefore, add the Counter node after the Classification node, connecting the exit point of the Classification node’s “Missed” to the entry point of the Counter node.&#x20;

![](https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_81A0PNZfdawu_TPAO%2F-Mb1hoas81DaA6cfWhk9%2F-Mb1j4yBh0iqYJIR8NB4%2FScreen%20Shot%202021-05-31%20at%2017.03.01.png?alt=media\&token=57215663-9a7d-428a-84f2-afb1e102020f)

{% hint style="info" %}
*Use the counters node to create context specific fallback. Try to let the user know why they failed or why they are being routed at that specific step so they either know what to fix or know what they did wrong so they are less likely to repeat the mistake the next time. General fallbacks like “I’m sorry that didn't work” do not provide any feedback for the user to improve their responses.*
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://studio.docs.ai.vonage.com/sms/nodes/advanced/counter.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
