Sending an ongoing customer message via Virtual Agent Bot Integration API after Live Agent handoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
What we're building: A custom web app that talks to Virtual Agent + Advanced Work Assignment to hand a chatbot conversation off to a live human agent in Agent Workspace, with two-way messaging after handoff. We're driving this entirely through sn_va_as_service's Bot Integration API (POST /api/sn_va_as_service/bot/integration), authenticated via Basic Auth + the integration token.
What works — conversation creation and handoff:
- START_CONVERSATION creates the conversation. The synchronous HTTP response is just {"status":"success"} — no session id in it. The real session id only arrives async, via the outbound webhook, in a body item shaped like:
{"actionType":"StartConversation","conversationId":"<real id>","uiType":"ActionMsg", ...}We correlate that back to our original call via requestId.
- Sending a follow-up message with action: "AGENT" and message.text set to the exact label of a TopicPickerControl option the bot's opening response offers (in our case, "Live Agent Support", which NLU-matches a topic named the same) correctly triggers the full handoff sequence — confirmed via the webhook pushes we receive in order: SubscribeToSupportQueue → StartSpinner → SwitchToLiveAgent → SubscribeToChatPresence → a System/ActionMsg push with "message":"Agent has joined." → the agent's queue-configured auto-greeting. This part works reliably.
Where we're stuck — sending the customer's next message once the agent is already live:
Every subsequent customer message needs to reach that same live agent in Agent Workspace. We've tried:
- action: "AGENT" again, with the real message text, on the same clientSessionId. Result: the webhook returns "score": 0, "takeControl": true, and a bot-generated fallback response (e.g. "I'm having technical issues and won't be able to continue this conversation." or, on an earlier attempt, "It seems you have left the conversation.") — never the human agent. Worse, the underlying interaction record transitions to Closed Abandoned, killing the live session outright rather than just failing to deliver that one message.
- action: "USER" instead — silent no-op, no webhook activity at all, message never delivered anywhere.
- action: "AGENT" with contextVariables set (per the pattern shown for queue-targeted transfers in ServiceNow's own docs, e.g. {"b2b_category":"humanresource"}) — identical failure to the plain AGENT case above (score:0, takeControl:true, Closed Abandoned). We also confirmed on the AWA Queue record itself (Work item routing condition builder) that there's no field available to even receive an arbitrary contextVariables key — so this wasn't a queue-condition mismatch, it's that AGENT re-enters the bot/NLU pipeline regardless of what's attached to the call, once a live agent already owns the interaction.
It looks like the Bot Integration API's AGENT (and USER) actions are fundamentally bot/NLU-conversation actions, with no "just relay this raw text to the human agent who already joined" mode — but we haven't found this stated anywhere in the docs, so we may be missing an action, a flag, or an entirely different endpoint meant for this exact purpose.
Question: Is there a documented, supported way to send an ongoing customer message into an already-live agent chat via the Virtual Agent / sn_va_as_service Bot Integration API (or any other supported API), without it re-entering the bot/NLU pipeline or risking the interaction being closed as abandoned?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Victor Chen
As I could see some documentation around Virtual Agent API that you have added, thought of tagging you here in case you have suggestions or can point me to someone who can answer this