Loading
Salesforce now sends email only from verified domains. Read More
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          End Session Action

          End Session Action

          This action ends a specified session for an agent.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Performance, Unlimited, and Developer Editions. Required add-on licenses vary by agent type.
          View licenses for integrated features.

          In Flow Builder, add an Action element to your flow. Select the AI Agent API category. Then, select the End Session action.

          Set Input Values

          Field Description
          Session End Message

          Required. An Apex AgentInvAction__AIAgentAPIV1_SessionEndedMessage record that contains a message with the reason why the session ended.

          Valid values for the reason property are:

          • UserRequest
          • Transfer
          • Expiration
          • Error
          • Other
          Session ID Required. The ID of the current agent session.
          Tenant Key ID Reserved for internal use only.

          Set Output Values

          Set Field Description
          200 Batched response (headless)
          400 Exception Bad request
          401 Exception Access bearer token is missing or invalid
          403 Exception User is forbidden from accessing the resource
          404 Exception Resource not found
          422 Exception Any exception that occurred during the request execution
          423 Exception Server is busy and cannot process the request at this time
          429 Exception Too many requests for the server to handle
          503 Exception Service is unavailable possibly because Apex or flow calls timed out
          Default Exception Server is busy and cannot process the request at this time
          responseCode The response code associated with the exception message.

          Usage

          This action is available only if the following are true. Otherwise, the action fails.

          • Agentforce is enabled.
          • The user who runs the flow has the Manage AI Agents permission.
          • The specified agent has an active version.

          To set the Session End Message input:

          • Create an Apex-defined variable and select the AgentInvAction__AIAgentAPIV1_SessionEndedMessage Apex class.
          • Use Assignment elements to set the reason property.
          • Use the AgentInvAction__AIAgentAPIV1_SessionEndedMessage variable as the Session End Message input.
           
          Loading
          Salesforce Help | Article