> ## Documentation Index
> Fetch the complete documentation index at: https://docs-classic.cognigy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execution and Flow Control

The *Execution and Flow Control* functions let you manage how a Flow runs. You can stop or restart a Flow, track node executions, run other Flows, and set which Node executes next.

## [`executeFlow`](https://docs-classic.cognigy.com/ai/for-developers/function-reference/execution-control/executeFlow)

**Syntax:** `executeFlow(config)`

Executes a target Flow starting from a specified Entrypoint Node.

## [`setNextNode`](https://docs-classic.cognigy.com/ai/for-developers/function-reference/execution-control/setNextNode)

**Syntax:** `setNextNode(nodeId, flowId)`

Sets a custom Node with the given `nodeId` to be executed immediately after the current one.

## [`resetNextNodes`](https://docs-classic.cognigy.com/ai/for-developers/function-reference/execution-control/resetNextNodes)

**Syntax:** `resetNextNodes()`

Clears any active overrides for the next Node in the Flow.

## [`addConditionalEntrypoint`](https://docs-classic.cognigy.com/ai/for-developers/function-reference/execution-control/addConditionalEntrypoint)

**Syntax:** `addConditionalEntrypoint(params)`

Adds a conditional Entrypoint for the current conversation. This condition is used by the Optional Question Node.

## *(Deprecated)* [think](https://docs-classic.cognigy.com/ai/for-developers/function-reference/execution-control/think.md)

**Syntax:** `think(text, data)`

Restarts Flow execution with a simulated input.

## [thinkV2](https://docs-classic.cognigy.com/ai/for-developers/function-reference/execution-control/thinkV2.md)

**Syntax:** `thinkV2(text, data)`

Restarts Flow execution with a simulated input using the provided text and data.

## [`stopExecution`](https://docs-classic.cognigy.com/ai/for-developers/function-reference/execution-control/stopExecution)

**Syntax:** `stopExecution()`

Stops processing the current input after this Node.

## [`getExecutionAmount`](https://docs-classic.cognigy.com/ai/for-developers/function-reference/execution-control/getExecutionAmount)

**Syntax:** `getExecutionAmount(nodeId)`

Retrieves the number of times a Node with the given `nodeId` has been executed during this conversation.

## [`setExecutionAmount`](https://docs-classic.cognigy.com/ai/for-developers/function-reference/execution-control/setExecutionAmount)

**Syntax:** `setExecutionAmount(nodeId, value)`

Returns the number of times the Node with the given `nodeId` has been executed in the current conversation.

## [`resetExecutionAmount`](https://docs-classic.cognigy.com/ai/for-developers/function-reference/execution-control/resetExecutionAmount)

**Syntax:** `resetExecutionAmount(nodeId)`

Resets the number of executions to 0 for the Node with the given `nodeId`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.