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
          Send Session Message Action

          Send Session Message Action

          This action sends a message in a specified session for an AI 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 Send Session Message action.

          Set Input Values

          Field Description
          Message Request Body Required. An Apex AgentInvAction_AIAgentAPIV1_SendMessageRequest record that contains agent data to send a message, including the message to send.
          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
          Response Code 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 Message Request Body input:

          • Create an Apex-defined variable and select the AgentinvAction_AlAgentAPIV1_SendMessageRequest Apex class.
          • Use Assignment elements to set the message.TextVariable.text and message.TextVariable.name properties. The name property must be set to a context variable.
          • Use the AgentinvAction_AlAgentAPIV1_SendMessageRequest variable as the Message Request Body input.
           
          Loading
          Salesforce Help | Article