> ## 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.

# 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] IAddConditionalEntrypointParams Object Structure
>
> ```js theme={null}
> interface IAddConditionalEntrypointParams {
>   entrypoint: string;
>   retentionTime: number;
>   condition: string;
> }
> ```
>
> **Returns:** `void`

## Example

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


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