AutomationMart
Home/Browse/Manage coupon campaigns and customer chats with WhatsApp and PostgreSQL
n8n

Manage coupon campaigns and customer chats with WhatsApp and PostgreSQL

n8nn8n116 modulesv1.0
WhatsAppTelegramFacebook

Coupon Bot Dashboard & WhatsApp Management System A complete bilingual admin dashboard and WhatsApp bot solution for managing discount coupons, partner companies, and customer conversations through an intuitive web interface and automated chatbot. What does this workflow do? This workflow provides a comprehensive coupon management system with dual interfaces: a modern Vue.js admin dashboard for managers and an interactive WhatsApp bot for customers. It handles everything from company onboarding

At a glance

Manage coupon campaigns and customer chats with WhatsApp and PostgreSQL is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects WhatsApp, Telegram, Facebook. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
WhatsApp, Telegram, Facebook
Modules
116
Price
Free
Version
v1.0
Manage coupon campaigns and customer chats with WhatsApp and PostgreSQL workflow diagram

About this workflow

Coupon Bot Dashboard & WhatsApp Management System A complete bilingual admin dashboard and WhatsApp bot solution for managing discount coupons, partner companies, and customer conversations through an intuitive web interface and automated chatbot. What does this workflow do? This workflow provides a comprehensive coupon management system with dual interfaces: a modern Vue.js admin dashboard for managers and an interactive WhatsApp bot for customers. It handles everything from company onboarding and coupon issuance to real-time customer support and conversation tracking. Key features: - 🎛️ Admin Dashboard - Full-featured Vue.js 3 interface with Tailwind CSS for managing companies, coupons, and viewing analytics - 🤖 WhatsApp Bot - Automated customer service bot with session-based state management - 🏢 Company Management - CRUD operations for partner companies and their coupon catalogs - 🎫 Advanced Coupon System - Support for percentage/fixed discounts, expiry dates, minimum purchase requirements, and maximum discount caps - 💬 Real-time Inbox - Live chat interface for viewing customer conversation history - 🌐 Bilingual Support - Full Arabic (RTL) and English interface support - 📊 Analytics Dashboard - Track customers, messages, coupons issued, and partner companies - 🔧 Database Tools - Built-in schema initialization and migration capabilities - 👤 Role-Based Access - Separate admin and customer flows with phone number authentication Setup Requirements Integrations Needed: 1. PostgreSQL - Primary database for all system data 2. WhatsApp Business API - For customer bot interactions via Facebook Graph API 3. n8n - Workflow automation platform (self-hosted or cloud) Credentials Required: - PostgreSQL database credentials (host, port, database, user, password) - WhatsApp Business API Bearer Token (Facebook Graph API v22.0) - Phone Number ID from WhatsApp Business account How to Use Initial Setup: 1. Import the workflow into your n8n instance 2. Configure PostgreSQL credentials - Connect to your database (named "discounts DB" in the workflow) 3. Configure WhatsApp credentials - Add your Facebook Graph API Bearer Token 4. Initialize the database - Send POST request to /webhook/coupon-bot/execute-init to create all tables 5. Set admin phone - Access dashboard at /webhook/coupon-bot/dashboard, go to Settings, and set your admin phone number 6. Configure WhatsApp webhook - Point your WhatsApp Business webhook to /webhook/whatsapp Dashboard Access: - URL: /webhook/coupon-bot/dashboard - Features: Statistics, Company Management, Coupon Management, Inbox, System Settings Admin WhatsApp Commands: Once your phone is set as admin, send any message to the bot to access: - Add/Edit/Delete Companies - Add/Edit/Delete Coupons - Edit Welcome/End Messages - Browse as regular customer Workflow Structure 1. Dashboard Webhook (/coupon-bot/dashboard) Serves the complete Vue.js 3 admin interface with: - Responsive RTL layout for Arabic - Mobile-optimized sidebar navigation - Real-time statistics cards - Company and coupon management forms - Interactive inbox with chat history - System settings and database maintenance tools 2. API Endpoints (/coupon-bot/api/) RESTful API routes for dashboard operations: - POST /stats - System analytics (customers, messages, records, companies) - POST /companies - CRUD operations for partner companies - POST /coupons - CRUD operations with advanced fields (percentage, expiry, limits) - POST /inbox - Retrieve unique customer conversations - POST /history - Fetch complete chat history for a customer - POST /settings - Manage admin phone and message templates - POST /customers - Customer records retrieval - POST /records - Coupon redemption tracking 3. Database Management (/coupon-bot/execute-init, /coupon-bot/migrate) - Full Initialization - Creates all tables: customers, companies, coupons, records, messages, settings, sessions - Schema Migration - Non-destructive updates to add missing columns and constraints - Repair Tools - Fixes corrupted data and ensures schema consistency 4. WhatsApp Bot Handler (/webhook/whatsapp) Processes incoming WhatsApp messages with: - Authentication - Detects admin vs. regular customers by phone number - Session Management - PostgreSQL-based state machine for multi-step conversations - Interactive Messages - List menus for company/coupon selection - Message Logging - All incoming/outgoing messages stored for inbox feature 5. Customer Flow (Regular Users) 1. Receive welcome message from settings 2. Browse list of partner companies 3. Select company to view available coupons 4. Choose coupon to receive details 5. Get end message with coupon code and terms 6. Admin Flow (Authenticated Users) 1. Access main management menu 2. Manage companies (add, edit, delete) 3. Manage coupons (add with advanced options, edit, delete) 4. Customize welcome and end messages 5. Test customer experience Database Schema customers companies coupons records messages settings sessions Session States (State Machine) The bot uses PostgreSQL sessions for conversation persistence: - IDLE - Default state, waiting for input - WAITINGCOMPANYNAME - Admin adding new company - WAITINGEDITCOMPANYSELECT - Admin selecting company to edit - WAITINGEDITCOMPANYNAME - Admin entering new company name - WAITINGDELETECOMPANYSELECT - Admin selecting company to delete - WAITINGADDCOUPONCOMPANY - Admin selecting company for new coupon - WAITINGADDCOUPONTEXT - Admin entering coupon code - WAITINGADDCOUPONVALUE - Admin entering discount value - WAITINGEDITCOUPONSELECT - Admin selecting coupon to edit - WAITINGEDITCOUPONTEXT - Admin entering new coupon code - WAITINGDELETECOUPONSELECT - Admin selecting coupon to delete - EDITWELCOME - Admin updating welcome message - EDITEND - Admin updating end message Message Templates Default Welcome Message (Customizable): Default End Message (Customizable): Customization Tips - Add more languages: Extend the dashboard and bot to support additional languages beyond Arabic/English - Coupon restrictions: Use the advanced coupon fields to set minimum purchase amounts, maximum discount caps, and expiry dates - Analytics enhancement: Add more statistics nodes to track coupon usage by company or time period - Telegram integration: Duplicate the WhatsApp webhook nodes and modify for Telegram Bot API - Email notifications: Add SMTP nodes to send coupon details via email - Multi-admin support: Modify the settings schema to support multiple admin phone numbers - Coupon categories: Add a categories table and filter coupons by category in the bot Use Cases - Marketing agencies managing discount campaigns for multiple clients - E-commerce platforms offering partner store coupons - Loyalty programs with tiered discount systems - Event-based promotional campaigns with expiry dates - Multi-vendor marketplaces with individual seller coupons - Customer retention programs with personalized offers Technical Notes - Frontend: Vue.js 3 (Composition API) + Tailwind CSS + Font Awesome icons - Backend: n8n workflow automation with PostgreSQL - WhatsApp API: Facebook Graph API v22.0 with interactive list messages - Security: Phone number-based admin authentication, SQL injection protection via parameterized queries - Performance: Database indexing on phone numbers and foreign keys, session cleanup recommended - Mobile: Fully responsive dashboard with mobile-optimized WhatsApp interactions --- Tags: #n8n #whatsapp #coupons #dashboard #vuejs #postgresql #automation #customer-service #bilingual

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Clone and change your voice 🤖🎙️with Elevenlabs and Telegram

