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

# addConditionalEntrypoint

## Syntax

`addConditionalEntrypoint(params)`

## Description

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

If `{condition}` is met within the next `{retentionTime}` inputs, Flow execution starts at `{entrypoint}`.

**Parameters:**

* `params`: `IAddConditionalEntrypointParams` — an object that includes the Entrypoint to trigger, the duration for retaining the condition, and the condition to evaluate.

<Accordion title="IAddConditionalEntrypointParams Object Structure">
  ```js theme={null}
  interface IAddConditionalEntrypointParams {
    entrypoint: string;
    retentionTime: number;
    condition: string;
  }
  ```

  **Returns:** `void`
</Accordion>

## Example

```js theme={null}
addConditionalEntrypoint({
  entrypoint: "askEmail",
  retentionTime: 2,
  condition: "input.text.includes('@')"
});
```
