Key benefits
- Fewer abandoned conversations. Re-prompts users who stop responding.
- Clean endings. Routes or closes conversations that stalled.
Prerequisites
- A Webchat v3 endpoint is configured. For testing, you can use Demo Webchat.
- A flow assigned to the endpoint that waits for user input, for example, with a Question, Optional Question, or Wait for Input node.
Restrictions
- This feature is available for Webchat v3 endpoints only.
How to use
To use this feature, turn on user inactivity in the endpoint settings, add the Enable User Inactivity node to your flow, and test the flow in Demo Webchat. While Enable User Inactivity is turned off, the Enable and Disable User Inactivity nodes have no effect.How to set up
1. Configure the endpoint
1. Configure the endpoint
- In the navigation menu of the project, go to Deploy > Endpoints and open your Webchat v3 endpoint.
- On the Behavior tab, in the User inactivity section, turn on Enable User Inactivity.
- In the Action list, select what happens when the user is inactive:
- Inject into current flow — sends the injected text and data to the flow that the conversation is in. This option is selected by default. For this example, select this option.
- Execute flow — switches the conversation to the selected flow, starting at its first node. When you select this option, the Flow list appears. Select the flow that the conversation switches to. When that flow ends, the user’s next message starts the endpoint’s flow again from its first node.
- In the Injected text field, enter the text that the flow receives as the user’s input when the user is inactive, for example,
You seem to have disconnected. Leave the field empty to send data only. - (Optional) In the Injected data field, enter a JSON object that is added to the input data, for example,
{ "reason": "no_reply" }. The input data always includes theuserInactivitykey with details about the timeout. Leave the field empty to send no custom data. - Save changes.
2. Greet the user
2. Greet the user
- In the flow editor, add the Flow Agent node.
- In the Flow Agent node, configure the agent to greet the user, for example, with a short welcome message.
- Save changes.
3. Turn on user inactivity detection
3. Turn on user inactivity detection
- Below the Default child node of the Flow Agent node, add the Enable User Inactivity node.
- In the Timeout field, enter
60(seconds). This sets the timeout to one minute. - Save changes.
The default timeout is
30 seconds, the minimum is 3 seconds, and the maximum is 259200 seconds (72 hours). Your installation may set a lower maximum. A value above the allowed maximum is reduced to that maximum. The timer starts after the agent message and resets when the user sends a message. Cognigy injects the input between the timeout and the timeout plus a short check interval, never earlier.4. Ask the user
4. Ask the user
- Below the Enable User Inactivity node, add the Question node.
- In the Question Type list, select Text.
- In the Text field, enter
Are you ready for your order? Answer yes or no.. - Save changes.
5. Handle the answer
5. Handle the answer
- Below the Question node, add the If node.
- In the Condition field, click Use Advanced Editor and enter
input.text.toLowerCase() === "no". - Below the Then child node, do the following:
- Add the Disable User Inactivity node. This node stops the inactivity detection, so the user isn’t prompted while they get ready.
- Below the Disable User Inactivity node, add the Say node and enter the text
Okay, I'll wait. Just let me know when you're ready..
- Below the Else child node, do the following:
- Add the Question node.
- In the Question Type list, select Text.
- In the Text field, enter
What would you like?. This node waits for the user’s answer. If the user doesn’t respond within the timeout, the injected inactivity input answers the question.
- Save changes.
6. Use the injected input
6. Use the injected input
(Optional) When the user is inactive, Cognigy sends the Injected text and Injected data from step 1 to the flow as if the user sends them. The second Question node takes them as the answer. To use them in the flow, do the following:
- Below the second Question node, add the Say node.
- In the Text field, enter
{{input.text}}. The agent then outputs the Injected text, for example,You seem to have disconnected. - To use the Injected data, add
{{input.data.reason}}to a text field of any node below the second Question node. - Save changes.
Without this step, the flow still continues after the injected input answers the question.
How to test
- Open Demo Webchat for your endpoint.
- When the agent asks
Are you ready for your order? Answer yes or no., answeryes. The agent then asksWhat would you like?. - Don’t type or send anything for longer than one minute.
- If you completed the optional step 6, check that the agent responds with
You seem to have disconnected. - On the Logs page, check for entries that start with
[User Inactivity]. They report when detection is enabled, when inactivity is detected, and when the input is injected or detection is disabled. The injected input doesn’t appear as a message in the chat. - Start a new conversation and answer
No. Check that the agent responds withOkay, I'll wait. Just let me know when you're ready.and that no inactivity message follows after one minute, because the Disable User Inactivity node turned detection off.
Example flow
The following example uses the flow from How to set up. Select a tab to see how the conversation changes depending on the user’s answer.- User stays silent
- User answers No
1
The agent asks a question
The agent asks
Are you ready for your order? Answer yes or no., and the user answers yes.2
The agent waits for an answer
The agent asks
What would you like?. The Enable User Inactivity node starts the 60-second timer.3
The user doesn't respond
After 60 seconds without a message, Cognigy considers the user inactive and writes a
[User Inactivity] entry to the Logs page.4
The injected input answers the question
The flow receives the following input:
5
The agent responds
If you completed the optional step 6, the Say node outputs
You seem to have disconnected.