{
  "name": "Manage User Authentication with Telegram, Redis Cache and Google Sheets",
  "nodes": [
    {
      "id": "47ba2270-9e4d-4bf1-a3c5-c68e2e810065",
      "name": "Get Message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -160,
        800
      ]
    },
    {
      "id": "2ab85c19-5f38-49de-b6a6-316c621705f6",
      "name": "Find User",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        560,
        600
      ]
    },
    {
      "id": "3dcd8b09-cb74-439b-80aa-87c7994e65b1",
      "name": "Is New User",
      "type": "n8n-nodes-base.switch",
      "position": [
        760,
        600
      ]
    },
    {
      "id": "9e20fe5b-c5e0-4b94-8262-01dd022ff0e7",
      "name": "Get UserId",
      "type": "n8n-nodes-base.code",
      "position": [
        920,
        780
      ]
    },
    {
      "id": "17f198c5-7a18-4661-b299-3cac28804b99",
      "name": "Create User",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1120,
        780
      ]
    },
    {
      "id": "ae42ce20-dd11-4ae3-8036-3d424cac004b",
      "name": "UserId",
      "type": "n8n-nodes-base.merge",
      "position": [
        1500,
        900
      ]
    },
    {
      "id": "d70a4151-887d-475b-baeb-9588be242929",
      "name": "Find Cached User",
      "type": "n8n-nodes-base.redis",
      "position": [
        60,
        1040
      ]
    },
    {
      "id": "c930bee8-2e8c-4eab-9a59-56ee1cb9349e",
      "name": "Is Cached",
      "type": "n8n-nodes-base.switch",
      "position": [
        280,
        1040
      ]
    },
    {
      "id": "4896c86b-42f8-4b18-899b-f4353ef397ac",
      "name": "Cache User",
      "type": "n8n-nodes-base.redis",
      "position": [
        1120,
        580
      ]
    },
    {
      "id": "07465c66-6b72-4870-b02d-156e32f551ab",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        420
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "715e7922-e3fc-40cb-8a00-207c2ac08861",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -160,
        600
      ]
    },
    {
      "id": "5de97977-1128-42f7-9b96-075dd9662e1e",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -160,
        1040
      ]
    },
    {
      "id": "5e68c21d-51f2-4a61-803b-5aff05007d3c",
      "name": "Get User",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        60,
        600
      ]
    },
    {
      "id": "da473a91-2c5b-4d6d-b850-4c35a1426625",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        60,
        800
      ]
    },
    {
      "id": "642b0052-8987-4c09-b926-5382e37ddc02",
      "name": "Edit Fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        600
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Find Cached User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UserId": {
      "main": [
        []
      ]
    },
    "Get User": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find User": {
      "main": [
        [
          {
            "node": "Is New User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Cached": {
      "main": [
        [
          {
            "node": "Find User",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "UserId",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Cache User": {
      "main": [
        [
          {
            "node": "UserId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get UserId": {
      "main": [
        [
          {
            "node": "Create User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create User": {
      "main": [
        [
          {
            "node": "UserId",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get Message": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is New User": {
      "main": [
        [
          {
            "node": "Cache User",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get UserId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Cached User": {
      "main": [
        [
          {
            "node": "Is Cached",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Get User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}