https://discord.gg/botpress logo
WhatsApp restaurant bot building
# šŸ¤help
r
Hello Botpress Support Team, I'm building a WhatsApp-based ordering bot for a restaurant using Botpress. The bot is working well on the customer side—it's able to chat, understand orders, and guide the user through the process using the Autonomous Node. Now, I want to send the finalized order to the kitchen’s WhatsApp number in a format like this: Order Placed Name: Aref From WhatsApp number: (user's WhatsApp number) Number Provided: (their provided number) Address: (their address) Order: – Item #1 – Item #2 Additional Notes: Sample note View Chat: [optional link or summary] My Questions: How do I trigger the finalized order message to be sent to the kitchen? – Do I connect the Autonomous Node to a Standard Node with an AI Task or use a Router? – Do I manually check if workflow.orderSummary is ready, and if so, trigger the next node? Should the Autonomous Node "hand off" the conversation once the order is ready? – If yes, how can I reliably detect when the order is finalized (e.g., customer says "that's all" or gives their name/phone/address)? What’s the best practice for formatting and sending this message via WhatsApp API to the kitchen number? – I'm using 360dialog for WhatsApp, and I can make HTTP requests. Just want to make sure this flow is Botpress-friendly. Any step-by-step guidance, best practices, or working examples would be massively appreciated. Thank you!
p
You could create a subworkflow, that has as input variable all of the information needed. The An instructions should mention that the subworkflow should be called. Inside you can formulate your message using an Ai generate text card and then make your request inside the execute code card. The subworkflow could reach an end node instead of the exit if you want that to be the last thing the bot does. Happy Bot Building!
r
Is it possible to pass the whole chat to the next node? I'm trying to make it available for the restaurant to see the bot chat with customer if needed
p
The autonomous ndoe would not do the automatically I believe, but you can assign it to a variable. The chat history is in the event.state.session.history variable, you might need to format it better.
r
Please help me more with this Leanne. I've added hooks for after incoming and outgoing sections, to save the messages into an array (messages of the autonomous node and the user). but still couldnt make this thing work (to save it to a txt file or something). I need help
p
Why are you trying to use hooks? Additionally, please be more specific with the help you need. You might want to join office-hours to see an example solution to your use case, we have them everyday at 10:30 am est.
r
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?