AutomationFlowsSlack & Telegram › Automated Customer Reservations via Telegram and Postgresql (module "booking")

Automated Customer Reservations via Telegram and Postgresql (module "booking")

ByAndrew @boanse on n8n.io

This workflow is for businesses or services that require managing customer reservations or appointments through a Telegram bot and storing reservation details in a PostgreSQL database.

Event trigger★★★★★ complexity49 nodesPostgresWhatsAppWhatsApp Trigger
Slack & Telegram Trigger: Event Nodes: 49 Complexity: ★★★★★ Added:

This workflow corresponds to n8n.io template #3651 — 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": "AJTY10KEqzGWzQ8p",
  "name": "WA-Bot-Module-Booking-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": "49db5bb8-bcae-44c1-a215-5d8d1c125f5e",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1800,
        -60
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b7d46289-6bfd-4639-acb9-951969bd88e7",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1800,
        200
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3c4778a1-6806-442d-a50a-de0e87089169",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1800,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6c2acf36-0c01-4984-ac42-662f4f6ea072",
      "name": "Update Name",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2300,
        1240
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "2ac3bcd1-a090-48fd-a133-ffd1c7c6b889",
      "name": "Update Hour",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2300,
        640
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "ee24c24c-5083-49bd-8e0c-cfee8ef6c760",
      "name": "Get Work Hours",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2740,
        240
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "8d602e70-38e7-4639-9cec-b45e4ac46c68",
      "name": "Get Work Days",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1860,
        -20
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "32910627-3e1f-45dd-a4ec-63132762215c",
      "name": "Update bot status on START",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1860,
        -280
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "d1a8ef06-6507-4e90-8f97-0d28f3abe94a",
      "name": "Is Date correct?",
      "type": "n8n-nodes-base.if",
      "position": [
        2060,
        -20
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "22fa9829-ef33-4a20-a6c9-a03442c0dbab",
      "name": "Commands",
      "type": "n8n-nodes-base.switch",
      "position": [
        1360,
        -80
      ],
      "parameters": {},
      "retryOnFail": false,
      "typeVersion": 3.2
    },
    {
      "id": "fca9aaf7-53cb-4c5d-91d2-2cb1a8591c2f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "62ea839f-f934-4862-8709-a08d1a9d5e5c",
      "name": "Starts",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        860,
        -280
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "946b34a4-b9b4-4dc0-884c-d897f4f0987b",
      "name": "Get Bot Status",
      "type": "n8n-nodes-base.postgres",
      "position": [
        860,
        -80
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "491739c5-8dff-489a-9565-02fc4f5edf7e",
      "name": "Upsert Bot Status on START",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1080,
        -280
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "33d1bfa8-a7f1-4d28-8178-765436763a25",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        420,
        -80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8e174865-d332-4e16-a0a0-25723635de87",
      "name": "Define Flow",
      "type": "n8n-nodes-base.switch",
      "position": [
        1080,
        -80
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "d6bc1318-df4c-4ef6-b830-66540720df6a",
      "name": "Initialization",
      "type": "n8n-nodes-base.set",
      "position": [
        640,
        -80
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "ec733a20-b9f0-4039-8514-8217ca491b9b",
      "name": "Get book",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1360,
        640
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "d98b2950-df1f-4fc1-b18c-2290b7bf621e",
      "name": "Main Menu",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1640,
        -80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "bd5ebe69-cd98-4c2c-8a5b-ea8114a4a5a4",
      "name": "Request Date",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2740,
        -20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f36f3c9d-4bd6-409d-b7af-9d96b5c03075",
      "name": "Union Number with Question",
      "type": "n8n-nodes-base.set",
      "position": [
        2300,
        -20
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "c8e08639-5b3c-4552-af2e-b0ad0d6c89f3",
      "name": "Union list",
      "type": "n8n-nodes-base.summarize",
      "position": [
        2520,
        -20
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "c2c75379-cec2-43c4-88c4-bc63bd1cde1e",
      "name": "Update bot status on BOOKING",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2960,
        -20
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "fca3d8b1-b320-41ed-9b42-c236679e1e6a",
      "name": "First Question?",
      "type": "n8n-nodes-base.if",
      "position": [
        1860,
        240
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 2.2
    },
    {
      "id": "553efef6-2dd3-40c1-86ca-df2c513dd3bf",
      "name": "Get Work Days ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2060,
        420
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "fa7159a9-57fd-4f35-8c53-9fde5289a23e",
      "name": "Add Book",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2060,
        240
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "85885381-f773-4f8d-8b68-241822d8cd05",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        2300,
        240
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 3
    },
    {
      "id": "ad5bed52-c4c1-4e52-8321-e0ba884ca77d",
      "name": "Union Number with Question1",
      "type": "n8n-nodes-base.set",
      "position": [
        2960,
        240
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "7a58c044-0d1f-470b-894b-5e0f994f9b5c",
      "name": "Union list1",
      "type": "n8n-nodes-base.summarize",
      "position": [
        3180,
        240
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "7c7298b5-7f78-40e0-ab66-4966bf56e9ee",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1640,
        440
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 3
    },
    {
      "id": "e227110c-53de-443b-ad3d-1a8157f80938",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1360,
        440
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "9795ad35-d291-4e82-b2ee-0f898843a535",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        2060,
        640
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "de7099bd-e95f-4c09-b4a2-a0e8708f86b1",
      "name": "Update Date AND Status",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2520,
        240
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "f7c5056a-c6b7-4c61-a0f1-d116754a70aa",
      "name": "Phone validation1",
      "type": "n8n-nodes-base.if",
      "position": [
        2300,
        840
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 2.2
    },
    {
      "id": "f8a30b0c-9b25-433c-8da1-30b25af14c34",
      "name": "Request Phone",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2740,
        640
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8173128a-5c21-40c0-a394-abe62b3b30b8",
      "name": "Request Name",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2740,
        840
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1
    },
    {
      "id": "7b392a56-df82-43fb-9fa3-a7acb1df79e8",
      "name": "Phone Error",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2740,
        1040
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1deb7b7c-07df-414a-ba7d-c421e15ce979",
      "name": "page booking success",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2740,
        1240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d07a6f69-2c2f-4655-8d3a-8b93c25ef911",
      "name": "Update status on BOOKED",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2960,
        1240
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "d994f535-8b42-4ea5-8466-98ecd0988b0e",
      "name": "Update Phone",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2520,
        840
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "4913b0e5-ff41-40d0-adc8-5593d2ae7614",
      "name": "Payments",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1640,
        -280
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5219aa55-5017-4182-bc1a-7f65a6229ac9",
      "name": "Update bot status on PAYMENTS",
      "type": "n8n-nodes-base.postgres",
      "position": [
        3180,
        1240
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "3a9dd518-b8a1-4503-b6bb-5345bf14ab75",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "76705120-761e-45f2-b027-028ba9a88875",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "146316c0-6f31-4701-a3ba-63ddd87e741b",
      "name": "Request Time",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        3400,
        240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d14141f8-5f5c-4f08-9e45-72831e44a01a",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3bd6b336-c195-4aa2-adea-7176222ab22a",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "717ed12c-9495-4ed9-9b81-e89f254bb38c",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a15078a1-f6be-4dcd-b0f8-1eb43a22bdab",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "timezone": "Asia/Almaty",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "e32a293f-ae93-4c83-ad8d-5c9e685c75a8",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "First Question?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Update Date AND Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Starts": {
      "main": [
        [
          {
            "node": "Upsert Bot Status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Update Hour",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Phone validation1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Book": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Commands": {
      "main": [
        [
          {
            "node": "Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Work Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get book": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Payments": {
      "main": [
        [
          {
            "node": "Update bot status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Main Menu": {
      "main": [
        [
          {
            "node": "Update bot status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Union list": {
      "main": [
        [
          {
            "node": "Request Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define Flow": {
      "main": [
        [
          {
            "node": "Starts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Commands",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get book",
            "type": "main",
            "index": 0
          },
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Payments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Union list1": {
      "main": [
        [
          {
            "node": "Request Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Hour": {
      "main": [
        [
          {
            "node": "Request Phone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Name": {
      "main": [
        [
          {
            "node": "page booking success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Date": {
      "main": [
        [
          {
            "node": "Update bot status on BOOKING",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Phone": {
      "main": [
        [
          {
            "node": "Request Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Work Days": {
      "main": [
        [
          {
            "node": "Is Date correct?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Bot Status": {
      "main": [
        [
          {
            "node": "Define Flow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Work Days ": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Get Work Hours": {
      "main": [
        [
          {
            "node": "Union Number with Question1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialization": {
      "main": [
        [
          {
            "node": "Get Bot Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "First Question?": {
      "main": [
        [
          {
            "node": "Add Book",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Work Days ",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Date correct?": {
      "main": [
        [
          {
            "node": "Union Number with Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Initialization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Phone validation1": {
      "main": [
        [
          {
            "node": "Update Phone",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Phone Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "page booking success": {
      "main": [
        [
          {
            "node": "Update status on BOOKED",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Date AND Status": {
      "main": [
        [
          {
            "node": "Get Work Hours",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update status on BOOKED": {
      "main": [
        [
          {
            "node": "Update bot status on PAYMENTS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Union Number with Question": {
      "main": [
        [
          {
            "node": "Union list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Union Number with Question1": {
      "main": [
        [
          {
            "node": "Union list1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update bot status on PAYMENTS": {
      "main": [
        [
          {
            "node": "Payments",
            "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 for businesses or services that require managing customer reservations or appointments through a Telegram bot and storing reservation details in a PostgreSQL database.

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

More Slack & Telegram workflows → · Browse all categories →

Related workflows

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

Slack & Telegram

This workflow is designed for educators, HR teams, or anyone who needs to create and distribute quizzes or tests via WhatsApp and automatically store and analyze responses in a PostgreSQL database.

WhatsApp, Postgres, WhatsApp Trigger
Slack & Telegram

This workflow is designed for businesses or individuals who want to automate responses to frequently asked questions via WhatsApp, while managing their question-and-answer database using Postgres.

WhatsApp Trigger, WhatsApp, Postgres
Slack & Telegram

This workflow is designed for businesses or developers who want to integrate product information into a WhatsApp bot and allow users to retrieve details about products from a database.

WhatsApp Trigger, WhatsApp, Postgres
Slack & Telegram

This comprehensive N8N automation template revolutionizes content creation by delivering a complete end-to-end solution for AI-powered blog generation. Transform simple ideas into fully SEO-optimized,

Slack Trigger, Telegram Trigger, Gmail Trigger +16
Slack & Telegram

This template is ideal for users managing Telegram channels who want to automate the process of posting messages, including text and images, directly from an bot.

Telegram Trigger, Postgres, Telegram