Templates / Send AI-powered post-purchase emails and WhatsApp messages from PostgreSQL to Google Sheets with Groq

Send AI-powered post-purchase emails and WhatsApp messages from PostgreSQL to Google Sheets with Groq

Ready for 3.0

by Avkash Kakdiya ✓ · 214 views · created 2026-01-13 · Lead Nurturing, AI Chatbot

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 13 nodes and runs on Postgres events. Along the way it connects Postgres, Groq Chat Model, Gmail and WhatsApp Business Cloud and 1 more.

How it runs

Trigger: On Postgres events.

  1. Execute a SQL query (Postgres): run a query
  2. Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
  3. Execute a SQL query (Postgres): run a query
  4. AI Agent: runs an AI agent, with model: Groq Chat Model
  5. Merge: merges the data from its input branches
  6. Format AI response (Code): runs custom JavaScript code
  7. Send a message (Gmail): uses Gmail
  8. Send message (WhatsApp Business Cloud): send
  9. Edit Fields (Edit Fields (Set)): sets 8 fields: customer_name, product_name, email…
  10. Append row in sheet (Google Sheets): append

…plus 1 more step. See the full node list below.

Services it uses

PostgresGroq Chat ModelGmailWhatsApp Business CloudGoogle Sheets

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (12)

From the author

How it works This workflow automatically detects completed orders in PostgreSQL and prepares them for AI-based post-purchase communication. It enriches each order with customer, product, and payment data, then generates a personalized message using an AI…

Excerpt from Avkash Kakdiya's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.