{
  "name": "Automated Telegram UserBot session monitoring & recovery with TelePilot",
  "nodes": [
    {
      "id": "2f3ae9e1-74a8-471c-b5e9-5248b30df34a",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        0,
        640
      ]
    },
    {
      "id": "cddd4cae-f66e-46df-b47b-03d70e64dd58",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        400
      ],
      "parameters": {
        "width": 740,
        "height": 440,
        "content": "# Supported Commands\nFollowing commands can be used in Chat:\n\n/start - start login via Phone Number and code (MFA is also supported if set)\n/stop - terminates current ClientSession for this Credential"
      }
    },
    {
      "id": "80545bcf-d638-4d62-98da-1c2417ae0a08",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        224
      ]
    },
    {
      "id": "c4de86cc-899a-46cd-827f-24310f5f6431",
      "name": "Stop auth",
      "type": "@telepilotco/n8n-nodes-telepilot.telePilot",
      "position": [
        1120,
        368
      ]
    },
    {
      "id": "69e92f40-e2bd-42c2-917f-dfff2ecff35e",
      "name": "Start auth",
      "type": "@telepilotco/n8n-nodes-telepilot.telePilot",
      "position": [
        1120,
        592
      ]
    },
    {
      "id": "f3ff30f1-636b-4f77-b4df-de64149000dd",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        304
      ],
      "parameters": {
        "width": 480,
        "height": 692,
        "content": "# Automatic Reconnect"
      }
    },
    {
      "id": "06fb2111-2a65-41cd-bf0f-3b9eb63f802b",
      "name": "Manual control",
      "type": "@telepilotco/n8n-nodes-telepilot.telePilot",
      "position": [
        224,
        640
      ]
    },
    {
      "id": "8c35adce-7dc6-4559-80e8-bde6de9ae6d3",
      "name": "Automatic control",
      "type": "@telepilotco/n8n-nodes-telepilot.telePilot",
      "position": [
        448,
        224
      ]
    },
    {
      "id": "5adebdd8-eed4-4942-9f46-57ff3cebff7c",
      "name": "Get Session Status",
      "type": "n8n-nodes-base.set",
      "position": [
        224,
        224
      ]
    },
    {
      "id": "c8dd0ee1-8877-4e59-8c8a-5d2ff8b1c2f5",
      "name": "Stop Session",
      "type": "n8n-nodes-base.set",
      "position": [
        912,
        368
      ]
    },
    {
      "id": "ae5565f7-cddb-41fb-be03-b2980c80688d",
      "name": "Start Session",
      "type": "n8n-nodes-base.set",
      "position": [
        912,
        592
      ]
    },
    {
      "id": "0f65ad5e-7ed7-4376-855e-829c34c811ef",
      "name": "Pass on Closed Status",
      "type": "n8n-nodes-base.filter",
      "position": [
        672,
        224
      ]
    },
    {
      "id": "0b78e5c0-ca44-4e7c-93ff-79d285115f32",
      "name": "Send Closed Status message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        880,
        128
      ]
    },
    {
      "id": "c512d22a-4082-4e80-9142-4dee8401a9fa",
      "name": "Check Session Connection",
      "type": "n8n-nodes-base.filter",
      "position": [
        912,
        800
      ]
    },
    {
      "id": "194bdbc5-d65f-44e9-bd82-966377e72b9d",
      "name": "Send Session Connection message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1120,
        800
      ]
    },
    {
      "id": "1a3d8082-4ce8-4346-9c18-91c7cf56e11b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        160
      ],
      "parameters": {
        "width": 880,
        "height": 224,
        "content": "# Automatic Session Check"
      }
    }
  ],
  "connections": {
    "Stop auth": {
      "main": [
        [
          {
            "node": "Start Session",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start auth": {
      "main": [
        [
          {
            "node": "Check Session Connection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stop Session": {
      "main": [
        [
          {
            "node": "Stop auth",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Session": {
      "main": [
        [
          {
            "node": "Start auth",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual control": {
      "main": [
        []
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Session Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Automatic control": {
      "main": [
        [
          {
            "node": "Pass on Closed Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Session Status": {
      "main": [
        [
          {
            "node": "Automatic control",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pass on Closed Status": {
      "main": [
        [
          {
            "node": "Send Closed Status message",
            "type": "main",
            "index": 0
          },
          {
            "node": "Stop Session",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Session Connection": {
      "main": [
        [
          {
            "node": "Send Session Connection message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Manual control",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}