Human-in-the-Loop (HITL)

Allow a live agent to participate directly in the bot's conversation.

The Human-in-the-Loop (HITL) integration allows members of your Workspace to:

  • Chat directly with users
  • Approve AI-generated outputs before they’re sent
  • Handle complex or sensitive scenarios

Setup

Step 1: Install the HITL integration

First, install the official HITL integration:

In Botpress Studio, select Explore Hub in the upper-right corner.
Search for the HITL integration, then select Install Integration.

Step 2: Install the HITL plugin

Next, install the official HITL plugin. This will allow you to start HITL from any point in your Workflow.

Navigate back to Botpress Hub and search for the HITL plugin.

Select it, then select Install Plugin.

In the Configuration menu, open the dropdown under HITL integration.

Select HITL.

Scroll down and select Save.

Step 3: Add the Start HITL card to your Workflow

Open a Workflow in Studio and create (or select) any Node.

Add the Start HITL Card at the point where you want to hand off conversations to a live agent:

Start HITL Card

In the Card’s inspector, fill in the required fields:

FieldsDescription
Ticket TitleThe name of the ticket created for the live agent.
User IDThe user ID associated with the ticket. Enter the {{event.userId}} variable to use the current user’s ID.
Conversation IDThe conversation ID associated with the ticket. Enter the {{event.conversationId}} variable to use the current conversation’s ID.

Cards

Create external user

Create an end user in the external service and in Botpress

inputobject
outputobject

Start new HITL session

Create a new HITL session in the external service and in Botpress

inputobject
outputobject

Stop HITL session

Stop an existing HITL session in the external service

inputobject

Triggers

hitlAssigned

payloadobject

hitlStopped

payloadobject