Hi Leanne,
Let me explain my use case in full so itās easier to understand.
Iām building a Botpress chatbot that connects to WhatsApp for a restaurant.
The flow works like this:
Customer sends a message on WhatsApp (e.g., "Iād like 1 chicken kebab") ā bot receives it.
The bot chats back and forth with the customer to confirm details ā name, phone, address, order items, etc.
Once the order is confirmed, the bot needs to send the complete conversation history to the restaurantās kitchen staff so they can see everything the customer said and everything the bot replied ā basically, a transcript of the order conversation.
What I want technically:
As the conversation happens, I want to capture every incoming message from the customer and every outgoing reply from the bot.
Save all of that into a variable (e.g., workflow.chatHistory) in a readable format like:
[2025-08-11 14:01] Customer: Iād like 1 chicken kebab
[2025-08-11 14:02] Bot: Sure! Can I have your name and address?
[2025-08-11 14:03] Customer: My name is John, 123 Main Street
At the end of the conversation, I want to pass that variable to the next node where I can:
Send it in a WhatsApp message to the kitchen.
Or save it to a .txt file for record keeping.
I tried adding after incoming and after outgoing hooks to push messages into event.state.session.history (or transcript), but I canāt get it to fully work so that the whole conversation is available later in the flow.
Basically ā I need the complete chat log from that session, stored and ready to be sent to the kitchen in one go at the end of the order process.
Could you guide me on the best way to capture, store, and retrieve this conversation history in Botpress?