AutomationFlowsEmail & Gmail › Collect Whatsapp Questionnaire Responses in Postgres (module "anketa")

Collect Whatsapp Questionnaire Responses in Postgres (module "anketa")

ByAndrew @boanse on n8n.io

This workflow is designed for businesses or organizations looking to collect and store user responses from questionnaires via a WhatsApp bot, with data saved in a Postgres database.

Event trigger★★★★★ complexity32 nodesWhatsApp TriggerWhatsAppPostgres
Email & Gmail Trigger: Event Nodes: 32 Complexity: ★★★★★ Added:

This workflow corresponds to n8n.io template #3653 — we link there as the canonical source.

This workflow follows the WhatsApp → WhatsApp Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "5vWy0IdYDMinpbbv",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "WA-Bot-Module-Anketa-v1-db-sell-full",
  "tags": [
    {
      "id": "XPad0ERjSdqfxG52",
      "name": "module",
      "createdAt": "2025-03-31T08:11:00.151Z",
      "updatedAt": "2025-03-31T08:11:00.151Z"
    },
    {
      "id": "NeRMkUNq0sRVlL99",
      "name": "whatsapp",
      "createdAt": "2025-03-10T18:20:40.864Z",
      "updatedAt": "2025-03-10T18:20:40.864Z"
    },
    {
      "id": "2ocrWSzdKoCOU2AC",
      "name": "sell",
      "createdAt": "2025-04-19T15:39:51.859Z",
      "updatedAt": "2025-04-19T15:39:51.859Z"
    }
  ],
  "nodes": [
    {
      "id": "74e77f18-8de5-4f3b-95ef-d97b38a8af97",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        40,
        760
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "13dfccbd-47d9-434b-8c54-4b7b33364f49",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        520
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "688a5af7-20df-4292-a6bc-d28e93aa4a24",
      "name": "Starts",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        480,
        560
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c31015af-d2ea-477a-b039-f99d4994a334",
      "name": "Get Bot Status",
      "type": "n8n-nodes-base.postgres",
      "position": [
        480,
        760
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "7db6bdbb-e9c8-4b1f-9a8d-f65557884af6",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        1340
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3ccf8ac8-78b4-4332-a92f-c0c6ccdea135",
      "name": "Commands",
      "type": "n8n-nodes-base.switch",
      "position": [
        980,
        760
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "c88213ae-81d5-4bfa-9de0-7fa45979abd6",
      "name": "Main Menu",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1260,
        560
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a7411083-1ad9-4295-9f16-86baccb234b9",
      "name": "Initialization",
      "type": "n8n-nodes-base.set",
      "position": [
        260,
        760
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "173729da-c067-4a76-93df-35d2ffbcfd54",
      "name": "Starts Test",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1260,
        760
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2ce61e6d-bca9-4efd-8fd3-3a9e2ad9b590",
      "name": "Get First Question",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1480,
        760
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "d8747f70-ab23-49ee-87ec-798786711bd9",
      "name": "Update Bot Status on ANKETA",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1920,
        760
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "d88b9f5d-7529-4a20-89a5-4007f30b9535",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1860,
        720
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f57e0e75-49e9-42ff-965d-b5cb6084ebee",
      "name": "Define Flow",
      "type": "n8n-nodes-base.switch",
      "position": [
        700,
        760
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "0fc45a08-2719-43fb-8999-637b68d29ce0",
      "name": "Update Bot Status on START",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2340,
        1180
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "786e1ad6-5bb8-4ac5-a923-fafadabcc499",
      "name": "Get Available Questions",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1700,
        980
      ],
      "parameters": {},
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "5ebe7749-4f5f-44ec-b041-16a9a62e93cd",
      "name": "Is Questions available?",
      "type": "n8n-nodes-base.if",
      "position": [
        1920,
        980
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.2
    },
    {
      "id": "b65f351d-78b5-46da-bd73-93d0ceb2a919",
      "name": "Is Question found? ",
      "type": "n8n-nodes-base.if",
      "position": [
        1480,
        980
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "2cccfa58-1492-4420-ab5b-42f16ac53e96",
      "name": "First Question",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1700,
        760
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "feacdb2b-de64-4784-85e8-a12b35992384",
      "name": "Question",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2140,
        980
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "df3eb202-da56-4c03-b4c4-61b557d786eb",
      "name": "Add prev Answer",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2340,
        980
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "a6818f00-dd39-4cbd-8f0a-018a80ef6064",
      "name": "Add Answer",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1700,
        1180
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "104a660d-5032-413f-a72f-62ae74e9d12f",
      "name": "Finish Anketa",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2140,
        1180
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "11b6580c-f083-45c6-8524-424c2ceef63b",
      "name": "Get prev Answer",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        980
      ],
      "parameters": {},
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "bfb2e3bd-7663-449d-8e61-b6125935aa3b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        720
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "5d5d103e-9365-4f62-9efe-8199ed8f5ce5",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        960
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "199c0247-ecbd-4693-9572-1e70da007b44",
      "name": "Upsert Bot Status on START",
      "type": "n8n-nodes-base.postgres",
      "position": [
        700,
        560
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "a164b652-b8cc-4edf-a552-293d613deb2e",
      "name": "Add prev Answer ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2140,
        760
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "60a9c88a-c156-4b3f-abfd-f2f30b492058",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        760
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1c5c37c4-89e8-4ed4-9013-0a9c3c1748d1",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        520
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "70f96a8e-c191-4f0e-9073-1f9bb1e8ef36",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        1080
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d4f4e891-0c3b-425f-9dab-c83396cf4e27",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        1080
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "679715b4-677a-42c4-93ae-aba55a6cdc49",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        520
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e4ca2f56-6081-4e5f-814f-98bea4d20b0a",
  "connections": {
    "Starts": {
      "main": [
        [
          {
            "node": "Upsert Bot Status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Commands": {
      "main": [
        [
          {
            "node": "Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Starts Test",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Question": {
      "main": [
        [
          {
            "node": "Add prev Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Answer": {
      "main": [
        [
          {
            "node": "Get Available Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define Flow": {
      "main": [
        [
          {
            "node": "Starts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Commands",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get prev Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Starts Test": {
      "main": [
        [
          {
            "node": "Get First Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Finish Anketa": {
      "main": [
        [
          {
            "node": "Update Bot Status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "First Question": {
      "main": [
        [
          {
            "node": "Update Bot Status on ANKETA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Bot Status": {
      "main": [
        [
          {
            "node": "Define Flow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialization": {
      "main": [
        [
          {
            "node": "Get Bot Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get prev Answer": {
      "main": [
        [
          {
            "node": "Is Question found? ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Initialization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get First Question": {
      "main": [
        [
          {
            "node": "First Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Question found? ": {
      "main": [
        [
          {
            "node": "Get Available Questions",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Available Questions": {
      "main": [
        [
          {
            "node": "Is Questions available?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Questions available?": {
      "main": [
        [
          {
            "node": "Question",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Finish Anketa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Bot Status on START": {
      "main": [
        []
      ]
    },
    "Update Bot Status on ANKETA": {
      "main": [
        [
          {
            "node": "Add prev Answer ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow is designed for businesses or organizations looking to collect and store user responses from questionnaires via a WhatsApp bot, with data saved in a Postgres database.

Source: https://n8n.io/workflows/3653/ — original creator credit. Request a take-down →

More Email & Gmail workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Email & Gmail

How it works: This bot operates in a continuous WhatsApp monitoring loop. It analyzes messages to detect keywords in common questions (like hours, prices, and location) and sends automatic replies wit

WhatsApp Trigger, WhatsApp
Email & Gmail

Create viral TikTok videos effortlessly — no editing skills required!

HTTP Request, OpenAI, Form Trigger +6
Email & Gmail

This template is ideal for educators, HR professionals, and anyone looking to automate testing and collect responses through Telegram, while storing results in a Postgres database.

Telegram, Postgres, Telegram Trigger
Email & Gmail

Loxone MCP Client - Integration Hub. Uses start, googleCalendar, slack, mcp. Event-driven trigger; 20 nodes.

Start, Google Calendar, Slack +4
Email & Gmail

ch3. Uses postgres, formTrigger, gmail, form. Event-driven trigger; 19 nodes.

Postgres, Form Trigger, Gmail +2