WhatsApp + Postgres: bookings captured, confirmed fast
Miss one WhatsApp booking message during a rush and it snowballs. The guest follows up (or gives up), your staff guesses what was agreed, and the “reservation list” becomes three different versions of the truth.
Restaurant managers feel it first. But front-of-house leads and owners get stuck cleaning up the same mess: inconsistent replies and no reliable record. This WhatsApp Postgres bookings automation captures requests, confirms them clearly, and logs them so you can trust your numbers.
Below you’ll see how the workflow runs, what it fixes, and what results you can expect once it’s live.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: WhatsApp + Postgres: bookings captured, confirmed fast
flowchart LR
subgraph sg0["Receive WhatsApp Message Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/whatsapp.svg' width='40' height='40' /></div><br/>Send Reply to Customer"]
n1@{ icon: "mdi:cog", form: "rounded", label: "Wait For Response", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/whatsapp.svg' width='40' height='40' /></div><br/>Receive WhatsApp Message"]
n3@{ icon: "mdi:robot", form: "rounded", label: "Extract Customer Query", pos: "b", h: 48 }
n4@{ icon: "mdi:brain", form: "rounded", label: "Generate Reply with AI", pos: "b", h: 48 }
n5@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check If Table Booking Requi..", pos: "b", h: 48 }
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/postgres.svg' width='40' height='40' /></div><br/>Create New Table Booking"]
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/whatsapp.svg' width='40' height='40' /></div><br/>Send Booking Confirmation to.."]
n1 --> n5
n3 --> n1
n4 -.-> n3
n6 --> n7
n2 --> n3
n5 --> n6
n5 --> n0
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n2 trigger
class n3 ai
class n4 aiModel
class n5 decision
class n6 database
classDef customIcon fill:none,stroke:none
class n0,n2,n6,n7 customIcon
The Problem: WhatsApp Bookings Are Easy to Miss (and Hard to Track)
WhatsApp is great for guests because it’s quick, informal, and always open. For you, it can turn into a nonstop stream of “Can we do 7:30?” messages mixed with menu questions, parking details, and “we’re running late.” The real pain isn’t answering. It’s answering consistently while also collecting the details you need, then recording them somewhere reliable. Most teams end up with a human “router” who remembers context in their head, which is fine until shifts change or the restaurant gets busy.
The friction compounds. Small gaps create big problems by the end of the night.
- Booking details arrive in fragments, so staff has to chase down names, times, and party size while other guests are waiting.
- Manual copy-paste into a spreadsheet or notebook leads to typos and duplicate reservations, especially on weekends.
- Replies vary by person, which means guests don’t always get a clear “confirmed” message they can trust.
- There’s no clean data trail for reporting, so you can’t easily answer basic questions like “How many WhatsApp bookings did we get last month?”
The Solution: An AI WhatsApp Concierge That Confirms and Logs Bookings
This n8n workflow acts like a digital front desk on WhatsApp. A guest sends a message, and the workflow immediately parses what they want using an AI agent (booking request, opening hours, menu question, offers, and more). If it’s general info, the workflow drafts a helpful reply and sends it back fast. If it’s a table booking, it collects the key details through the conversation, checks that a booking is actually being requested, and then records the reservation in Postgres as a structured row. Finally, it sends the guest a clear confirmation message so there’s no ambiguity about date, time, party size, and any special requests.
The flow starts with an incoming WhatsApp message. AI interprets intent and keeps light memory so follow-up messages still make sense. Then n8n routes the conversation: reply immediately for info, or store and confirm for reservations.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you get about 20 WhatsApp conversations a day, and around 8 of them turn into booking requests. Manually, you might spend 5 minutes per booking just collecting details and confirming, plus another 3 minutes logging it somewhere, which is roughly 1 hour of pure admin daily. With this workflow, you still spend a moment scanning edge cases, but the guest intake, confirmation, and Postgres logging are handled automatically after the first message. In practice, that’s often 45 minutes back per day, and fewer “double-booked” surprises.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- WhatsApp Business API access to receive and send messages
- Postgres to store confirmed reservations as records
- OpenAI API key (get it from the OpenAI dashboard)
Skill level: Intermediate. You’ll connect accounts, map a few fields, and test real conversations end-to-end.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A guest messages your WhatsApp number. The workflow triggers instantly from the incoming WhatsApp event, so you’re not relying on someone noticing a notification.
The message is interpreted with AI and lightweight memory. The AI agent reads what the guest is asking for and keeps enough context to handle follow-up replies like “make it 8 instead.” Honestly, this is where most DIY chatbots fail, because they treat every message like a brand-new conversation.
Routing decides if it’s a booking or a general question. n8n uses conditional logic (Switch/IF) to send the conversation down the right path, so menu questions don’t clog your booking flow.
Reservations get saved and confirmed. If it’s a booking, the workflow structures the details and writes a new row in Postgres (reservation ID, guest name, contact number, date/time, party size, special requests, and status). Then it sends a WhatsApp confirmation back to the guest so they have a clear receipt.
You can easily modify the confirmation wording to match your brand voice, or adjust which fields are required before logging. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the WhatsApp Trigger
Set up the workflow to start when a new WhatsApp message arrives.
- Add the Incoming WhatsApp Trigger node as your trigger.
- Open Incoming WhatsApp Trigger and confirm Updates includes
messages. - Credential Required: Connect your
whatsAppTriggerApicredentials.
Step 2: Set Up AI Parsing and Response Generation
Configure the AI agent to read inbound WhatsApp messages and generate a response using the connected LLM.
- Add the Parse Guest Request node and set Text to
{{ $json.messages[0].text.body }}. - In Parse Guest Request, keep Prompt Type set to
defineand confirm the system message matches your restaurant’s support policy. - Add Compose AI Response as the language model and set Model to
llama3.2-16000:latest. - Credential Required: Connect your
ollamaApicredentials in Compose AI Response. - Ensure Compose AI Response is connected as the language model for Parse Guest Request (credentials belong to Compose AI Response, not the agent).
Step 3: Configure Reply Pause and Booking Logic
Add the wait step and routing logic to determine whether a booking should be recorded.
- Connect Parse Guest Request to Pause for Reply to introduce the waiting step.
- Connect Pause for Reply to Booking Requirement Check.
- In Booking Requirement Check, review the condition: Left Value is
Bookingand Right Value isadd_your_value_here. - Adjust the Right Value to match the keyword or intent you expect for booking requests.
⚠️ Common Pitfall: Leaving add_your_value_here unchanged will prevent valid booking requests from routing to reservation handling.
Step 4: Configure Output and Database Actions
Send WhatsApp replies and store reservations based on the routing decision.
- On the “false” path of Booking Requirement Check, connect to Dispatch WhatsApp Reply.
- In Dispatch WhatsApp Reply, set Operation to
send, Text Body to{{ $json.output }}, and Recipient Phone Number to{{ $('Incoming WhatsApp Trigger').item.json.contacts[0].wa_id }}. - Set Phone Number ID to
[YOUR_ID]in Dispatch WhatsApp Reply. - Credential Required: Connect your
whatsAppApicredentials in Dispatch WhatsApp Reply. - On the “true” path of Booking Requirement Check, connect to Record Table Reservation.
- In Record Table Reservation, set Schema to
publicand Table toid(update the table name to match your reservations table). - Credential Required: Connect your
postgrescredentials in Record Table Reservation. - Connect Record Table Reservation to Send Booking Confirmation and set Text Body to
{{ $json.output }}, Recipient Phone Number to{{ $('Incoming WhatsApp Trigger').item.json.contacts[0].wa_id }}, and Phone Number ID to[YOUR_ID]. - Credential Required: Connect your
whatsAppApicredentials in Send Booking Confirmation.
Tip: Replace [YOUR_ID] with the phone number ID from your WhatsApp Business account to prevent send failures.
Step 5: Test and Activate Your Workflow
Validate the end-to-end flow with a live WhatsApp message before enabling production.
- Click Execute Workflow and send a WhatsApp message to the connected number to trigger Incoming WhatsApp Trigger.
- Confirm Parse Guest Request outputs a response and Dispatch WhatsApp Reply sends a reply for non-booking messages.
- Send a booking message that matches your Booking Requirement Check condition and verify Record Table Reservation inserts a record and Send Booking Confirmation sends a confirmation.
- Once successful, toggle the workflow to Active to enable live automation.
Common Gotchas
- WhatsApp Business API credentials can expire or require specific webhook permissions. If things break, check your WhatsApp provider dashboard and the webhook delivery logs first.
- If you’re using Wait nodes or external processing, response timing varies. Bump up the wait duration if downstream steps fail because the guest hasn’t replied yet.
- Default AI prompts are generic. Add your booking rules (seating time limits, closed days, large party policy) early or you will be correcting the bot’s messages every shift.
Frequently Asked Questions
About 60–90 minutes once your WhatsApp API and Postgres are ready.
No. You’ll mostly connect accounts and map booking fields. A tiny bit of troubleshooting mindset helps, but you’re not writing an app.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API usage, which is usually a few cents a day for a typical restaurant inbox.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, but you’ll add one extra branch. Keep the same intent parsing, then extend the booking path to include a “deposit required?” check and a payment link message before you set the status to Confirmed. Many teams also add a “Pending” status in Postgres until payment is received, and only then send the final confirmation text.
Usually it’s a webhook or token issue. Confirm your WhatsApp provider shows successful webhook deliveries, then re-check the credential used in n8n for sending replies. If inbound works but outbound fails, it can also be missing permissions for the send-message scope or a template requirement on certain WhatsApp setups.
A lot more than a person can.
Often, yes, if you need real conversational logic. n8n makes it easier to keep state (so the bot can ask for missing details), branch based on intent, and write clean records to Postgres without paying extra for every “path.” Zapier or Make can be fine for simple “message in, row added” flows, but they get awkward when you need memory, waits, and multiple back-and-forth messages. If you expect lots of weekend volume, self-hosting n8n also keeps execution costs predictable. Talk to an automation expert if you want help choosing.
Once this is running, reservations stop living in someone’s head (or a chat scroll). You get confirmed bookings, clean Postgres records, and a calmer service.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.