Typing indicators

  • Release version: Australia
  • Updated March 12, 2026
  • 1 minute to read
  • Display a typing indicator when a bot or live agent is preparing a response to a requester.

    When Virtual Agent processes a request, the Start typing indicator action is called. When Virtual Agent completes the request processing, the End typing indicator action is called before Virtual Agent processes any output or input controls.

    These actions call the defaultText control outbound transformation. The following example shows how the typing indicator is handled in the defaultText control outbound transformation.

    Example: Typing indicator script
    (function execute(inputs, outputs) {
        try {
            var richControl = inputs.rich_control;
            var actionType = richControl.type;
            if(actionType == 'StartTypingIndicatorActionMsg'){
                outputs.result = '{activity:{type: "typing" }}'
            }else if(actionType == 'EndTypingIndicatorActionMsg'){
                outputs.result = '{activity:{type: "message" , text: "Finished typing"}}'
            }
           /* Handle other type of control */
        } catch (e) {
            gs.error("Error in default action outbound transformer : " + e.message);
            throw e;
        }
    })