Block 1 - Postgres Trigger1
- Type / Role
- n8n-nodes-base.postgresTrigger - postgresTrigger
- Config choices
- Version 1
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 paymen...
n8n-nodes-base.postgrestrigger, n8n-nodes-base.postgres, n8n-nodes-base.splitinbatches, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgroq, n8n-nodes-base.code, n8n-nodes-base.gmail, n8n-nodes-base.merge
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Avkash Kakdiya.
Original n8n.io sourceThis 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 agent. The message is delivered via email and WhatsApp and finally logged in Google Sheets for tracking and auditing.
Step 1: Fetch and prepare completed orders for AI processing
Postgres Trigger – Watches the orders table for updates and initiates the workflow.
Postgres (Execute query) – Fetches only orders marked as completed.
Split In Batches – Loops through completed orders safely and sequentially.
Postgres (Execute query) – Retrieves full customer, product, and payment details using joins.
AI Agent – Generates a personalized post-purchase message using order data.
Groq Chat Model – Supplies the language model used by the AI agent.
Merge – Combines AI-generated text with database results for downstream use.
Step 2: Deliver messages and log post-purchase communication
Code – Formats AI output into clean email and WhatsApp message templates.
Gmail – Sends the post-purchase email to the customer.
WhatsApp – Sends the same message via WhatsApp.
Set – Flags email and WhatsApp messages as successfully sent.
Google Sheets – Appends customer, order, and communication details.
Wait – Pauses before continuing to process the next completed order.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Send AI-powered post-purchase emails and WhatsApp messages from PostgreSQL to Google Sheets with Groq |
|---|---|
| Complexity | advanced |
| Nodes | 16 |
| Categories | Lead Nurturing, AI Chatbot |
| Author | Avkash Kakdiya |
| Published | 13 Jan 2026 |
Use the JSON export at /data/workflows/12673/12673.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
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 paymen...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Nurturing, AI Chatbot use case.