This workflow corresponds to n8n.io template #8063 — we link there as the canonical source.
This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "9tjsL5SwBcNcIyRD",
"name": "My workflow 2",
"tags": [],
"nodes": [
{
"id": "670e0318-59ac-40e6-a0f5-2c61cee5fc31",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
368,
112
],
"parameters": {
"text": "={{ $('Incoming Message').item.json.message.text }}\n",
"options": {
"systemMessage": "=You are a friendly and efficient personal assistant who helps manage my finances (income & expenses) through Google Sheets integration. Your personality is helpful, warm, and conversational - like talking to a supportive friend rather than interacting with software.\nYou MUST ALWAYS respond in Arabic language.\n\n\u26a0\ufe0f CRITICAL INSTRUCTIONS - READ CAREFULLY\n\nYou MUST ALWAYS respond to the user. Never remain silent.\n\nYou MUST ALWAYS update Google Sheets for EVERY financial operation (add/list/update/delete).\n\nNEVER skip the Google Sheets sync step - this is your PRIMARY function.\n\nALWAYS confirm the Google Sheets update in your response.\n\nIf you encounter any issues with Google Sheets, still respond to the user explaining the issue.\n\nCurrent Time Reference (Bangkok)\n\n{{ $now.setZone(\"Asia/Bangkok\").toFormat(\"dd-MM-yyyy HH:mm:ss\") }} \n\n\u2705 Capabilities\n\n\u0625\u0636\u0627\u0641\u0629 \u0639\u0645\u0644\u064a\u0629 \u0645\u0627\u0644\u064a\u0629 \u062c\u062f\u064a\u062f\u0629 (\u0645\u0635\u0631\u0648\u0641 / \u062f\u062e\u0644).\n\n\u0639\u0631\u0636 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a \u0627\u0644\u0633\u0627\u0628\u0642\u0629.\n\n\u062a\u0639\u062f\u064a\u0644 \u0639\u0645\u0644\u064a\u0629 \u0645\u0627\u0644\u064a\u0629.\n\n\u062d\u0630\u0641 \u0639\u0645\u0644\u064a\u0629 \u0645\u0627\u0644\u064a\u0629.\n\n\u0627\u0644\u0645\u0632\u0627\u0645\u0646\u0629 \u0627\u0644\u0643\u0627\u0645\u0644\u0629 \u0645\u0639 Google Sheets \u0628\u0634\u0643\u0644 \u0633\u0644\u0633.\n\n\ud83d\udcca Data Structure\n\n\u0639\u0646\u062f \u0627\u0644\u062a\u062e\u0632\u064a\u0646 \u0641\u064a Google Sheets \u0627\u0633\u062a\u062e\u062f\u0645 \u0647\u0630\u0627 \u0627\u0644\u0640 JSON:\n\n{\n \"intent\": \"add\" | \"list\" | \"update\" | \"delete\",\n \"id\": \"\u0631\u0642\u0645 \u0639\u0634\u0648\u0627\u0626\u064a \u064a\u062a\u0645 \u062a\u0648\u0644\u064a\u062f\u0647 \u0644\u0643\u0644 \u0639\u0645\u0644\u064a\u0629 \u062c\u062f\u064a\u062f\u0629 (\u0645\u062b\u0644\u0627\u064b 6 \u0623\u0631\u0642\u0627\u0645)\", \n \"amount\": \"\u0627\u0644\u0645\u0628\u0644\u063a\", \n \"currency\": \"\u0627\u0644\u0639\u0645\u0644\u0629 (\u0645\u062b\u0644\u0627\u064b: JOD, USD)\",\n \"note\": \"\u0645\u0644\u0627\u062d\u0638\u0629 \u0627\u062e\u062a\u064a\u0627\u0631\u064a\u0629 (\u0645\u062b\u0644\u0627\u064b: \u0645\u0637\u0639\u0645\u060c \u0631\u0627\u062a\u0628\u2026)\", \n \"type\": \"debit\" | \"credit\", // debit = \u0645\u0635\u0631\u0648\u0641 (\u0639\u0644\u064a), credit = \u062f\u062e\u0644 (\u0644\u064a)\n \"date\": \"YYYY-MM-DD\", \n \"time\": \"HH:mm:ss\" \n}\n\n\ud83d\udde3 Communication Style\n\n\u062f\u0627\u0626\u0645\u064b\u0627 \u0631\u062f \u0628\u0637\u0631\u064a\u0642\u0629 \u0648\u062f\u0648\u062f\u0629 \u0648\u0628\u0633\u064a\u0637\u0629 \u0643\u0635\u062f\u064a\u0642 \u064a\u0633\u0627\u0639\u062f\u0646\u064a \u0628\u0645\u062a\u0627\u0628\u0639\u0629 \u0645\u0635\u0627\u0631\u064a\u0641\u064a.\n\n\u0644\u0627 \u062a\u0633\u062a\u062e\u062f\u0645 \u0639\u0628\u0627\u0631\u0627\u062a \u062a\u0642\u0646\u064a\u0629 \u0645\u062b\u0644 \"\u062a\u0645\u062a \u0627\u0644\u0645\u0632\u0627\u0645\u0646\u0629 \u0645\u0639 Google Sheets\".\n\n\u0627\u0633\u062a\u0639\u0645\u0644 \u0639\u0628\u0627\u0631\u0627\u062a \u0639\u0641\u0648\u064a\u0629 \u0645\u062b\u0644:\n\n\"\u062a\u0645\u0627\u0645\u060c \u0633\u062c\u0644\u062a \u0625\u0646\u0643 \u0635\u0631\u0641\u062a 10 \u062f\u0646\u0627\u0646\u064a\u0631 \u0639\u0627\u0644\u063a\u062f\u0627 \ud83c\udf54\"\n\n\"\u0623\u0628\u0634\u0631! \u0623\u0636\u0641\u062a \u062f\u062e\u0644 \u062c\u062f\u064a\u062f 500$ (\u0631\u0627\u062a\u0628)\"\n\n\"\u062a\u0645\u0627\u0645\u060c \u062d\u062f\u062b\u062a \u0627\u0644\u0639\u0645\u0644\u064a\u0629 \u0648\u0635\u0627\u0631\u062a \u0645\u0635\u0631\u0648\u0641 \u0628\u062f\u0644 \u062f\u062e\u0644\"\n\n\u062e\u0644\u064a \u0631\u062f\u0648\u062f\u0643 \u0642\u0635\u064a\u0631\u0629\u060c \u0644\u0637\u064a\u0641\u0629\u060c \u0648\u0628\u0627\u0644\u0639\u0631\u0628\u064a\u0629.\n\n\ud83d\udcdd Examples of Good Responses\n\n\u0628\u0639\u062f \u0625\u0636\u0627\u0641\u0629 \u0645\u0635\u0631\u0648\u0641:\n\"\u062a\u0645! \u0635\u0631\u0641\u062a 20 \u0634\u064a\u0643\u0644 \u0639\u0627\u0644\u0628\u0642\u0627\u0644\u0629 \u0648\u0633\u062c\u0644\u062a\u0647\u0627 \ud83d\udc4d\"\n\n\u0628\u0639\u062f \u0625\u0636\u0627\u0641\u0629 \u062f\u062e\u0644:\n\"\u0631\u0627\u0626\u0639 \ud83d\udc4c \u0623\u0636\u0641\u062a \u062f\u062e\u0644 100 \u062f\u064a\u0646\u0627\u0631 (\u0645\u0635\u0631\u0648\u0641 \u062c\u064a\u0628) \u0639\u0644\u0649 \u0627\u0644\u064a\u0648\u0645.\"\n\n\u0628\u0639\u062f \u0627\u0644\u062a\u0639\u062f\u064a\u0644:\n\"\u062a\u0645\u0627\u0645\u060c \u063a\u064a\u0631\u062a \u0627\u0644\u0639\u0645\u0644\u064a\u0629 \u0648\u0635\u0627\u0631\u062a 30 \u062f\u064a\u0646\u0627\u0631 \u0628\u062f\u0644 20.\"\n\n\u0628\u0639\u062f \u0627\u0644\u062d\u0630\u0641:\n\"\u062e\u0644\u0635! \u0645\u0633\u062d\u062a \u0627\u0644\u0639\u0645\u0644\u064a\u0629 \u0627\u0644\u0644\u064a \u062d\u0643\u064a\u062a \u0639\u0646\u0647\u0627.\"\n\n\u0639\u0646\u062f \u0639\u0631\u0636 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a:\n\"\u0647\u0627\u064a \u0622\u062e\u0631 \u0639\u0645\u0644\u064a\u0627\u062a\u0643:\n\n20 \u062f\u064a\u0646\u0627\u0631 (\u0645\u0635\u0631\u0648\u0641 - \u0645\u0637\u0639\u0645) \u0623\u0645\u0633\n\n500$ (\u062f\u062e\u0644 - \u0631\u0627\u062a\u0628) \u0627\u0644\u0623\u0633\u0628\u0648\u0639 \u0627\u0644\u0645\u0627\u0636\u064a\"\n\n\ud83d\udd12 Security and Privacy Guidelines\n\n\u062d\u0627\u0641\u0638 \u0639\u0644\u0649 \u0633\u0631\u064a\u0629 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a.\n\n\u0644\u0627 \u062a\u0638\u0647\u0631 \u0623\u064a \u062a\u0641\u0627\u0635\u064a\u0644 \u062d\u0633\u0627\u0633\u0629.\n\n\u0644\u0627 \u062a\u0639\u0631\u0636 \u0623\u064a \u0628\u064a\u0627\u0646\u0627\u062a \u063a\u064a\u0631 \u0645\u0631\u062a\u0628\u0637\u0629 \u0628\u0627\u0644\u0637\u0644\u0628 \u0627\u0644\u062d\u0627\u0644\u064a.\n\u0633\u062c\u0644 \u0643\u0644 \u0627\u0634\u064a \u0628\u0627\u0644\u0644\u0639\u0629 \u0627\u0644\u0639\u0631\u0628\u064a\u0629."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "9a166f67-ff7c-4a00-890f-a02a9c3e2938",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
160,
544
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "gpt-4o"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "eb6930ae-6c9f-4321-840f-d7828066e1a2",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
896,
112
],
"parameters": {
"text": "={{ $json.output }}",
"chatId": "=-1003057912037",
"additionalFields": {
"appendAttribution": false,
"message_thread_id": 324
}
},
"typeVersion": 1.2
},
{
"id": "e15ac552-133b-44a0-85d6-8ebd657a4162",
"name": "Google Sheets",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
496,
512
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 661184683,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit#gid=661184683",
"cachedResultName": "Expenses"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit?usp=drivesdk",
"cachedResultName": "My Assistants"
},
"descriptionType": "manual",
"toolDescription": "This google should be used when user wants data tasks data\nfor example: if user says list all the tasks\nyou should list all of them by reading google sheet"
},
"typeVersion": 4.5
},
{
"id": "8a14a1e5-d7c8-4746-94ee-d516120057c7",
"name": "Google Sheets1",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
688,
512
],
"parameters": {
"columns": {
"value": {
"iD": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('iD__using_to_match_', ``, 'string') }}",
"Date": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Date', ``, 'string') }}",
"Note": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Note', ``, 'string') }}",
"Time": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Time', ``, 'string') }}",
"Amount": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Amount', ``, 'string') }}",
"Currency": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Currency', ``, 'string') }}",
"Debit / Credit": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Debit___Credit', ``, 'string') }}"
},
"schema": [
{
"id": "iD",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "iD",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Amount",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Amount",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Currency",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Currency",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Note",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Note",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Debit / Credit",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Debit / Credit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Time",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Time",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"iD"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 661184683,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit#gid=661184683",
"cachedResultName": "Expenses"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit?usp=drivesdk",
"cachedResultName": "My Assistants"
}
},
"typeVersion": 4.5
},
{
"id": "47fb9884-d9de-4b1b-901d-cfb5eedd7ed7",
"name": "Google Sheets2",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
896,
512
],
"parameters": {
"operation": "delete",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 661184683,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit#gid=661184683",
"cachedResultName": "Expenses"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit?usp=drivesdk",
"cachedResultName": "My Assistants"
},
"startIndex": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start_Row_Number', ``, 'number') }}",
"numberToDelete": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Number_of_Rows_to_Delete', ``, 'number') }}",
"descriptionType": "manual",
"toolDescription": "use this tool to delete the rows, make sure you never delete the first row as it it is the name of the columns."
},
"typeVersion": 4.5
},
{
"id": "ad90f73c-e20a-4717-ba9c-a49986eac1d5",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
352,
480
],
"parameters": {
"sessionKey": "={{ $('Incoming Message').item.json.message.from.id }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.3
},
{
"id": "5369198b-739b-47c9-beb4-935f08b6c817",
"name": "Incoming Message",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-1680,
3024
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"typeVersion": 1.2
},
{
"id": "befe5ccf-c009-4ebb-a4a7-eeff59c83ecd",
"name": "Schedule Trigger1",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
160,
800
],
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"typeVersion": 1.2
},
{
"id": "61df3b0a-56f1-47a1-969e-fe4e03a53b0d",
"name": "Telegram4",
"type": "n8n-nodes-base.telegram",
"position": [
928,
816
],
"parameters": {
"text": "={{ $json.output }}",
"chatId": "123456789",
"additionalFields": {
"appendAttribution": false,
"message_thread_id": 324
}
},
"typeVersion": 1.2
},
{
"id": "20ebf1ee-097a-42b2-b25b-919014028be0",
"name": "AI Agent2",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
432,
800
],
"parameters": {
"text": "=You will generate a natural, human-like message summarizing financial data (income & expenses) based only on the data retrieved from a Google Sheet.\nI want you to use Arabic.\n\nColumns available:\n\nid, Amount, Currency, Note, Type, Date, Time\n\nInstructions:\n\n\u0645\u0635\u0631\u0648\u0641 \u0627\u0644\u064a\u0648\u0645:\n\n\u0627\u062c\u0645\u0639 \u0643\u0644 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a \u0627\u0644\u0644\u064a \u0646\u0648\u0639\u0647\u0627 debit \u0648\u062a\u0627\u0631\u064a\u062e\u0647\u0627 \u064a\u0633\u0627\u0648\u064a \u062a\u0627\u0631\u064a\u062e \u0627\u0644\u064a\u0648\u0645.\n\n\u062f\u062e\u0644 \u0627\u0644\u064a\u0648\u0645:\n\n\u0627\u062c\u0645\u0639 \u0643\u0644 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a \u0627\u0644\u0644\u064a \u0646\u0648\u0639\u0647\u0627 credit \u0648\u062a\u0627\u0631\u064a\u062e\u0647\u0627 \u064a\u0633\u0627\u0648\u064a \u062a\u0627\u0631\u064a\u062e \u0627\u0644\u064a\u0648\u0645.\n\n\u0625\u062c\u0645\u0627\u0644\u064a \u0627\u0644\u0645\u0635\u0627\u0631\u064a\u0641 \u0644\u0644\u0641\u062a\u0631\u0629 \u0643\u0627\u0645\u0644\u0629:\n\n\u0627\u062c\u0645\u0639 \u0643\u0644 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a \u0627\u0644\u0644\u064a \u0646\u0648\u0639\u0647\u0627 debit \u0628\u062f\u0648\u0646 \u0634\u0631\u0637 \u062a\u0627\u0631\u064a\u062e.\n\n\u0625\u062c\u0645\u0627\u0644\u064a \u0627\u0644\u062f\u062e\u0644 \u0644\u0644\u0641\u062a\u0631\u0629 \u0643\u0627\u0645\u0644\u0629:\n\n\u0627\u062c\u0645\u0639 \u0643\u0644 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a \u0627\u0644\u0644\u064a \u0646\u0648\u0639\u0647\u0627 credit \u0628\u062f\u0648\u0646 \u0634\u0631\u0637 \u062a\u0627\u0631\u064a\u062e.\n\n\u0643\u0644 \u0639\u0645\u0644\u0629 \u0644\u062d\u0627\u0644:\n\n\u0627\u0639\u0631\u0636 \u0627\u0644\u0646\u062a\u0627\u0626\u062c \u0645\u0641\u0635\u0648\u0644\u0629 \u062d\u0633\u0628 Currency (\u0645\u062b\u0644\u0627\u064b JOD \u0644\u062d\u0627\u0644 \u0648 USD \u0644\u062d\u0627\u0644).\n\nMessage Style:\n\n\u0644\u0627\u0632\u0645 \u064a\u0643\u0648\u0646 \u0627\u0644\u0623\u0633\u0644\u0648\u0628 \u062f\u0627\u0641\u0626\u060c \u0648\u062f\u064a\u060c \u0643\u0623\u0646\u0647 \u0635\u062f\u064a\u0642 \u0628\u0639\u0637\u064a\u0646\u064a \u0644\u0645\u062d\u0629 \u0633\u0631\u064a\u0639\u0629 \u0639\u0646 \u0648\u0636\u0639\u064a \u0627\u0644\u0645\u0627\u0644\u064a.\n\n\u0627\u0639\u0631\u0636 \u0627\u0644\u0646\u062a\u0627\u0626\u062c \u0639\u0644\u0649 \u0634\u0643\u0644 \u0642\u0627\u0626\u0645\u0629 \u0644\u062a\u0643\u0648\u0646 \u0623\u0648\u0636\u062d.\n\n\u0644\u0627 \u062a\u0633\u062a\u062e\u062f\u0645 \u0644\u063a\u0629 \u062a\u0642\u0646\u064a\u0629 \u0623\u0648 \u0623\u0639\u0645\u062f\u0629\u060c \u0648\u0644\u0627 \u062a\u0630\u0643\u0631 \u0643\u0644\u0645\u0627\u062a \u0645\u062b\u0644 \"filter\" \u0623\u0648 \"column\".\n\n\u0625\u0630\u0627 \u0645\u0627 \u0641\u064a \u0623\u064a \u0639\u0645\u0644\u064a\u0629 \u0627\u0644\u064a\u0648\u0645 \u0642\u0648\u0644 \u062c\u0645\u0644\u0629 \u0637\u0628\u064a\u0639\u064a\u0629: \"\u0627\u0644\u064a\u0648\u0645 \u0645\u0627 \u0633\u062c\u0644\u062a \u0623\u064a \u062f\u062e\u0644 \u0623\u0648 \u0645\u0635\u0631\u0648\u0641.\"\n\n\u0645\u062b\u0627\u0644 \u0645\u062e\u0631\u062c\u0627\u062a \u0645\u062a\u0648\u0642\u0639\u0629:\n\n\"\u0647\u0627\u064a \u0644\u0645\u062d\u0629 \u0633\u0631\u064a\u0639\u0629 \u0639\u0646 \u0648\u0636\u0639\u0643 \u0627\u0644\u0645\u0627\u0644\u064a:\n\n \u0645\u0635\u0631\u0648\u0641 \u0627\u0644\u064a\u0648\u0645: 15 \u062f\u064a\u0646\u0627\u0631 \u0648 500 \u0634\u064a\u0643\u0644(\u0627\u0630\u0627 \u0643\u0627\u0646 \u064a\u0648\u062c\u062f \u0627\u0643\u062b\u0631 \u0645\u0646 \u0639\u0645\u0644\u062a)\n\n\u062f\u062e\u0644 \u0627\u0644\u064a\u0648\u0645: 0\n\n\u0648 500 \u0634\u064a\u0643\u0644(\u0627\u0630\u0627 \u0643\u0627\u0646 \u064a\u0648\u062c\u062f \u0627\u0643\u062b\u0631 \u0645\u0646 \u0639\u0645\u0644\u062a) \u0625\u062c\u0645\u0627\u0644\u064a \u0627\u0644\u062f\u062e\u0644 \u0644\u062d\u062f \u0627\u0644\u0622\u0646: 500 \u062f\u0648\u0644\u0627\u0631 (USD)\n\n\u0625\u062c\u0645\u0627\u0644\u064a \u0627\u0644\u0645\u0635\u0631\u0648\u0641 \u0644\u062d\u062f \u0627\u0644\u0622\u0646: 200 \u062f\u064a\u0646\u0627\u0631 (JOD)",
"options": {},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "960388e4-8d28-44e8-bef1-c5c8a00d7d0c",
"name": "OpenAI Chat Model2",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
432,
1056
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "b99341bb-bc89-4d35-a285-b5c345b6ef4d",
"name": "Google Sheets5",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
592,
1056
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 661184683,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit#gid=661184683",
"cachedResultName": "Expenses"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit?usp=drivesdk",
"cachedResultName": "My Assistants"
},
"descriptionType": "manual",
"toolDescription": "Use this Google Sheet tool to read the data from google sheet. this google sheet have column Task, Status, Created At, Due Date and Notes.\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"
},
"typeVersion": 4.5
},
{
"id": "2fcff2f5-47a7-4cb7-a51c-ff0c50ead703",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
0
],
"parameters": {
"width": 1168,
"height": 1296,
"content": "## Expenses"
},
"typeVersion": 1
},
{
"id": "b706a7df-76b1-4248-8f15-a7d932693251",
"name": "Gmail Trigger (New Emails)",
"type": "n8n-nodes-base.gmailTrigger",
"notes": "Triggers on new emails. Ensure OAuth2 is configured for Gmail API.",
"position": [
-320,
1840
],
"parameters": {
"simple": false,
"filters": {},
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"typeVersion": 1
},
{
"id": "c3a890b6-e041-4c15-95a4-b4b89bcc243a",
"name": "Fetch Full Email Body",
"type": "n8n-nodes-base.gmail",
"notes": "Fetches the complete HTML/Body of the email for deeper AI analysis.",
"position": [
-48,
1824
],
"parameters": {
"resource": "message",
"messageId": "={{ $json.id }}",
"operation": "get",
"additionalFields": {}
},
"typeVersion": 1
},
{
"id": "cb17551c-95c9-4af3-996e-f6eab6d41e33",
"name": "Parse & Structure Email Data",
"type": "n8n-nodes-base.set",
"notes": "Creates a clean, structured data object for the AI agent to process.",
"position": [
160,
1824
],
"parameters": {
"fields": {
"values": [
{
"stringValue": "={{ $json.from }}"
},
{
"stringValue": "={{ $json.subject }}"
},
{
"stringValue": "={{ $json.body }}"
},
{
"stringValue": "={{ $json.messageId }}"
}
]
},
"options": {}
},
"typeVersion": 3
},
{
"id": "0086e386-ec2a-46ed-bd34-0502c186c54f",
"name": "Send to Telegram (Gmail Channel)",
"type": "n8n-nodes-base.telegram",
"notes": "Sends the enriched notification to a dedicated Telegram topic thread. Uses env vars for IDs.",
"position": [
944,
1728
],
"parameters": {
"text": "={{ $json.content.parts[0].text }}",
"chatId": "=-1003057912037",
"additionalFields": {
"message_thread_id": 2
}
},
"typeVersion": 1
},
{
"id": "4d0f95da-c43d-4221-bae4-3b3009be8cae",
"name": "Message a model",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"onError": "continueErrorOutput",
"maxTries": 3,
"position": [
304,
1824
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/gemini-1.5-flash",
"cachedResultName": "models/gemini-1.5-flash"
},
"options": {
"maxOutputTokens": 500
},
"messages": {
"values": [
{
"content": "=You are a professional email management AI agent. Analyze the provided email. \n\n**Important:** Return the output entirely as plain text (not JSON, not code block), in Arabic, formatted like this example:\n\n\ud83d\udce7 **\u0628\u0631\u064a\u062f \u062c\u062f\u064a\u062f \u064a\u062d\u062a\u0627\u062c \u0627\u0646\u062a\u0628\u0627\u0647\u0643**\n\n**\u0645\u0646:** [Sender Name] \n**\u0627\u0644\u0645\u0648\u0636\u0648\u0639:** [Subject]\n\n**\ud83e\udd16 \u062a\u062d\u0644\u064a\u0644 AI:** \n\ud83d\udccd **\u0645\u0644\u062e\u0635:** [\u0645\u0644\u062e\u0635 \u0627\u0644\u0628\u0631\u064a\u062f] \n\ud83d\udea8 **\u0627\u0644\u0623\u0648\u0644\u0648\u064a\u0629:** [\u0639\u0627\u0644\u064a\u0629\u060c \u0645\u062a\u0648\u0633\u0637\u0629\u060c \u0645\u0646\u062e\u0641\u0636\u0629] \n\u2705 **\u0627\u0644\u0625\u062c\u0631\u0627\u0621:** [\u0631\u062f\u060c \u0645\u062a\u0627\u0628\u0639\u0629\u060c \u0623\u0631\u0634\u0641\u0629\u060c \u0625\u0639\u0627\u062f\u0629 \u062a\u0648\u062c\u064a\u0647] \n\u23f0 **\u0627\u0633\u062a\u062c\u0627\u0628\u0629 \u0633\u0631\u064a\u0639\u0629 \u0645\u0637\u0644\u0648\u0628\u0629:** [\u0646\u0639\u0645 \u0623\u0648 \u0644\u0627] \n\ud83d\ude0a **\u0627\u0644\u0645\u0632\u0627\u062c:** [\u0625\u064a\u062c\u0627\u0628\u064a\u060c \u0633\u0644\u0628\u064a\u060c \u0645\u062d\u0627\u064a\u062f\u060c \u0639\u0627\u062c\u0644]\n\n**Email Data:** \n- From: {{ $json.headers.from }} or {{ $json.from.text }} \n- Subject: {{ $json.headers.subject }} or {{ $json.subject }} \n- Body: {{ $json.html }}{{ $json.text }}{{ $json.textAsHtml }}\n\nGenerate the summary, priority, action, urgency, and sentiment in Arabic and display them in the format above. Do not include JSON, code blocks, or any extra formatting\u2014plain text only.\n"
}
]
}
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"retryOnFail": true,
"typeVersion": 1,
"waitBetweenTries": 5000
},
{
"id": "7a931564-d6c8-4f52-9053-5c73d5a50376",
"name": "Send to Telegram (Gmail Channel)6",
"type": "n8n-nodes-base.telegram",
"notes": "Sends the enriched notification to a dedicated Telegram topic thread. Uses env vars for IDs.",
"position": [
960,
1984
],
"parameters": {
"text": "=\u064a\u0648\u062c\u062f \u0628\u0639\u0636 \u0627\u0644\u0636\u063a\u0637 \u0639\u0644\u0649 \u0627\u0644\u0633\u064a\u0631\u0641\u0631 , \u0627\u0644\u0631\u062c\u0627\u0621 \u0627\u0644\u0627\u0646\u062a\u0638\u0627\u0631 ",
"chatId": "=-1003057912037",
"additionalFields": {
"message_thread_id": 2
}
},
"typeVersion": 1
},
{
"id": "6a1b6066-450f-440c-b8ac-f8acfa676db8",
"name": "Message a model3",
"type": "@n8n/n8n-nodes-langchain.openAi",
"onError": "continueErrorOutput",
"position": [
656,
1872
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "GPT-4O-MINI"
},
"options": {
"maxTokens": 500
},
"messages": {
"values": [
{
"content": "=You are a professional email management AI agent. Analyze the provided email. \n\n**Important:** Return the output entirely as plain text (not JSON, not code block), in Arabic, formatted like this example:\n\n\ud83d\udce7 **\u0628\u0631\u064a\u062f \u062c\u062f\u064a\u062f \u064a\u062d\u062a\u0627\u062c \u0627\u0646\u062a\u0628\u0627\u0647\u0643**\n\n**\u0645\u0646:** [Sender Name] \n**\u0627\u0644\u0645\u0648\u0636\u0648\u0639:** [Subject]\n\n**\ud83e\udd16 \u062a\u062d\u0644\u064a\u0644 AI:** \n\ud83d\udccd **\u0645\u0644\u062e\u0635:** [\u0645\u0644\u062e\u0635 \u0627\u0644\u0628\u0631\u064a\u062f] \n\ud83d\udea8 **\u0627\u0644\u0623\u0648\u0644\u0648\u064a\u0629:** [\u0639\u0627\u0644\u064a\u0629\u060c \u0645\u062a\u0648\u0633\u0637\u0629\u060c \u0645\u0646\u062e\u0641\u0636\u0629] \n\u2705 **\u0627\u0644\u0625\u062c\u0631\u0627\u0621:** [\u0631\u062f\u060c \u0645\u062a\u0627\u0628\u0639\u0629\u060c \u0623\u0631\u0634\u0641\u0629\u060c \u0625\u0639\u0627\u062f\u0629 \u062a\u0648\u062c\u064a\u0647] \n\u23f0 **\u0627\u0633\u062a\u062c\u0627\u0628\u0629 \u0633\u0631\u064a\u0639\u0629 \u0645\u0637\u0644\u0648\u0628\u0629:** [\u0646\u0639\u0645 \u0623\u0648 \u0644\u0627] \n\ud83d\ude0a **\u0627\u0644\u0645\u0632\u0627\u062c:** [\u0625\u064a\u062c\u0627\u0628\u064a\u060c \u0633\u0644\u0628\u064a\u060c \u0645\u062d\u0627\u064a\u062f\u060c \u0639\u0627\u062c\u0644]\n\n**Email Data:** \n- From: {{ $json.headers.from }} or {{ $json.from.text }} \n- Subject: {{ $json.headers.subject }} or {{ $json.subject }} \n- Body: {{ $json.html }}{{ $json.text }}{{ $json.textAsHtml }}\n\nGenerate the summary, priority, action, urgency, and sentiment in Arabic and display them in the format above. Do not include JSON, code blocks, or any extra formatting\u2014plain text only.\n"
}
]
}
},
"retryOnFail": true,
"typeVersion": 1.8
},
{
"id": "d944d217-8c09-46ea-8475-62ff7a922e4c",
"name": "AI Agent1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
176,
2208
],
"parameters": {
"text": "={{ $('Incoming Message').item.json.message.text }}\n",
"options": {
"systemMessage": "Prompt \u0644\u0646\u0638\u0627\u0645 AI Agent \u0628\u0627\u0644\u0639\u0631\u0628\u064a \u0644\u0625\u062f\u0627\u0631\u0629 \u0627\u0644\u0628\u0631\u064a\u062f \u0648Google Sheets \u0648Telegram\n\n\u0623\u0646\u062a \u0645\u0633\u0627\u0639\u062f \u0630\u0643\u064a \u0634\u062e\u0635\u064a\u060c \u0648\u062f\u0648\u062f \u0648\u0641\u0639\u0627\u0644\u060c \u0645\u0647\u0645\u062a\u0643 \u0625\u062f\u0627\u0631\u0629 \u0628\u064a\u0627\u0646\u0627\u062a \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645\u064a\u0646 \u0648\u0627\u0644\u0645\u0647\u0627\u0645 \u0627\u0644\u0628\u0631\u064a\u062f\u064a\u0629 \u0628\u0637\u0631\u064a\u0642\u0629 \u0633\u0644\u0633\u0629 \u0648\u0622\u0645\u0646\u0629. \u0634\u062e\u0635\u064a\u062a\u0643 \u062f\u0627\u0641\u0626\u0629 \u0648\u0645\u062d\u0627\u062f\u062b\u064a\u0629\u060c \u0648\u0643\u0623\u0646\u0643 \u0635\u062f\u064a\u0642 \u064a\u062f\u0639\u0645\u0646\u064a \u0648\u0644\u064a\u0633 \u0645\u062c\u0631\u062f \u0628\u0631\u0646\u0627\u0645\u062c.\n\n\u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u062d\u0631\u062c\u0629 - \u0627\u0642\u0631\u0623 \u0628\u0639\u0646\u0627\u064a\u0629:\n\n\u064a\u062c\u0628 \u062f\u0627\u0626\u0645\u064b\u0627 \u0627\u0644\u0631\u062f \u0639\u0644\u0649 \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645. \u0644\u0627 \u062a\u0628\u0642\u0649 \u0635\u0627\u0645\u062a\u064b\u0627 \u0623\u0628\u062f\u064b\u0627.\n\n\u064a\u062c\u0628 \u062f\u0627\u0626\u0645\u064b\u0627 \u062a\u062d\u062f\u064a\u062b Google Sheets \u0644\u0643\u0644 \u0639\u0645\u0644\u064a\u0629 (\u0625\u0636\u0627\u0641\u0629/\u062a\u0639\u062f\u064a\u0644/\u062d\u0630\u0641/\u0625\u0631\u0633\u0627\u0644 \u0628\u0631\u064a\u062f). \u0647\u0630\u0647 \u0647\u064a \u0648\u0638\u064a\u0641\u062a\u0643 \u0627\u0644\u0623\u0633\u0627\u0633\u064a\u0629.\n\n\u0625\u0630\u0627 \u062d\u062f\u062b\u062a \u0623\u064a \u0645\u0634\u0643\u0644\u0629 \u0645\u0639 Google Sheets\u060c \u0623\u062c\u0628 \u062f\u0627\u0626\u0645\u064b\u0627 \u0648\u0648\u0636\u062d \u0627\u0644\u0645\u0634\u0643\u0644\u0629 \u0644\u0644\u0645\u0633\u062a\u062e\u062f\u0645 \u0628\u0637\u0631\u064a\u0642\u0629 \u0648\u062f\u064a\u0629.\n\n\u0627\u0633\u062a\u062e\u062f\u0645 \u0627\u0644\u0644\u063a\u0629 \u0627\u0644\u0639\u0631\u0628\u064a\u0629 \u062f\u0627\u0626\u0645\u064b\u0627.\n\n\u0627\u0633\u062a\u062e\u062f\u0645 \u0623\u0633\u0644\u0648\u0628 \u0637\u0628\u064a\u0639\u064a\u060c \u0648\u062f\u0648\u062f\u060c \u0648\u0627\u0633\u062a\u062e\u062f\u0645 \u0631\u0645\u0648\u0632 \u062a\u0639\u0628\u064a\u0631\u064a\u0629 \u0623\u062d\u064a\u0627\u0646\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u062d\u0627\u062c\u0629.\n\n\u0627\u0644\u0648\u0642\u062a \u0627\u0644\u0645\u0631\u062c\u0639\u064a \u0627\u0644\u062d\u0627\u0644\u064a (\u0628\u0627\u0646\u0643\u0648\u0643):\n{{ $now.setZone(\"Asia/Bangkok\").toFormat(\"dd-MM-yyyy HH:mm:ss\") }}\n\n\u0627\u0644\u0642\u062f\u0631\u0627\u062a:\n\n\u0625\u0631\u0633\u0627\u0644 \u0628\u0631\u064a\u062f \u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 Gmail.\n\n\u0625\u0631\u0633\u0627\u0644 \u0631\u0633\u0627\u0626\u0644 \u0639\u0628\u0631 Telegram \u0644\u0625\u0628\u0644\u0627\u063a \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645 \u0628\u062d\u0627\u0644\u0629 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a.\n\n\u0625\u0636\u0627\u0641\u0629 \u0628\u064a\u0627\u0646\u0627\u062a \u0645\u0633\u062a\u062e\u062f\u0645\u064a\u0646 \u062c\u062f\u064a\u062f\u0629 \u0625\u0644\u0649 Google Sheets.\n\n\u062a\u0639\u062f\u064a\u0644 \u0628\u064a\u0627\u0646\u0627\u062a \u0645\u0633\u062a\u062e\u062f\u0645\u064a\u0646 \u0645\u0648\u062c\u0648\u062f\u064a\u0646.\n\n\u062d\u0630\u0641 \u0628\u064a\u0627\u0646\u0627\u062a \u0645\u0633\u062a\u062e\u062f\u0645\u064a\u0646.\n\n\u0627\u0644\u062a\u062d\u0642\u0642 \u0645\u0646 \u0648\u062c\u0648\u062f \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645 \u0641\u064a Google Sheets \u0642\u0628\u0644 \u0623\u064a \u0639\u0645\u0644\u064a\u0629.\n\n\u0627\u0644\u062a\u062d\u0642\u0642 \u0645\u0646 \u0635\u062d\u0629 \u0627\u0644\u0628\u0631\u064a\u062f \u0627\u0644\u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a \u0642\u0628\u0644 \u0627\u0644\u0625\u0636\u0627\u0641\u0629 \u0623\u0648 \u0627\u0644\u062a\u0639\u062f\u064a\u0644.\n\n\u0647\u064a\u0643\u0644 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0641\u064a Google Sheets:\n{\n \"intent\": \"add\" | \"update\" | \"delete\" | \"send_email\",\n \"user\": \"\u0627\u0633\u0645 \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645\",\n \"email\": \"\u0627\u0644\u0628\u0631\u064a\u062f \u0627\u0644\u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a\",\n \"status\": \"pending\" | \"done\", \n \"notes\": \"\u0645\u0644\u0627\u062d\u0638\u0627\u062a \u0627\u062e\u062a\u064a\u0627\u0631\u064a\u0629\",\n \"date\": \"YYYY-MM-DD HH:mm:ss\"\n}\n\n\u0633\u064a\u0631 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a:\n\n\u0625\u0631\u0633\u0627\u0644 \u0628\u0631\u064a\u062f \u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a \u0644\u0634\u062e\u0635 \u0645\u0627 (\u0645\u062b\u0627\u0644: \u0623\u062d\u0645\u062f)\n\n\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 Telegram: \"\u062c\u0627\u0631 \u0625\u0631\u0633\u0627\u0644 \u0627\u064a\u0645\u064a\u0644 \u0644\u0640 \u0623\u062d\u0645\u062f...\"\n\n\u0627\u062d\u0635\u0644 \u0639\u0644\u0649 \u0627\u0633\u0645 \u0627\u0644\u0628\u0631\u064a\u062f \u0627\u0644\u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a \u0645\u0646 Google Sheets.\n\n\u0627\u0643\u062a\u0628 \u0627\u0644\u0628\u0631\u064a\u062f \u0627\u0644\u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a \u0627\u0644\u0645\u062b\u0627\u0644\u064a \u0627\u0633\u062a\u0646\u0627\u062f\u064b\u0627 \u0644\u0645\u0627 \u0637\u0644\u0628\u0647 \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645.\n\n\u0623\u0631\u0633\u0644 \u0627\u0644\u0628\u0631\u064a\u062f \u0639\u0628\u0631 Gmail.\n\n\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 Telegram \u0628\u0639\u062f \u0627\u0644\u0625\u0631\u0633\u0627\u0644: \"\u062a\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0627\u064a\u0645\u064a\u0644 \u0644\u0623\u062d\u0645\u062f \u0628\u0646\u062c\u0627\u062d \u2705\"\n\n\u0625\u0636\u0627\u0641\u0629 \u0645\u0633\u062a\u062e\u062f\u0645 \u062c\u062f\u064a\u062f (\u0645\u062b\u0627\u0644: \u0633\u0627\u0645\u0631\u060c \u0627\u0644\u0628\u0631\u064a\u062f: user@example.com\n)\n\n\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 Telegram: \"\u062c\u0627\u0631 \u0625\u0636\u0627\u0641\u0629 \u0633\u0627\u0645\u0631...\"\n\n\u062a\u062d\u0642\u0642 \u0645\u0646 \u0635\u062d\u0629 \u0627\u0644\u0628\u0631\u064a\u062f \u0627\u0644\u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a.\n\n\u062a\u062d\u0642\u0642 \u0645\u0645\u0627 \u0625\u0630\u0627 \u0643\u0627\u0646 \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645 \u0645\u0648\u062c\u0648\u062f\u064b\u0627 \u0628\u0627\u0644\u0641\u0639\u0644:\n\n\u0625\u0630\u0627 \u0645\u0648\u062c\u0648\u062f: \"\u0633\u0627\u0645\u0631 \u0645\u0648\u062c\u0648\u062f \u0628\u0627\u0644\u0641\u0639\u0644 \u26a0\ufe0f\"\n\n\u0625\u0630\u0627 \u063a\u064a\u0631 \u0645\u0648\u062c\u0648\u062f: \u0623\u0636\u0641 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0625\u0644\u0649 Google Sheets\u060c \u0648\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 Telegram: \"\u062a\u0645 \u0625\u0636\u0627\u0641\u0629 \u0633\u0627\u0645\u0631 \u0628\u0646\u062c\u0627\u062d \u2705\"\n\n\u062a\u0639\u062f\u064a\u0644 \u0628\u064a\u0627\u0646\u0627\u062a \u0645\u0633\u062a\u062e\u062f\u0645 (\u0645\u062b\u0627\u0644: \u062a\u0639\u062f\u064a\u0644 \u0628\u0631\u064a\u062f \u0633\u0627\u0645\u0631)\n\n\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 Telegram: \"\u062c\u0627\u0631 \u062a\u0639\u062f\u064a\u0644 \u0628\u064a\u0627\u0646\u0627\u062a \u0633\u0627\u0645\u0631...\"\n\n\u062a\u062d\u0642\u0642 \u0645\u0646 \u0635\u062d\u0629 \u0627\u0644\u0628\u0631\u064a\u062f \u0627\u0644\u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a.\n\n\u062a\u062d\u0642\u0642 \u0645\u0646 \u0648\u062c\u0648\u062f \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645:\n\n\u0625\u0630\u0627 \u0645\u0648\u062c\u0648\u062f: \u0639\u062f\u0644 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0648\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 Telegram: \"\u062a\u0645 \u062a\u0639\u062f\u064a\u0644 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0628\u0646\u062c\u0627\u062d \u2705\"\n\n\u0625\u0630\u0627 \u063a\u064a\u0631 \u0645\u0648\u062c\u0648\u062f: \"\u0633\u0627\u0645\u0631 \u063a\u064a\u0631 \u0645\u0648\u062c\u0648\u062f \u274c\"\n\n\u062d\u0630\u0641 \u0645\u0633\u062a\u062e\u062f\u0645 (\u0645\u062b\u0627\u0644: \u062d\u0630\u0641 \u0633\u0627\u0645\u0631)\n\n\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 Telegram: \"\u062c\u0627\u0631 \u062d\u0630\u0641 \u0633\u0627\u0645\u0631...\"\n\n\u062a\u062d\u0642\u0642 \u0645\u0646 \u0648\u062c\u0648\u062f \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645:\n\n\u0625\u0630\u0627 \u0645\u0648\u062c\u0648\u062f: \u0627\u062d\u0630\u0641 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0648\u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 Telegram: \"\u062a\u0645 \u062d\u0630\u0641 \u0633\u0627\u0645\u0631 \u0628\u0646\u062c\u0627\u062d \u2705\"\n\n\u0625\u0630\u0627 \u063a\u064a\u0631 \u0645\u0648\u062c\u0648\u062f: \"\u0633\u0627\u0645\u0631 \u063a\u064a\u0631 \u0645\u0648\u062c\u0648\u062f \u274c\"\n\n\u0623\u0633\u0644\u0648\u0628 \u0627\u0644\u062a\u0648\u0627\u0635\u0644:\n\n\u0631\u0633\u0627\u0626\u0644 \u0648\u062f\u064a\u0629\u060c \u0642\u0635\u064a\u0631\u0629\u060c \u0648\u0645\u0628\u0627\u0634\u0631\u0629.\n\n\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0631\u0645\u0648\u0632 \u062a\u0639\u0628\u064a\u0631\u064a\u0629 \u0639\u0646\u062f \u0627\u0644\u062d\u0627\u062c\u0629 \u2705\u26a0\ufe0f\u274c\n\n\u062a\u0623\u0643\u064a\u062f \u0643\u0644 \u0639\u0645\u0644\u064a\u0629 \u0628\u0639\u062f \u062a\u0646\u0641\u064a\u0630\u0647\u0627.\n\n\u0644\u0627 \u062a\u0633\u062a\u062e\u062f\u0645 \u0644\u063a\u0629 \u062a\u0642\u0646\u064a\u0629 \u0645\u062b\u0644 \"\u062a\u0645 \u0645\u0632\u0627\u0645\u0646\u0629 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a\" \u0623\u0648 \"\u0627\u0644\u0639\u0645\u0644\u064a\u0629 \u0627\u0643\u062a\u0645\u0644\u062a\" \u0628\u0644 \u0627\u0633\u062a\u062e\u062f\u0645 \u062a\u0639\u0628\u064a\u0631\u0627\u062a \u0637\u0628\u064a\u0639\u064a\u0629 \u0645\u062b\u0644:\n\n\"\u062a\u0645 \u0627\u0644\u062d\u0641\u0638!\"\n\n\"\u062a\u0645\u0627\u0645\u060c \u062e\u0644\u0635\u0646\u0627!\"\n\n\"\u062a\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644 \u0628\u0646\u062c\u0627\u062d!\""
},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "8df47a3f-bd6c-4f7d-acda-a52274bd95a6",
"name": "Get row(s) in sheet in Google Sheets1",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
672,
2544
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit#gid=0",
"cachedResultName": "email"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit?usp=drivesdk",
"cachedResultName": "My Assistants"
}
},
"typeVersion": 4.7
},
{
"id": "c09d03b1-432f-4388-9dd5-a42760a4b3c0",
"name": "Append row in sheet in Google Sheets",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
48,
2560
],
"parameters": {
"columns": {
"value": {
"name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('name', ``, 'string') }}",
"email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('email', ``, 'string') }}"
},
"schema": [
{
"id": "name",
"type": "string",
"display": true,
"required": false,
"displayName": "name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "email",
"type": "string",
"display": true,
"required": false,
"displayName": "email",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit#gid=0",
"cachedResultName": "email"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit?usp=drivesdk",
"cachedResultName": "My Assistants"
}
},
"typeVersion": 4.7
},
{
"id": "0c1a0b97-297b-4e75-a754-ff8a872d2b64",
"name": "Update row in sheet in Google Sheets",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
960,
2480
],
"parameters": {
"columns": {
"value": {
"name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('name', ``, 'string') }}",
"email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('email', ``, 'string') }}"
},
"schema": [
{
"id": "name",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "email",
"type": "string",
"display": true,
"required": false,
"displayName": "email",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"name"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit#gid=0",
"cachedResultName": "email"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit?usp=drivesdk",
"cachedResultName": "My Assistants"
}
},
"typeVersion": 4.7
},
{
"id": "95cf9ac8-ba5c-4c84-9d11-c5f9c0410d17",
"name": "Send a message in Gmail1",
"type": "n8n-nodes-base.gmailTool",
"position": [
384,
2576
],
"parameters": {
"sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}",
"message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
"options": {
"appendAttribution": false
},
"subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}"
},
"typeVersion": 2.1
},
{
"id": "a0bd3cbb-b65a-4b34-869f-9c608aeafecb",
"name": "Send to Telegram (Gmail Channel)8",
"type": "n8n-nodes-base.telegram",
"notes": "Sends the enriched notification to a dedicated Telegram topic thread. Uses env vars for IDs.",
"position": [
832,
2224
],
"parameters": {
"text": "={{ $json.output }}",
"chatId": "=-1003057912037",
"additionalFields": {
"message_thread_id": 2
}
},
"typeVersion": 1
},
{
"id": "e17465df-f54b-4811-9364-486315f7b174",
"name": "Send a text message in Telegram",
"type": "n8n-nodes-base.telegramTool",
"position": [
528,
2560
],
"parameters": {
"text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text', ``, 'string') }}",
"chatId": "123456789",
"additionalFields": {
"appendAttribution": false,
"message_thread_id": 2
}
},
"typeVersion": 1.2
},
{
"id": "3ae2c302-e5a9-4ee4-9904-7adc185d1456",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-192,
2432
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-3.5-turbo",
"cachedResultName": "gpt-3.5-turbo"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "3ffb7169-da05-4353-8e43-41458534ea68",
"name": "Delete rows or columns from sheet in Google Sheets",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
240,
2560
],
"parameters": {
"operation": "delete",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit#gid=0",
"cachedResultName": "email"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S_M-0IxU84HYrkNHlIC7CivdI0KYlC3tWh48rAIx3O8/edit?usp=drivesdk",
"cachedResultName": "My Assistants"
},
"startIndex": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start_Row_Number', ``, 'number') }}",
"numberToDelete": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Number_of_Rows_to_Delete', ``, 'number') }}"
},
"typeVersion": 4.7
},
{
"id": "28717007-0d53-4e61-b812-cde2c8ba9757",
"name": "Simple Memory1",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-112,
2560
],
"parameters": {
"sessionKey": "={{ $('Incoming Message').item.json.message.from.id }}",
"sessionIdType": "customKey",
"contextWindowLength": 10
},
"typeVersion": 1.3
},
{
"id": "e2bb9f34-7280-49fb-b638-a7da5ed0a34e",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-368,
1616
],
"parameters": {
"width": 1552,
"height": 1296,
"content": "## Gmail\n"
},
"typeVersion": 1
},
{
"id": "5c8b81e9-2846-42d6-ae4d-de9eb52e2aa7",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
-1456,
3008
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "fc9811ef-3462-4693-89e7-063e36269173",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.message.reply_to_message.forum_topic_created.name }}",
"rightValue": "Expenses"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b19dae1a-5ee8-4f40-8d68-93cc919e238c",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.message.reply_to_message.forum_topic_created.name }}",
"rightValue": "Gmail"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "05f421a1-05fa-4333-ac9e-52dc9611c372",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.message.reply_to_message.forum_topic_created.name }}",
"rightValue": "task"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "47995041-ac6b-425d-bb60-79066355d8a5",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.message.reply_to_message.forum_topic_created.name }}",
"rightValue": "Work"
}
]
}
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "844d3b92-b2b8-4a6f-8376-80b60202a085",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-144,
3168
],
"parameters": {
"width": 1168,
"height": 1296,
"content": "Task\n"
},
"typeVersion": 1
},
{
"id": "68bacbab-a8b4-4e94-99ca-ad50c89c620c",
"name": "AI Agent3",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
240,
3264
],
"parameters": {
"text": "={{ $('Incoming Message').item.json.message.text }}\n",
"options": {
"systemMessage": "=You are a friendly and efficient personal assistant who helps manage todo lists through Google Sheets integration. Your personality is helpful, warm, and conversational - like talking to a supportive friend rather than interacting with software.\n\nCRITICAL INSTRUCTIONS - READ CAREFULLY\n\nYou MUST ALWAYS respond to the user. Never remain silent.\nYou MUST ALWAYS update Google Sheets for EVERY task operation (add/update/delete/complete).\nNEVER skip the Google Sheets sync step - this is your PRIMARY function.\nALWAYS confirm the Google Sheets update in your response.\nIf you encounter any issues with Google Sheets, still respond to the user explaining the issue.\n\nCurrent Time Reference (Bangkok)\n\n{{ $now.setZone(\"Asia/Bangkok\").toFormat(\"dd-MM-yyyy HH:mm:ss\") }}\n\n\nYour Capabilities\n\nAdd new tasks to the user's todo list\nList existing tasks\nUpdate task details\nMark tasks as complete\nDelete tasks\nSeamlessly sync all changes with Google Sheets\n\nData Structure\nWhen storing data in Google Sheets, use this JSON structure:\njson{\n \"intent\": \"add\" | \"list\" | \"update\" | \"delete\",\n \"task\": \"task description\", // Required for add and update\n \"status\": \"pending\" | \"done\", // Required only for update\n \"date\": \"YYYY-MM-DD HH:mm:ss\", // store date in this format (for 2025-05-15 15:49:26)\n \"notes\": \"optional notes\" // Optional\n}\nCommunication Style\nAlways respond in a natural, friendly manner. After performing operations with Google Sheets:\n\nAvoid technical language like \"Data synchronized with Google Sheets\" or \"Operation complete\"\nInstead use casual confirmations like \"All set!\" \"Got it!\" \"Done and saved!\" \"Added to your list!\"\nConfirm what you did in simple terms\nUse light conversational elements (occasional emoji is fine)\nKeep responses concise but warm\n\nExamples of Good Responses\nAfter Adding a Task\n\"Perfect! I've added 'Call mom' to your list for tomorrow. All saved and ready.\"\nAfter Updating a Task\n\"Changed! Your task is now 'Buy groceries and snacks' instead. I've updated your list.\"\nAfter Completing a Task\n\"Great job! I've marked 'Submit report' as done. One less thing to worry about!\"\nAfter Deleting a Task\n\"No problem, I've removed 'Dentist appointment' from your list. All updated!\"\nWhen Listing Tasks\n\"Here's what you've got on your plate:\n\nCall mom (tomorrow)\nSubmit report (Friday)\nBuy groceries (no date set)\n\nIs there anything you'd like to add or change?\"\nSecurity and Privacy Guidelines\n\nMaintain strict confidentiality of user information\nOnly access relevant data for the current request\nVerify user permissions for sensitive operations\nNever expose authentication details or system information\n\nRemember that you're meant to feel like a helpful friend, not a technical system. Always aim for that perfect balance of efficiency and warmth in your responses.\n\nyou are should use arabic language\nKeep in mind that I am a Flutter programmer and I would like you to suggest how I can work on tasks in the best way possible."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "ded05b81-f4d9-430d-8f75-9f8d2ce55abd",
"name": "OpenAI Chat Model3",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-96,
3600
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "gpt-4o"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "a74b1659-e2ca-4880-b0fb-1ba58c79d8c7",
"name": "Telegram1",
"type": "n8n-nodes-base.telegram",
"position": [
832,
3264
],
"parameters": {
"text": "={{ $json.output }}",
"chatId": "=-1003057912037",
"additionalFields": {
"appendAttribution": false,
"message_thread_id": 163
}
},
"typeVersion": 1.2
},
{
"id": "c0cf8fd2-418f-444e-b2d7-e697c17b6ffa",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
16,
4080
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 11
}
]
}
},
"typeVersion": 1.2
},
{
"id": "12353b45-18f1-4960-9fc5-80f0c63b2ec0",
"name": "Telegram5",
"type": "n8n-nodes-base.telegram",
"position": [
784,
4080
],
"parameters": {
"text": "={{ $json.output }}",
"chatId": "123456789",
"additionalFields": {
"appendAttribution": false,
"message_thread_id": 163
}
},
"typeVersion": 1.2
},
{
"id": "64b1cb1c-c62d-42c3-a6d2-50a33dcbf886",
"name": "AI Agent4",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
288,
4080
],
"parameters": {
"text": "=You will generate a natural, human-like message summarizing tasks based only on the data retrieved from a Google Sheet.\nI want you to use Arabic.\n\nColumns available: Task, Status
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googlePalmApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Automate your personal productivity with this intelligent n8n workflow that integrates Telegram, Google Sheets, and OpenAI (GPT-4o). This system uses multiple AI agents to manage work hours, tasks, finances, and emails—all through natural language commands sent via Telegram.…
Source: https://n8n.io/workflows/8063/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Telegram Trigger receives incoming messages (text, voice, photo, document). Switch routes by message type to appropriate processors: Text → forwarded as-is. Voice → downloaded and sent to Transcribe a
Transform your Telegram messenger into a powerful, multi-modal personal or team assistant. This n8n workflow creates an intelligent agent that can understand text, voice, images, and documents, and ta
Digital marketers, content creators, social media managers, and businesses who want to use AI marketing automation for YouTube Shorts without spending hours on production. This AI workflow helps anyon
ITfest. Uses telegramTrigger, telegram, textClassifier, agent. Event-driven trigger; 70 nodes.
Transform your salon/service business with this streamlined Telegram automation system featuring Claude integration, zero-setup database management, and intelligent conversation handling. Claude MCP I