{
  "name": "Manage Supabase database records with Telegram bot commands",
  "nodes": [
    {
      "id": "489db1e4-058f-4c8a-b570-6aec40dbe3a5",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1840,
        368
      ]
    },
    {
      "id": "c42dbc91-8b38-422c-9121-6a1bb1171097",
      "name": "Extract Message Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -1616,
        368
      ]
    },
    {
      "id": "0c7cf41a-0950-4985-88e5-26e5c79305e7",
      "name": "Is Authorized?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1392,
        368
      ]
    },
    {
      "id": "28e1ac01-179b-4203-8e2a-a6d5edaf31f9",
      "name": "Parse Command and Parameters",
      "type": "n8n-nodes-base.code",
      "position": [
        -1168,
        368
      ]
    },
    {
      "id": "c591a0af-a344-4a68-acdc-9fb79a43fdf5",
      "name": "Route by Command",
      "type": "n8n-nodes-base.switch",
      "position": [
        -944,
        272
      ]
    },
    {
      "id": "2d73fe4d-5cc1-4a09-ba63-d42bd5e885cb",
      "name": "Add Has Error?",
      "type": "n8n-nodes-base.if",
      "position": [
        -720,
        -976
      ]
    },
    {
      "id": "55fb6dea-5fd1-40e1-8f15-5adda8057f28",
      "name": "Supabase Insert Product",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -496,
        -880
      ]
    },
    {
      "id": "1b62e61f-dfad-4c95-8dde-5f8496e1295b",
      "name": "Send Add Success",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -272,
        -880
      ]
    },
    {
      "id": "c4623db7-78b7-453c-bb8e-49748cb7ec35",
      "name": "Send Add Error",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -496,
        -1072
      ]
    },
    {
      "id": "687c5ea4-d7f8-4eb3-ab17-2dfb77b0fe3b",
      "name": "Filter by Category?",
      "type": "n8n-nodes-base.if",
      "position": [
        -720,
        -592
      ]
    },
    {
      "id": "4f0e9584-9da4-443d-9d39-06b201a4fde2",
      "name": "Supabase List Filtered",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -496,
        -688
      ]
    },
    {
      "id": "1f2f0ffa-a240-48c4-959d-998b662e194c",
      "name": "Supabase List All",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -496,
        -496
      ]
    },
    {
      "id": "740c9210-44dc-4cd6-9f76-44d2170018bc",
      "name": "Format Product List",
      "type": "n8n-nodes-base.code",
      "position": [
        -272,
        -592
      ]
    },
    {
      "id": "98596398-5e01-45f6-9c0b-3da66360eab5",
      "name": "Send Product List",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -48,
        -592
      ]
    },
    {
      "id": "ba38d3a8-ccb3-4c4f-9109-9a9538e246d8",
      "name": "Get Has Error?",
      "type": "n8n-nodes-base.if",
      "position": [
        -720,
        -208
      ]
    },
    {
      "id": "50649ea2-0d2e-402d-a9f4-d03294922ddb",
      "name": "Supabase Get Product",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -512,
        -112
      ]
    },
    {
      "id": "8f30e94f-162c-4bc7-ba5b-6a653361adfd",
      "name": "Send Product Details",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -288,
        -112
      ]
    },
    {
      "id": "fe7e3537-d833-4533-a271-54ccec98f9af",
      "name": "Send Get Error",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -512,
        -304
      ]
    },
    {
      "id": "68c690c1-54b1-4330-87aa-eb525b58b259",
      "name": "Update Has Error?",
      "type": "n8n-nodes-base.if",
      "position": [
        -720,
        176
      ]
    },
    {
      "id": "c17faffe-664c-4ebe-beba-eb6a1d0d106c",
      "name": "Prepare Update Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -512,
        288
      ]
    },
    {
      "id": "2fb60504-55bf-44bb-827e-509a6094f824",
      "name": "Supabase Update Product",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -288,
        288
      ]
    },
    {
      "id": "569b1d21-1f0d-4efb-beb8-a380696e6a8c",
      "name": "Send Update Success",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -64,
        288
      ]
    },
    {
      "id": "adb1157b-a0f7-40c7-983d-c9e6e4049889",
      "name": "Send Update Error",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -528,
        112
      ]
    },
    {
      "id": "5c85a5e0-c854-48b0-884b-9de3500d1cff",
      "name": "Delete Has Error?",
      "type": "n8n-nodes-base.if",
      "position": [
        -720,
        560
      ]
    },
    {
      "id": "2b747995-9ad7-45af-83aa-52e29b8d1a67",
      "name": "Supabase Delete Product",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -496,
        656
      ]
    },
    {
      "id": "874359fc-363d-43bf-aece-bad14b0cee5f",
      "name": "Send Delete Success",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -272,
        656
      ]
    },
    {
      "id": "ea553b05-a0f2-423e-846c-bd653ff3d63a",
      "name": "Send Delete Error",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -496,
        464
      ]
    },
    {
      "id": "da42f0e5-5858-40e7-bcee-1a38a28bbe17",
      "name": "Search Has Error?",
      "type": "n8n-nodes-base.if",
      "position": [
        -720,
        944
      ]
    },
    {
      "id": "cfe21419-6e35-4ce3-9191-db448f8122a6",
      "name": "Supabase Search Products",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -496,
        1040
      ]
    },
    {
      "id": "51ca1339-0864-4fdd-a068-f3aaba97d36f",
      "name": "Format Search Results",
      "type": "n8n-nodes-base.code",
      "position": [
        -272,
        1040
      ]
    },
    {
      "id": "d6b791df-df03-4aba-93a3-4bbbd6c142d3",
      "name": "Send Search Results",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -48,
        1040
      ]
    },
    {
      "id": "c572235c-384e-4e39-94c1-c1e418170b3c",
      "name": "Send Search Error",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -496,
        848
      ]
    },
    {
      "id": "00d4fabb-b25d-41e9-8fd5-96395624b1bc",
      "name": "Send Help Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -720,
        1136
      ]
    },
    {
      "id": "12d7c984-6daa-4fa7-8abb-5354efbf225c",
      "name": "Send Unknown Command",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -720,
        1328
      ]
    },
    {
      "id": "8bb58b4c-aeb7-47a1-bf59-d9a5b9dd419d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2672,
        -480
      ],
      "parameters": {
        "width": 576,
        "height": 1300,
        "content": "## How it works\nThis workflow turns Telegram into a database management interface for Supabase. Send commands to your bot to create, read, update, delete, and search records in your database - all fro"
      }
    },
    {
      "id": "564354f4-db78-4911-9e50-5ae3ed89062f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1686,
        256
      ],
      "parameters": {
        "width": 412,
        "height": 272,
        "content": "### 🔐 Authorization\nExtracts chat ID from message and validates against authorized list using OR conditions. To add more users, edit the If node and add more conditions."
      }
    },
    {
      "id": "22d93087-692b-4901-9e49-688005af6cb1",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        80
      ],
      "parameters": {
        "width": 472,
        "height": 576,
        "content": "### 🔀 Command Router\nParses the message to extract the command and routes to the appropriate handler. Supports: /add, /list, /get, /update, /delete, /search, /help"
      }
    }
  ],
  "connections": {
    "Add Has Error?": {
      "main": [
        [
          {
            "node": "Send Add Error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Supabase Insert Product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Has Error?": {
      "main": [
        [
          {
            "node": "Send Get Error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Supabase Get Product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Authorized?": {
      "main": [
        [
          {
            "node": "Parse Command and Parameters",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Route by Command": {
      "main": [
        [
          {
            "node": "Add Has Error?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Filter by Category?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Has Error?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Has Error?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Delete Has Error?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Search Has Error?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Help Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Unknown Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Extract Message Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Has Error?": {
      "main": [
        [
          {
            "node": "Send Delete Error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Supabase Delete Product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Has Error?": {
      "main": [
        [
          {
            "node": "Send Search Error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Supabase Search Products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Product List": {
      "main": [
        []
      ]
    },
    "Supabase List All": {
      "main": [
        [
          {
            "node": "Format Product List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Has Error?": {
      "main": [
        [
          {
            "node": "Send Update Error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Update Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter by Category?": {
      "main": [
        [
          {
            "node": "Supabase List Filtered",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Supabase List All",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Product List": {
      "main": [
        [
          {
            "node": "Send Product List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Update Data": {
      "main": [
        [
          {
            "node": "Supabase Update Product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Message Data": {
      "main": [
        [
          {
            "node": "Is Authorized?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Get Product": {
      "main": [
        [
          {
            "node": "Send Product Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Search Results": {
      "main": [
        [
          {
            "node": "Send Search Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase List Filtered": {
      "main": [
        [
          {
            "node": "Format Product List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Delete Product": {
      "main": [
        [
          {
            "node": "Send Delete Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Insert Product": {
      "main": [
        [
          {
            "node": "Send Add Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Update Product": {
      "main": [
        [
          {
            "node": "Send Update Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Search Products": {
      "main": [
        [
          {
            "node": "Format Search Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Command and Parameters": {
      "main": [
        [
          {
            "node": "Route by Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}