This workflow creates a voice AI assistant accessible via Telegram that leverages ElevenLabs powerful voice synthesis technology. Users can either clone their own voice or transform their voice using pre-existing voice models, all through simple voice messages sent to a Telegram bot. ONLY FOR STARTER, CREATOR, PRO PLAN This workflow allows users to: 1. Clone their voice by sending a voice message to a Telegram bot (creates a new voice pro

Free

Add the links shortened by lc.cx to a Telegram channel

Every time there is a new link shortened in lc.cx, Make will automatically post a message containing the link and additional information in Telegram.

Free

Create & upload AI-generated ASMR YouTube Shorts with Seedance, Fal AI, and GPT-4

ASMR AI Workflow Who is this for? Content Creators, YouTube Automation Enthusiasts, and AI Hobbyists looking to autonomously generate and publish unique, satisfying ASMR-style YouTube Shorts without manual effort. What problem does this solve? This workflow solves the creative bottleneck and time-consuming nature of daily content creation. It fully automates the entire production pipeline, from brainstorming trendy ideas to publishing a fini

Free

Manage calendar with voice & text using GPT-4, Telegram & Google Calendar

Manage Calendar with Voice & Text Commands using GPT-4, Telegram & Google Calendar This n8n workflow transforms your Telegram bot into a personal AI calendar assistant, capable of understanding both voice and text commands in Romanian, and managing your Google Calendar using the GPT-4 model via LangChain. Whether you want to create, update, fetch, or delete events, you can simply speak or write your request to your Telegram bot — and the assistant takes care of the rest.

Free

Generate cinematic videos from text prompts with GPT-4o, Fal.AI Seedance & Audio

Who’s it for? This workflow is built for: - AI storytellers, content creators, YouTubers, and short-form video marketers - Anyone looking to transform text prompts into cinematic AI-generated videos fully automatically - Educators, trainers, or agencies creating story-based visual content at scale --- What It Does This n8n workflow allows you to automatically turn a simple text prompt into a multi-scene cinematic video, using the powerful Fa

Free

Generate replies in Telegram using OpenAI GPT-3 completions

Automatically generate and send personalized replies in Telegram using OpenAI GPT-3 completions for engaging and timely communication with your audience.

Free

Generate weekly Instagram Reels ideas from Google News with OpenAI and Notion

This n8n workflow automatically generates weekly Instagram Reel content ideas for a D2C brand using fresh Google News trends. In this example, the workflow is configured for a skincare brand called GlowCare, but it can be reused for any D2C brand by simply changing the RSS URL and updating the brand details inside the AI prompt. Any D2C brand can use this workflow by simply changing the Google News RSS URL based on their niche. For example: - Skincare brand → skincare trends, skincare routine, s

Free

AI-powered email replies with spam filtering & FAQ lookup using GPT-4o mini & Pinecone

This n8n workflow automates the handling of incoming emails. It detects and filters out spam, searches a knowledge base (FAQ) stored in a Pinecone vector database, and sends a reply using Gmail — all powered by an AI model (GPT-4o mini). How It Works 1. Receiving Emails - The Gmail Trigger node checks a Gmail inbox every hour. - When a new email arrives, it starts the workflow. 2. Fetching Full Email Content - The getmessage node retrieves all the details of the message: sender, subject, text, m

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free