{
  "name": "Manage construction projects with tasks, photo reports, Telegram & Google Sheets",
  "nodes": [
    {
      "id": "649fd633-873c-49ce-990d-36e44c4f5eb1",
      "name": "Are there messages to send?",
      "type": "n8n-nodes-base.if",
      "position": [
        -544,
        800
      ]
    },
    {
      "id": "eecf7a73-1f37-4d8d-9d2a-5089fee13141",
      "name": "Prepare Updates",
      "type": "n8n-nodes-base.code",
      "position": [
        -144,
        784
      ]
    },
    {
      "id": "85037572-c5a2-4f94-8fe2-cdabcc0a04a9",
      "name": "Are there updates?",
      "type": "n8n-nodes-base.if",
      "position": [
        0,
        784
      ]
    },
    {
      "id": "b0250b6f-c00a-44cc-9d7c-30dfdad34a9c",
      "name": "No messages",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -288,
        864
      ]
    },
    {
      "id": "94bc2660-9115-4bec-a3dd-723aea6a004a",
      "name": "No updates",
      "type": "n8n-nodes-base.noOp",
      "position": [
        160,
        912
      ]
    },
    {
      "id": "6f9312ce-00ac-4c41-a514-7cf4877530ce",
      "name": "Check every minute - Photo",
      "type": "n8n-nodes-base.cron",
      "position": [
        -1280,
        800
      ]
    },
    {
      "id": "3f577e09-d0e3-4916-a6f4-2410421167d9",
      "name": "Get photo reports data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1040,
        800
      ]
    },
    {
      "id": "fe036999-2e25-4fef-a677-33b9447ac883",
      "name": "Find and form messages - Photo",
      "type": "n8n-nodes-base.code",
      "position": [
        -784,
        800
      ]
    },
    {
      "id": "66ca6e48-da3b-4743-9a43-b7dbc3ce6aea",
      "name": "Send to Telegram - Photo",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -288,
        672
      ]
    },
    {
      "id": "7171c1ea-6bf8-4690-b39c-11939e8fe4cf",
      "name": "Update status in table - Photo",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        720
      ]
    },
    {
      "id": "d59d2e7e-81c2-494e-b746-aca42239b667",
      "name": "Check every minute - Tasks",
      "type": "n8n-nodes-base.cron",
      "position": [
        -1280,
        224
      ]
    },
    {
      "id": "dbe514b6-6277-47e7-aeb0-64699fd1401f",
      "name": "Get tasks",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1056,
        224
      ]
    },
    {
      "id": "c435a660-e357-48f2-8f3b-8c2bc18aedb6",
      "name": "Find and form messages - Tasks",
      "type": "n8n-nodes-base.code",
      "position": [
        -848,
        224
      ]
    },
    {
      "id": "a3f738eb-22ad-4160-bb1b-06b32a0f2f47",
      "name": "Are there messages to send? - Tasks",
      "type": "n8n-nodes-base.if",
      "position": [
        -656,
        224
      ]
    },
    {
      "id": "705c7afd-1689-4864-927e-c4925c18b2fa",
      "name": "Send to Telegram - Tasks",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -432,
        64
      ]
    },
    {
      "id": "c2d813b6-0b50-44b2-8422-447609a04de6",
      "name": "Prepare updates - Tasks",
      "type": "n8n-nodes-base.code",
      "position": [
        -240,
        208
      ]
    },
    {
      "id": "2368cc21-ed51-4a63-b865-a1dacc5906a7",
      "name": "Are there updates? - Tasks",
      "type": "n8n-nodes-base.if",
      "position": [
        -64,
        208
      ]
    },
    {
      "id": "b3aed171-764d-4677-bd0a-3369cfdce925",
      "name": "Update status in table - Tasks",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        128
      ]
    },
    {
      "id": "4d6f568b-c9ee-4bcf-b724-395e96c377e7",
      "name": "No messages - Tasks",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -416,
        288
      ]
    },
    {
      "id": "f7962f39-a98e-409e-92e8-d272d10463e1",
      "name": "No updates - Tasks",
      "type": "n8n-nodes-base.noOp",
      "position": [
        160,
        304
      ]
    },
    {
      "id": "74780bb6-5901-46cd-87bc-0c68aec00483",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        -64
      ],
      "parameters": {
        "width": 1710,
        "height": 534,
        "content": "## ⏰ AUTOMATIC REMINDERS\n\n### Tasks:\nChecks the task table every minute and sends reminders to executors.\n\n**Priorities:**\n- 🔴 High\n- 🟡 Medium\n- 🟢 Low\n- ⚠️ Reminder"
      }
    },
    {
      "id": "c707b795-1179-4097-93ac-6e8f7f41c6f2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        512
      ],
      "parameters": {
        "width": 1710,
        "height": 566,
        "content": "## ⏰ AUTOMATIC REMINDERS PHOTO REPORTS\n\n### Photo journal:\nChecks the table every minute and sends reminders to send photo reports.\n\n**Logic:**\n- Checks the time of sending\n- Generates a list of recip"
      }
    },
    {
      "id": "e4bbd811-64e3-462a-99fe-35c0dfec0d06",
      "name": "Check register_user1",
      "type": "n8n-nodes-base.if",
      "position": [
        1072,
        128
      ]
    },
    {
      "id": "230ff3e2-c604-4c82-a622-ed10d0f73501",
      "name": "Read users sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1280,
        112
      ]
    },
    {
      "id": "66dd423e-bb7d-4237-b69d-c16a9322c423",
      "name": "Check registration1",
      "type": "n8n-nodes-base.code",
      "position": [
        1456,
        208
      ]
    },
    {
      "id": "005fdb22-cb8e-48a0-98cb-48cb1df5f751",
      "name": "Check new user1",
      "type": "n8n-nodes-base.if",
      "position": [
        1632,
        96
      ]
    },
    {
      "id": "99fdba48-a9a5-4897-b2c7-908c2af25087",
      "name": "Generate welcome1",
      "type": "n8n-nodes-base.code",
      "position": [
        1920,
        272
      ]
    },
    {
      "id": "5922f0b6-daf2-4cc2-8831-e34da87065c6",
      "name": "Check existing user1",
      "type": "n8n-nodes-base.if",
      "position": [
        1632,
        272
      ]
    },
    {
      "id": "e5e6ebd8-52f2-4e1b-a9a7-a1731ae1860c",
      "name": "Telegram Webhook - Receiving messages",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        80,
        1952
      ]
    },
    {
      "id": "6229b502-5c7c-4d86-b6bd-30bd2ca35e00",
      "name": "Check send_message",
      "type": "n8n-nodes-base.if",
      "position": [
        1056,
        304
      ]
    },
    {
      "id": "ecf60d70-b347-4009-92ae-15195b820510",
      "name": "Send message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2352,
        560
      ]
    },
    {
      "id": "cfa18342-6079-43e0-b59a-79235d3c72d8",
      "name": "Check check_status",
      "type": "n8n-nodes-base.if",
      "position": [
        1072,
        752
      ]
    },
    {
      "id": "a1e5ce9a-5a06-4468-99d1-07bc80e85118",
      "name": "Read data for status",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1296,
        752
      ]
    },
    {
      "id": "52fd3be4-0a06-45ae-a001-d54d682a7cf2",
      "name": "Collect status from sheet",
      "type": "n8n-nodes-base.code",
      "position": [
        1472,
        752
      ]
    },
    {
      "id": "c418e056-15a5-4233-b604-78830c30dabb",
      "name": "Generate status message",
      "type": "n8n-nodes-base.code",
      "position": [
        1680,
        752
      ]
    },
    {
      "id": "e1988e2d-0839-4d47-bf6f-14a3429cae88",
      "name": "Check send_report_menu",
      "type": "n8n-nodes-base.if",
      "position": [
        1072,
        608
      ]
    },
    {
      "id": "c19ed2c7-b49b-4dee-9027-73a789c83d90",
      "name": "Check manual_report",
      "type": "n8n-nodes-base.if",
      "position": [
        1072,
        464
      ]
    },
    {
      "id": "4f9ff1b4-2518-45ce-9e80-c41ede66bf30",
      "name": "Request registration data1",
      "type": "n8n-nodes-base.code",
      "position": [
        1920,
        112
      ]
    },
    {
      "id": "22bfd7fe-b9b6-4b59-b789-59dd47631f2f",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        528
      ],
      "parameters": {
        "width": 2094,
        "height": 442,
        "content": "## 🔧 SERVICE COMMANDS\n\n### Available commands:\n- **/start** - system registration\n- **/help** - work guide\n- **/status** - report status for the day\n- **/report** - manual report sending\n- **/read** -"
      }
    },
    {
      "id": "8021cf50-fc7d-4348-bd97-68b8ddad1de9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        -64
      ],
      "parameters": {
        "width": 2096,
        "height": 570,
        "content": "## 👤 REGISTRATION BLOCK\n\n### Process of registering new executors:\n1. **Check registration** - checks if user is in the database\n2. **Request data** - if new, requests name and company\n3. **Save to ta"
      }
    },
    {
      "id": "e91948d6-a532-48e3-a885-937e6dbc13e7",
      "name": "Check read",
      "type": "n8n-nodes-base.if",
      "position": [
        1040,
        1440
      ]
    },
    {
      "id": "5d9a087b-62c5-4368-8226-0b9eee2809f7",
      "name": "Read sheet for read",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1248,
        1472
      ]
    },
    {
      "id": "cbdab081-102d-47b7-ab92-8890d6e47e7a",
      "name": "Prepare read updates",
      "type": "n8n-nodes-base.code",
      "position": [
        1408,
        1472
      ]
    },
    {
      "id": "a62265f0-80a3-4dea-a7d2-feb78b40d90f",
      "name": "Filter read summary",
      "type": "n8n-nodes-base.if",
      "position": [
        1664,
        1312
      ]
    },
    {
      "id": "bcb15f41-9dc6-4889-a23d-38443e62636a",
      "name": "Filter valid read updates",
      "type": "n8n-nodes-base.if",
      "position": [
        1632,
        1504
      ]
    },
    {
      "id": "03d531ac-9cc6-4209-a15f-cd61ef83a109",
      "name": "Update read status in table",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1856,
        1472
      ]
    },
    {
      "id": "4b4937fd-9f96-42b6-8a8c-d7208f7e41e7",
      "name": "Send read confirmation",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2320,
        1360
      ]
    },
    {
      "id": "957aa208-2f46-4d61-9dce-fc85dbea9f7d",
      "name": "Form read response",
      "type": "n8n-nodes-base.code",
      "position": [
        1856,
        1296
      ]
    },
    {
      "id": "5b2225ca-eb89-4738-a734-6fa15f830889",
      "name": "Check no_reply error",
      "type": "n8n-nodes-base.if",
      "position": [
        1040,
        1248
      ]
    },
    {
      "id": "a0383fb5-67b9-4685-b55f-8e8e92484e6b",
      "name": "Error message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1280,
        1232
      ]
    },
    {
      "id": "cce4c92c-ef56-44a9-a7e0-621f0263291c",
      "name": "Check complete_registration1",
      "type": "n8n-nodes-base.if",
      "position": [
        1040,
        1056
      ]
    },
    {
      "id": "92ecb9af-1702-4aa1-8258-e793aa728f4d",
      "name": "Prepare data for recording",
      "type": "n8n-nodes-base.code",
      "position": [
        1280,
        1040
      ]
    },
    {
      "id": "b252ffbd-7662-44cb-bae7-86b2336596f5",
      "name": "Record new executor",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1488,
        1040
      ]
    },
    {
      "id": "46c24921-478d-4081-9711-882db451e685",
      "name": "Confirm registration",
      "type": "n8n-nodes-base.code",
      "position": [
        1696,
        1040
      ]
    },
    {
      "id": "9f04439c-c755-4df4-a3c6-1eab5db91187",
      "name": "Send message2",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1872,
        1040
      ]
    },
    {
      "id": "b40af9b3-0380-4b6c-9ea6-f6493a43a7a8",
      "name": "Group files by task",
      "type": "n8n-nodes-base.code",
      "position": [
        2608,
        1904
      ]
    },
    {
      "id": "b4ab9181-6006-4f04-afe6-f2e7a3a5c35a",
      "name": "Merge lookup and grouped files",
      "type": "n8n-nodes-base.merge",
      "position": [
        2928,
        1888
      ]
    },
    {
      "id": "26923851-ba6b-4cb0-95ff-c0789c89063c",
      "name": "Merge for confirmation",
      "type": "n8n-nodes-base.merge",
      "position": [
        3744,
        1776
      ]
    },
    {
      "id": "55a3223a-885a-4c7e-8dac-a20862223a6f",
      "name": "Prepare confirmation",
      "type": "n8n-nodes-base.code",
      "position": [
        3920,
        1776
      ]
    },
    {
      "id": "d007604b-f5e9-4752-b941-5545f07f700b",
      "name": "Check process_photo3",
      "type": "n8n-nodes-base.if",
      "position": [
        1024,
        1776
      ]
    },
    {
      "id": "f970538b-80cc-4f0e-9e2f-f6f310906cb7",
      "name": "Extract photo data4",
      "type": "n8n-nodes-base.code",
      "position": [
        1248,
        1760
      ]
    },
    {
      "id": "c8f5e55d-be0a-4368-a42b-9465fa31f908",
      "name": "Check error2",
      "type": "n8n-nodes-base.if",
      "position": [
        1440,
        1760
      ]
    },
    {
      "id": "41e8c798-469c-4d52-9a5b-9afda4aafc38",
      "name": "Photo error message4",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1632,
        1744
      ]
    },
    {
      "id": "6d0784dd-f2a1-402e-ae37-08be32e1dea7",
      "name": "Get and download file4",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1632,
        1888
      ]
    },
    {
      "id": "d4c00c7a-6d94-4bfd-a9cb-0edb5264fdbc",
      "name": "Check file presence4",
      "type": "n8n-nodes-base.if",
      "position": [
        1824,
        1888
      ]
    },
    {
      "id": "a27816e9-1d38-4c92-afbe-1943cccaea4e",
      "name": "Upload to Google Drive4",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1984,
        1760
      ]
    },
    {
      "id": "f3708a3c-2716-40db-b288-7168c2587001",
      "name": "Prepare data for writing5",
      "type": "n8n-nodes-base.code",
      "position": [
        2240,
        1760
      ]
    },
    {
      "id": "c58a2e2d-adc1-405b-b6a1-741054623808",
      "name": "Handle retrieval error4",
      "type": "n8n-nodes-base.code",
      "position": [
        2112,
        1904
      ]
    },
    {
      "id": "2d1e3a7d-8212-4c7a-a325-b2fb0779aecc",
      "name": "Merge file streams2",
      "type": "n8n-nodes-base.merge",
      "position": [
        2416,
        1904
      ]
    },
    {
      "id": "7f76eaf7-2bd3-4ad4-8d21-b59d50e5b8a1",
      "name": "Check existing task1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2768,
        1776
      ]
    },
    {
      "id": "dec87f18-482b-43a1-8084-d21da5a32a02",
      "name": "Does task exist?1",
      "type": "n8n-nodes-base.if",
      "position": [
        3088,
        1888
      ]
    },
    {
      "id": "30eda569-64c2-4f4f-b798-47f478138893",
      "name": "Prepare data for adding2",
      "type": "n8n-nodes-base.code",
      "position": [
        3312,
        1904
      ]
    },
    {
      "id": "9abb0a98-62a8-44c1-8e9b-124325c46f49",
      "name": "Update row in table2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3536,
        1680
      ]
    },
    {
      "id": "9c5eaed9-e292-4993-b2fa-ad0034fd8a58",
      "name": "Add to reports table1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3584,
        1904
      ]
    },
    {
      "id": "0f36cd2d-331b-4dff-ba71-c4748b3d2df0",
      "name": "Confirm photo receipt4",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4096,
        1776
      ]
    },
    {
      "id": "1ed50e9e-6966-4298-a335-0db592be5f85",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        1664
      ],
      "parameters": {
        "width": 3756,
        "height": 410,
        "content": "## 🔄 PHOTO PROCESSING FLOW\n\n1. User replies to reminder with photo\n2. System extracts Task ID from reminder text\n3. Photo is uploaded to Google Drive\n4. Checks for existing entry in table\n5. If entry "
      }
    },
    {
      "id": "07110355-e5d3-4e56-a778-0b31f63f57af",
      "name": "Prepare data for updating2",
      "type": "n8n-nodes-base.code",
      "position": [
        3264,
        1728
      ]
    },
    {
      "id": "df10849e-c1ab-4fe7-a675-e97dabfe1d9a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        992
      ],
      "parameters": {
        "width": 2132,
        "height": 648,
        "content": "## 📸 PHOTO REPORT PROCESSING\n\n### Main functionality:\n\n1. **Data extraction** - parsing Task ID from message\n2. **Upload to Drive** - saving photo to Google Drive\n3. **Grouping** - combining multiple "
      }
    },
    {
      "id": "6bba08ac-24cb-4112-aaec-03c00a015e7f",
      "name": "Send Received Confirmation",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2656,
        2704
      ]
    },
    {
      "id": "a2b38395-76fc-4316-96f9-08ae19eb66fb",
      "name": "Check Task Owner1",
      "type": "n8n-nodes-base.if",
      "position": [
        1040,
        2368
      ]
    },
    {
      "id": "1fced70b-f610-49d6-a053-d5a8e9fdd6e6",
      "name": "Get Tasks for Check1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1264,
        2352
      ]
    },
    {
      "id": "ed19e27a-aac0-4160-bd9a-66181caba703",
      "name": "Check ID Match1",
      "type": "n8n-nodes-base.code",
      "position": [
        1408,
        2352
      ]
    },
    {
      "id": "cccccf9e-d50c-447c-bff2-04526e8db29f",
      "name": "Check Process Report1",
      "type": "n8n-nodes-base.if",
      "position": [
        1632,
        2528
      ]
    },
    {
      "id": "365a3a0c-62b8-4d65-860b-0ece4e3f5993",
      "name": "Extract Reports1",
      "type": "n8n-nodes-base.code",
      "position": [
        1840,
        2512
      ]
    },
    {
      "id": "b90c4bdb-ff48-48fa-9bff-854d3cfe3248",
      "name": "Update Task Status1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2032,
        2512
      ]
    },
    {
      "id": "8525cd22-b36a-439b-a21a-dff56bf36d61",
      "name": "Format Confirmation1",
      "type": "n8n-nodes-base.code",
      "position": [
        2240,
        2512
      ]
    },
    {
      "id": "9773f4b5-109d-4eb5-9f63-147edad20bc3",
      "name": "Confirm Report Save1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2448,
        2512
      ]
    },
    {
      "id": "c3045f9a-f609-407b-a99d-70d2d6b01679",
      "name": "Check Received1",
      "type": "n8n-nodes-base.if",
      "position": [
        1632,
        2736
      ]
    },
    {
      "id": "ce47bb4f-34f1-469d-bf83-647f022e7031",
      "name": "Get Tasks for Reading1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1856,
        2720
      ]
    },
    {
      "id": "c83b45cc-353f-4a71-8fc3-deb25c9d77ae",
      "name": "Prepare Read Updates1",
      "type": "n8n-nodes-base.code",
      "position": [
        2064,
        2800
      ]
    },
    {
      "id": "3a9cfcb7-f3b4-46db-8d35-51f25f8737d9",
      "name": "Filter Valid Read Updates1",
      "type": "n8n-nodes-base.if",
      "position": [
        2256,
        2720
      ]
    },
    {
      "id": "1bb7e102-be7d-4fe9-a822-b1d556dcee51",
      "name": "Update Read in Table1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2448,
        2704
      ]
    },
    {
      "id": "156c5228-e414-491d-a35e-b810703cb13d",
      "name": "Check Command1",
      "type": "n8n-nodes-base.if",
      "position": [
        1632,
        2176
      ]
    },
    {
      "id": "18f44efa-7f9c-45cf-9d8f-abcf49c58972",
      "name": "Send Command Response1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1904,
        2160
      ]
    },
    {
      "id": "d03ee9b8-682a-4080-abe5-9248418c6fbd",
      "name": "Check Action Type1",
      "type": "n8n-nodes-base.if",
      "position": [
        1632,
        2352
      ]
    },
    {
      "id": "c70de874-0040-481b-81b0-f83fff22403e",
      "name": "Send Report Form1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1840,
        2336
      ]
    },
    {
      "id": "ab678474-3263-4118-ad40-3f45575283c8",
      "name": "Find Task for GPS",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1648,
        3216
      ]
    },
    {
      "id": "6955ab37-30e6-4d1d-9eab-f0849136159d",
      "name": "Task Found?",
      "type": "n8n-nodes-base.if",
      "position": [
        1840,
        3216
      ]
    },
    {
      "id": "543ba930-4fdb-4fba-958e-6b5bbc92f710",
      "name": "Update GPS in Table",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2032,
        3200
      ]
    },
    {
      "id": "9f4ae758-3f48-404a-ac17-e27e84569f3f",
      "name": "Confirm GPS Receipt",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2224,
        3200
      ]
    },
    {
      "id": "1a2c7d6d-9eb1-42d2-a362-b56ed335adab",
      "name": "Error - Task Not Found",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2032,
        3344
      ]
    },
    {
      "id": "63271c55-c4ef-4272-90b9-27f68be2dfce",
      "name": "Check Process Location2",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        3104
      ]
    },
    {
      "id": "39387dba-8aa9-4f13-814f-59e71f5d9ea4",
      "name": "Extract Location Data1",
      "type": "n8n-nodes-base.code",
      "position": [
        1296,
        3088
      ]
    },
    {
      "id": "8290345b-2a83-4d12-ad6e-fb05ca9a298a",
      "name": "Check Location Error1",
      "type": "n8n-nodes-base.if",
      "position": [
        1456,
        3088
      ]
    },
    {
      "id": "c004e38b-da7c-42d7-b1b0-32a831a59207",
      "name": "Location Error Message1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1648,
        3040
      ]
    },
    {
      "id": "d0cb7670-385f-407a-becb-24caa976f9d6",
      "name": "Process incoming message1",
      "type": "n8n-nodes-base.code",
      "position": [
        288,
        1952
      ]
    },
    {
      "id": "1ec82de5-0b07-4107-9504-816c55ad8279",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        2976
      ],
      "parameters": {
        "width": 2012,
        "height": 548,
        "content": "## 📍 GEOLOCATION PROCESSING\n\n### GPS Coordinates:\n\n- Link to existing report\n- Save coordinates and map link\n- Update record in the table"
      }
    },
    {
      "id": "d61899ec-b8f2-46ca-9b5d-17163dda28c6",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        1120
      ],
      "parameters": {
        "width": 400,
        "height": 380,
        "content": "## 📊 DATA STRUCTURE\n\n### Google Sheets Tables:\n1. **Users** - data of registered users\n2. **Photo Reports** - all photo reports\n3. **Tasks** - list of tasks and their statuses\n\n### Key Fields:\n- **Tas"
      }
    },
    {
      "id": "f875f1ce-77e9-4618-8cec-50b710194d42",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        1520
      ],
      "parameters": {
        "width": 400,
        "height": 280,
        "content": "## ⚠️ IMPORTANT NOTES\n1. **Task ID = Report ID** - these are the same identifier\n2. **File Grouping** - multiple photos can relate to one task\n3. **Recurring Reminders** - sent at specified intervals\n"
      }
    },
    {
      "id": "11a3b790-6050-4402-a28c-ebcbc939ad39",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        1872
      ],
      "parameters": {
        "width": 798,
        "height": 408,
        "content": "## 🚀 ENTRY POINT\n\n### Telegram Webhook\n\nHandles all incoming messages from users:\n- Commands (/start, /help, /status, etc.)\n- Photos for reports\n- Text reports on tasks\n- Geolocation"
      }
    },
    {
      "id": "6c81c616-a85b-4314-8b96-12ce471b6839",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        2112
      ],
      "parameters": {
        "width": 2334,
        "height": 840,
        "content": "## 📋 TEXT REPORT PROCESSING\n\n### Task Reports:\n\n- Verify task owner\n- Parse status (completed/partially/not completed)\n- Update status in the tasks table\n- Send confirmation to the executor"
      }
    }
  ],
  "connections": {
    "Get tasks": {
      "main": [
        [
          {
            "node": "Find and form messages - Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check read": {
      "main": [
        [
          {
            "node": "Read sheet for read",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Task Found?": {
      "main": [
        [
          {
            "node": "Update GPS in Table",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error - Task Not Found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check error2": {
      "main": [
        [
          {
            "node": "Photo error message4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get and download file4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Command1": {
      "main": [
        [
          {
            "node": "Send Command Response1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check ID Match1": {
      "main": [
        [
          {
            "node": "Check Process Report1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Command1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Received1": {
      "main": [
        [
          {
            "node": "Get Tasks for Reading1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Received Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check new user1": {
      "main": [
        [],
        [
          {
            "node": "Request registration data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Updates": {
      "main": [
        [
          {
            "node": "Are there updates?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Reports1": {
      "main": [
        [
          {
            "node": "Update Task Status1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Task Owner1": {
      "main": [
        [
          {
            "node": "Get Tasks for Check1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Does task exist?1": {
      "main": [
        [
          {
            "node": "Prepare data for updating2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare data for adding2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Task for GPS": {
      "main": [
        [
          {
            "node": "Task Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate welcome1": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read users sheet1": {
      "main": [
        [
          {
            "node": "Check registration1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Are there updates?": {
      "main": [
        [
          {
            "node": "Update status in table - Photo",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No updates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Action Type1": {
      "main": [
        [
          {
            "node": "Send Report Form1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check check_status": {
      "main": [
        [
          {
            "node": "Read data for status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check send_message": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form read response": {
      "main": [
        [
          {
            "node": "Send read confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check manual_report": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check registration1": {
      "main": [
        [
          {
            "node": "Check new user1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check existing user1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract photo data4": {
      "main": [
        [
          {
            "node": "Check error2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter read summary": {
      "main": [
        [
          {
            "node": "Form read response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Group files by task": {
      "main": [
        [
          {
            "node": "Check existing task1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge lookup and grouped files",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge file streams2": {
      "main": [
        [
          {
            "node": "Group files by task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read sheet for read": {
      "main": [
        [
          {
            "node": "Prepare read updates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Record new executor": {
      "main": [
        [
          {
            "node": "Confirm registration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update GPS in Table": {
      "main": [
        [
          {
            "node": "Confirm GPS Receipt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Task Status1": {
      "main": [
        [
          {
            "node": "Format Confirmation1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check existing task1": {
      "main": [
        [
          {
            "node": "Merge lookup and grouped files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check existing user1": {
      "main": [
        [
          {
            "node": "Generate welcome1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check file presence4": {
      "main": [
        [
          {
            "node": "Upload to Google Drive4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Handle retrieval error4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check no_reply error": {
      "main": [
        [
          {
            "node": "Error message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check process_photo3": {
      "main": [
        [
          {
            "node": "Extract photo data4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check register_user1": {
      "main": [
        [
          {
            "node": "Read users sheet1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check new user1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confirm registration": {
      "main": [
        [
          {
            "node": "Send message2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Confirmation1": {
      "main": [
        [
          {
            "node": "Confirm Report Save1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Tasks for Check1": {
      "main": [
        [
          {
            "node": "Check ID Match1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare confirmation": {
      "main": [
        [
          {
            "node": "Confirm photo receipt4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare read updates": {
      "main": [
        [
          {
            "node": "Filter read summary",
            "type": "main",
            "index": 0
          },
          {
            "node": "Filter valid read updates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read data for status": {
      "main": [
        [
          {
            "node": "Collect status from sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in table2": {
      "main": [
        [
          {
            "node": "Merge for confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to reports table1": {
      "main": [
        [
          {
            "node": "Merge for confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Location Error1": {
      "main": [
        [
          {
            "node": "Location Error Message1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Find Task for GPS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Process Report1": {
      "main": [
        [
          {
            "node": "Extract Reports1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Read Updates1": {
      "main": [
        [
          {
            "node": "Filter Valid Read Updates1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Read in Table1": {
      "main": [
        [
          {
            "node": "Send Received Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check send_report_menu": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Location Data1": {
      "main": [
        [
          {
            "node": "Check Location Error1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Tasks for Reading1": {
      "main": [
        [
          {
            "node": "Prepare Read Updates1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get and download file4": {
      "main": [
        [
          {
            "node": "Check file presence4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get photo reports data": {
      "main": [
        [
          {
            "node": "Find and form messages - Photo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge for confirmation": {
      "main": [
        [
          {
            "node": "Prepare confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Process Location2": {
      "main": [
        [
          {
            "node": "Extract Location Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate status message": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle retrieval error4": {
      "main": [
        [
          {
            "node": "Merge file streams2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare updates - Tasks": {
      "main": [
        [
          {
            "node": "Are there updates? - Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive4": {
      "main": [
        [
          {
            "node": "Prepare data for writing5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare data for adding2": {
      "main": [
        [
          {
            "node": "Add to reports table1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge for confirmation",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Collect status from sheet": {
      "main": [
        [
          {
            "node": "Generate status message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter valid read updates": {
      "main": [
        [
          {
            "node": "Update read status in table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare data for writing5": {
      "main": [
        [
          {
            "node": "Merge file streams2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process incoming message1": {
      "main": [
        [
          {
            "node": "Check send_message",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check check_status",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check send_report_menu",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check manual_report",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check register_user1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check read",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check no_reply error",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check complete_registration1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check process_photo3",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Command1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Action Type1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Process Report1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Received1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Task Owner1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Process Location2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Are there updates? - Tasks": {
      "main": [
        [
          {
            "node": "Update status in table - Tasks",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No updates - Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check every minute - Photo": {
      "main": [
        [
          {
            "node": "Get photo reports data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check every minute - Tasks": {
      "main": [
        [
          {
            "node": "Get tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Valid Read Updates1": {
      "main": [
        [
          {
            "node": "Update Read in Table1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare data for recording": {
      "main": [
        [
          {
            "node": "Record new executor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare data for updating2": {
      "main": [
        [
          {
            "node": "Merge for confirmation",
            "type": "main",
            "index": 1
          },
          {
            "node": "Update row in table2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request registration data1": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Are there messages to send?": {
      "main": [
        [
          {
            "node": "Send to Telegram - Photo",
            "type": "main",
            "index": 0
          },
          {
            "node": "Prepare Updates",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update read status in table": {
      "main": [
        [
          {
            "node": "Send read confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check complete_registration1": {
      "main": [
        [
          {
            "node": "Prepare data for recording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find and form messages - Photo": {
      "main": [
        [
          {
            "node": "Are there messages to send?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find and form messages - Tasks": {
      "main": [
        [
          {
            "node": "Are there messages to send? - Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge lookup and grouped files": {
      "main": [
        [
          {
            "node": "Does task exist?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Are there messages to send? - Tasks": {
      "main": [
        [
          {
            "node": "Send to Telegram - Tasks",
            "type": "main",
            "index": 0
          },
          {
            "node": "Prepare updates - Tasks",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No messages - Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Webhook - Receiving messages": {
      "main": [
        [
          {
            "node": "Process incoming message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}