{
  "name": "Telegram Manage Task List Demo",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        -300,
        -140
      ],
      "id": "307440ac-3b13-4564-a2a5-8ed97192ee6b",
      "name": "When chat message received",
      "webhookId": "79b795da-dcea-4b73-a0dd-33bcef3199e6"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -300,
        80
      ],
      "id": "e732232a-040d-4656-84fb-937f79f625de",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "MzIepidaRw9ZqcPB",
          "name": "OpenAi account Credentials"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -160,
        80
      ],
      "id": "5d5b8bcd-94f4-4af5-b864-0e602a75ad2e",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1cpGAuVcs8Bhv212IqfabI_jX0AJ1Dv0lhKd4lNGH4e4",
          "mode": "list",
          "cachedResultName": "Task To Do Demo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cpGAuVcs8Bhv212IqfabI_jX0AJ1Dv0lhKd4lNGH4e4/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cpGAuVcs8Bhv212IqfabI_jX0AJ1Dv0lhKd4lNGH4e4/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        0,
        80
      ],
      "id": "d3e003d5-bef9-4253-ac66-a80c8bbb6be0",
      "name": "Get Task List",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ESD8JJHqd8A9NlNx",
          "name": "Google Sheets account (Kris)"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "1cpGAuVcs8Bhv212IqfabI_jX0AJ1Dv0lhKd4lNGH4e4",
          "mode": "list",
          "cachedResultName": "Task To Do Demo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cpGAuVcs8Bhv212IqfabI_jX0AJ1Dv0lhKd4lNGH4e4/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "To Dos",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cpGAuVcs8Bhv212IqfabI_jX0AJ1Dv0lhKd4lNGH4e4/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Task": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Task__using_to_match_', ``, 'string') }}",
            "Due Date": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Due_Date', ``, 'string') }}",
            "Status": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Status', ``, 'string') }}",
            "Priority": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Priority', ``, 'string') }}",
            "Notes/Comments": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Notes_Comments', ``, 'string') }}"
          },
          "matchingColumns": [
            "Task"
          ],
          "schema": [
            {
              "id": "Task",
              "displayName": "Task",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Due Date",
              "displayName": "Due Date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "displayName": "Status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Priority",
              "displayName": "Priority",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Notes/Comments",
              "displayName": "Notes/Comments",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        120,
        80
      ],
      "id": "0485de14-b064-471e-93ce-7daf8ca76b61",
      "name": "Update Tasks",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ESD8JJHqd8A9NlNx",
          "name": "Google Sheets account (Kris)"
        }
      }
    },
    {
      "parameters": {
        "content": "",
        "width": 280,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        60
      ],
      "id": "0365c33e-eb64-4742-a644-3d9ed70be4be",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "ou are a helpful AI assistant that manages a user's task list stored in Google Sheets. You interact via natural language and update tasks directly in the sheet based on user requests.\n\n✅ Your Role:\nAct as the user's task manager — adding, updating, checking off, or deleting tasks based on input. Always confirm changes and keep the sheet accurate.\n\n🗂️ Google Sheet Columns:\nAssume the sheet has the following columns:\n\nTask\n\nStatus (Pending, In Progress, Done)\n\nPriority (Low, Medium, High)\n\nDue Date (YYYY-MM-DD)\n\nNotes\n\n🧠 Behaviors:\nInterpret the user's intent (e.g. “remind me to email John tomorrow” = add a new task).\n\nPrioritize clarity: summarize changes or ask for missing details.\n\nNever assume dates/times — always confirm if vague.\n\nMaintain task consistency: no duplicate tasks unless user confirms.\n\n💬 You can:\nAdd new tasks with details\n\nMark tasks as done or in progress\n\nDelete completed or cancelled tasks\n\nUpdate due dates, priorities, or notes\n\nList today's tasks, upcoming tasks, or overdue items\n\n🛑 Rules:\nNever hallucinate data.\n\nOnly modify the sheet when given explicit or clearly implied instructions.\n\nIf a command is ambiguous, ask follow-up questions."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.8,
      "position": [
        -120,
        -140
      ],
      "id": "412cb612-b76f-4530-9c6d-f2e3be223925",
      "name": "AI Task Assistant"
    }
  ],
  "pinData": {},
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Task Assistant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Task Assistant",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Task Assistant",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Get Task List": {
      "ai_tool": [
        [
          {
            "node": "AI Task Assistant",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update Tasks": {
      "ai_tool": [
        [
          {
            "node": "AI Task Assistant",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "678a98c0-f7a2-4fcd-a85c-bab0f3074601",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "4aabc0aa2e160dafa4f9d9bcedde563b5af29598cd16960f637ae2fb99aea720"
  },
  "id": "5KRDWTegyKpTMegI",
  "tags": []
}