Skip to main content

Automated WhatsApp lead nurturing with personalized messages via Postgres & Gallabox

Workflow preview

Workflow preview
100%
Automated WhatsApp lead nurturing with personalized messages via Postgres & Gallabox preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

n8n Workflow: WhatsApp Lead Nurturing (MQL) Purpose This workflow fetches unqualified leads from Postgres at defined retry intervals, sends personalized WhatsApp template messages via Gallabox A...

Best for

  • Lead Nurturing automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.postgres, n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.code, n8n-nodes-base.splitinbatches, n8n-nodes-base.httprequest

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Rahi Uppal.

Original n8n.io source

1.1 Workflow description

Title
Automated WhatsApp lead nurturing with personalized messages via Postgres & Gallabox
Workflow name
Automated WhatsApp lead nurturing with personalized messages via Postgres & Gallabox

n8n Workflow: WhatsApp Lead Nurturing (MQL)

🔄 Purpose

This workflow fetches unqualified leads from Postgres at defined retry intervals, sends personalized WhatsApp template messages via Gallabox API, and logs message activity while updating lead status in the database.


đź§© Workflow Structure

  1. Schedule Trigger

    • Type: n8n-nodes-base.scheduleTrigger
    • Runs the workflow automatically at set intervals (seconds-based).
    • Entry point of the workflow.
  2. Execute a SQL query

    • Type: n8n-nodes-base.postgres
    • Fetches leads from mql_contacts that:
      • Have count = 0, 1, 2, or 3.
      • Respect time delays:
        • count=1 → after 3 minutes
        • count=2 → after 5 minutes
        • count=3 → after 8 minutes
      • Must have disposition = unqualified.
  3. Loop Over Items4

    • Type: n8n-nodes-base.splitInBatches
    • Iterates over each lead individually.
    • Ensures one-by-one processing.
  4. Code1

    • Type: n8n-nodes-base.code
    • Selects message content based on:
      • Lead’s model (nexus, magnus, reo, general).
      • Current count (0–3).
    • Ensures personalized, varied message text.
  5. new_lead_4

    • Type: n8n-nodes-base.httpRequest
    • Sends WhatsApp template message through Gallabox API.
    • Dynamic fields:
      • Lead’s name and phone.
      • Message details selected from Code1.
      • Quick reply buttons: Show Brochure, Get Showroom Location, Not Interested.
  6. Insert rows in a table4

    • Type: n8n-nodes-base.postgres
    • Inserts a record into mql_logs.
    • Captures:
      • Phone, name, disposition.
      • Message count, message_id, timestamps.
      • Gallabox API response (status, code).
  7. Update rows in a table4

    • Type: n8n-nodes-base.postgres
    • Updates mql_contacts:
      • Increments count by 1.
      • Updates last_message_sent timestamp.
      • Matches using phone number.
  8. Sticky Notes

    • Provide inline documentation:
      • SQL query purpose.
      • Message matrix explanation.
      • Gallabox API role.
      • Postgres update/logging details.

⚙️ Data Flow Summary

  • Trigger → Runs every X seconds
  • SQL Query → Fetches eligible leads (unqualified, retry intervals)
  • Loop → Processes each lead sequentially
  • Code1 → Chooses personalized message based on model & count
  • HTTP Request → Sends WhatsApp template via Gallabox
  • Insert Log → Stores activity in mql_logs
  • Update Contact → Updates count & last sent in mql_contacts
  • Cycle repeats until all leads are processed

📊 Use Case

  • Automates WhatsApp drip campaigns for unqualified leads.
  • Respects retry intervals to avoid spamming.
  • Uses personalized message variations based on product model & retry count.
  • Provides full traceability with logs and lead updates.

1.2 Logical Blocks

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.

2. Block-by-Block Analysis

Block 1 - Execute a SQL query

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 4 - Code1

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Loop Over Items4

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 6 - new_lead_4

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 7 - Update rows in a table4

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 8 - Insert rows in a table4

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 9 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automated WhatsApp lead nurturing with personalized messages via Postgres & Gallabox
Complexity intermediate
Nodes 11
Categories Lead Nurturing, Multimodal AI
Author Rahi Uppal
Published 21 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7712/7712.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

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.

Frequently asked questions

What does Automated WhatsApp lead nurturing with personalized messages via Postgres & Gallabox do?

n8n Workflow: WhatsApp Lead Nurturing (MQL) Purpose This workflow fetches unqualified leads from Postgres at defined retry intervals, sends personalized WhatsApp template messages via Gallabox A...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

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, Multimodal AI use case.