{
  "id": "UWIy3RqubCcMGQbb",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Restaurants Marketing Machine",
  "tags": [],
  "nodes": [
    {
      "id": "1f125e88-0b82-4872-b6e9-4703203422a9",
      "name": "Get Message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -640,
        48
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "7ab7bdc5-7e43-4c9c-b6bd-4d06a16ad2d3",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -656
      ],
      "parameters": {
        "width": 880,
        "height": 352,
        "content": "## Turn Restaurants into a Leads and Review-Generating Machine with Telegram & Google Sheets\n\n### How it works\n\nThis workflow automates two connected processes for a restaurant: customer interaction and scheduled marketing. When a customer messages the Telegram bot, the workflow detects the message type, responds with the digital menu when requested, stores the customer in Google Sheets, and sends a review request after a 2-hour delay. In parallel, a daily schedule checks Google Sheets for pending campaigns, filters active customers, sends marketing messages automatically, and marks each campaign as completed to avoid duplicate sends.\n\n### Setup steps\n\nSet up a Telegram bot in BotFather, connect its API credentials to the Telegram nodes in n8n, and activate the webhook for the trigger. Then create a Google Sheet with `Clients` and `Marketing` tabs, connect Google Sheets credentials, and make sure the required columns are present for customer tracking and campaign management. Finally, customize the menu link, review link, and send time in the workflow, then activate the workflow in n8n.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "edc9de89-5389-452d-b055-84a3ae1e5a50",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -640,
        496
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "63f81978-97cb-4ab1-84e3-90970ca19a51",
      "name": "Get Marketing",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -320,
        496
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "DONE"
            },
            {
              "lookupValue": "={{ $now.format('yyyy-LL-dd') }}",
              "lookupColumn": "DATE"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1613973742,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4/edit#gid=1613973742",
          "cachedResultName": "Marketing"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4/edit?usp=drivesdk",
          "cachedResultName": "Restaurant Database Clients"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "62fb0768-c7d2-411f-81f9-cd0482d0d05e",
      "name": "Get active clients",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        64,
        496
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "UNSUBSCRIBE"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4/edit#gid=0",
          "cachedResultName": "Clients"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4/edit?usp=drivesdk",
          "cachedResultName": "Restaurant Database Clients"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "e519b4ab-1eb9-4b1b-89c7-deeac987a58b",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        384,
        496
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "ec1e379f-faf2-43f4-9620-d9b5ec211697",
      "name": "Wait 2 Hours",
      "type": "n8n-nodes-base.wait",
      "position": [
        1008,
        -144
      ],
      "parameters": {
        "unit": "hours",
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "1e896ff8-98cb-4bf9-96da-318599a63638",
      "name": "Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        -320,
        32
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "781f3f3d-db23-4eae-a214-4c9193fd772f",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.text}}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Audio",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7b2cb4dc-dd9d-43b2-b4db-f0de858f46cc",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.voice.file_id }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Immagine",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "98d80a35-3004-4bad-95b8-e87fc9270083",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.photo[0] }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "executeOnce": false,
      "typeVersion": 3.2,
      "alwaysOutputData": false
    },
    {
      "id": "961ff4d1-4881-4c93-aded-c889a2878d95",
      "name": "Menu?",
      "type": "n8n-nodes-base.switch",
      "position": [
        48,
        -144
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Menu",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "f43bfc1b-411b-449d-9b65-a3f02e01e2f8",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": "I would like to see the menu"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.4
    },
    {
      "id": "d9cdcc35-5b83-42bb-94db-55da7b83a0ec",
      "name": "Send Digital Menu",
      "type": "n8n-nodes-base.telegram",
      "position": [
        368,
        -144
      ],
      "parameters": {
        "text": "Hi, this is the Menu: https://go.forkmenu.com/demo",
        "chatId": "={{ $('Get Message').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5c0bc3ca-4701-4d7d-b7f9-b2a977a11c37",
      "name": "Add new client",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        704,
        -144
      ],
      "parameters": {
        "columns": {
          "value": {
            "DATE": "={{$now.format('yyyy-MM-dd')}}",
            "CLIENT": "={{ $('Get Message').item.json.message.from.id }}"
          },
          "schema": [
            {
              "id": "DATE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "DATE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CLIENT",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "CLIENT",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "CLIENT"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4/edit#gid=0",
          "cachedResultName": "Clients"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4/edit?usp=drivesdk",
          "cachedResultName": "Restaurant Database Clients"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "8c6da13a-6421-4d9e-bba0-cd34ebfb3ea6",
      "name": "Send request review",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1328,
        -144
      ],
      "parameters": {
        "text": "We hope you enjoyed your experience at our restaurant. Please consider leaving us a review. https://search.google.com/local/writereview?placeid=xxx",
        "chatId": "={{ $('Get Message').item.json.message.from.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "702307a4-b0f7-42da-8133-4103f904a353",
      "name": "Send complete",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        704,
        336
      ],
      "parameters": {
        "columns": {
          "value": {
            "DONE": "x",
            "row_number": "={{ $('Get Marketing').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "DATE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "DATE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "MESSAGE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "MESSAGE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "DONE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "DONE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1613973742,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4/edit#gid=1613973742",
          "cachedResultName": "Marketing"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4/edit?usp=drivesdk",
          "cachedResultName": "Restaurant Database Clients"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c92e111c-f981-4459-8e80-61f5a3bcc3ce",
      "name": "Send Marketing message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        704,
        656
      ],
      "parameters": {
        "text": "={{ $('Get Marketing').item.json.MESSAGE }}",
        "chatId": "={{ $json.CLIENT }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "84ab31b8-fcaf-4020-a676-29b8060e6a48",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        -128
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 368,
        "content": "## STEP 1 - Telegram Bot\n\nCreate and configure your Telegram bot. Send this URL to the client (https://t.me/YOUR_BOT?text=I+would+like+to+see+the+menu\n), replacing YOUR_BOT with your bot username. A QR code is recommended."
      },
      "typeVersion": 1
    },
    {
      "id": "83138b3b-04b3-494a-8d53-41683c73b85d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -272
      ],
      "parameters": {
        "color": 7,
        "width": 880,
        "height": 304,
        "content": "## STEP  2 - Send Restaurant Menu Link\n[Clone this Sheet](https://docs.google.com/spreadsheets/d/1Pzs_xlK6drjIhHnI7S1i2amLgT15dzuzkTKLbKcGpE4/edit?usp=sharing). Replacing your Digital Menu Link in Telegram node"
      },
      "typeVersion": 1
    },
    {
      "id": "5dde52c4-5a49-4bdc-b58f-4ded4c74a493",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -272
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 304,
        "content": "## STEP 3 - Follow-up\nThe workflow waits for 2 hours (simulating post-dining time) and then automatically sends a follow-up message asking the customer to leave a Google review. Replace your reviews Link"
      },
      "typeVersion": 1
    },
    {
      "id": "811e79a9-bce3-4711-a3a6-0b818a7468e5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        384
      ],
      "parameters": {
        "color": 7,
        "width": 1056,
        "height": 304,
        "content": "## STEP4 - Marketing Message\nIn the \"Marketing\" tab schedule your Marketing messages. A Schedule Trigger runs daily at 7:00 AM"
      },
      "typeVersion": 1
    },
    {
      "id": "c788e466-36b7-4db2-895f-d89fdb5e5f27",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        208
      ],
      "parameters": {
        "color": 7,
        "width": 656,
        "height": 688,
        "content": "## STEP 5 - Send Marketing Message\nFor each client, it sends the marketing message via Telegram."
      },
      "typeVersion": 1
    },
    {
      "id": "cd8d85cb-dff7-4466-9311-762b30533b11",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -1040
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 736,
        "content": "## MY NEW YOUTUBE CHANNEL\n\ud83d\udc49 [Subscribe to my new **YouTube channel**](https://youtube.com/@n3witalia). Here I\u2019ll share videos and Shorts with practical tutorials and **FREE templates for n8n**.\n\n[![image](https://n3wstorage.b-cdn.net/n3witalia/youtube-n8n-cover.jpg)](https://youtube.com/@n3witalia)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "37f07588-40e2-419b-84ad-e3ef942d7b2d",
  "connections": {
    "Type": {
      "main": [
        [
          {
            "node": "Menu?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Menu?": {
      "main": [
        [
          {
            "node": "Send Digital Menu",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Message": {
      "main": [
        [
          {
            "node": "Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 2 Hours": {
      "main": [
        [
          {
            "node": "Send request review",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Marketing": {
      "main": [
        [
          {
            "node": "Get active clients",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add new client": {
      "main": [
        [
          {
            "node": "Wait 2 Hours",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Send complete",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Marketing message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Marketing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Digital Menu": {
      "main": [
        [
          {
            "node": "Add new client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get active clients": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Marketing message": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}