Hello!
I'm looking for a workaround to be able to create a blank Messaging Session in an enhanced SMS channel. I know officially Salesforce does not provide a way to do so but for various business reasons, this is the solution that is needed. High level - based on a record trigger, we need to route a blank Messaging Session to a user via Omni Channel. The scenario covers existing customers with whom we had prior sms conversations as well as new customers with whom we've never communicated via sms.
Has anyone figured out any ways around this limitation?
#Service Cloud #Digital Engagement #Messaging Session
Hi Svetlana,
The short answer is that you cannot manually construct a valid ConversationId via standard Apex/Flow DML because in Messaging for In-App and Web (MIAW) and Enhanced Channels, the Conversation record is managed by Salesforce's backend Service Cloud Real-Time (SCRT2) fabric, not core Salesforce DML. Inserting a raw MessagingSession record without an underlying SCRT conversation context leaves it orphaned and unusable in Omni-Channel.
However, depending on whether you want an automated greeting sent or a completely silent assignment, here are two tested patterns for this use case:
Solution 1: Outbound Messaging Template (Recommended)
Instead of generating an artificial "blank" session, trigger an outbound template message to initiate a real session.
- How it works:
- Trigger an Auto-Response / Outbound Messaging Flow from your record trigger using an approved Messaging Template (e.g., "Hi [Name], an agent is reviewing your account and will connect shortly.").
- Because the message is sent via the standard messaging engine, Salesforce automatically creates the Conversation, provisions the ConversationId, and initiates an active MessagingSession.
- Route this newly initiated session through your Omni-Channel Flow to the agent queue.
- Why it works: The agent receives an active session in their Omni-Channel widget, the conversation thread links seamlessly (for both new and existing customers), and the SCRT2 backbone recognizes the session.
Solution 2: Agent-Initiated "Start Conversation" Quick Action
If your business requirement strictly forbids sending an automated outbound text to the customer before the agent connects:
- Use the Standard Enhanced Outbound Capability:
- Route a custom Task, Case, or Work Order to the agent via Omni-Channel when the trigger condition is met.
- Embed the "Send SMS" / "Start Conversation" Quick Action on the record page layout.
- When the agent accepts the work item from Omni-Channel, they click the action to send their first custom message. Salesforce immediately opens the active MessagingSession console tab for the agent.
Solution 3: SCRT2 / Connect REST API Outbound Trigger
If you have developer resources and need complete headless automation:
- Use the Connect REST API for Outbound Messaging (/connect/conversation/messages / Enhanced Channel API).
- By calling the internal service endpoint rather than attempting an insert new MessagingSession(), the platform spins up the actual conversation payload and routes the resulting session to Omni-Channel as designed.
- How it works: