
To end Messaging Session due to inactivity in Salesforce Messaging for In-App and Web, enable “Automatically mark conversations inactive after a period of customer inactivity”.
Note:
There is currently no support for configurable session inactivity for Agentforce Agents. The inactivity setting on the Messaging Channel applies only to human service reps.
Agent Session Expiry: Typically 72 hours for Agentforce Service agents.
Help Article:
1. Creating a Messaging Component to send text when the Messaging Session is idle i.e the customer is not responding to the agents.

2. Go to Messaging Settings in Salesforce Setup. Edit the Messaging Channel.
3. Select the Messaging Component created in Step 1 in Inactive Conversation.
4. Enable “Automatically mark conversations inactive after a period of customer inactivity”.

5. Test it by keeping the Visitor session idle for 5 minutes. The Automatic Message will be sent to the visitor. The Messaging Session will auto ended. This will allow the chat agents to work with other customers.
Output:
