This workflow corresponds to n8n.io template #13160 — we link there as the canonical source.
This workflow follows the Agent → Agenttool 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 →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "a42f93ee-e6fa-4040-a1b6-62fc329f70b9",
"name": "Calculator",
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"position": [
864,
16
],
"parameters": {},
"typeVersion": 1
},
{
"id": "f257b156-dc41-4492-b348-a154cbe3c20c",
"name": "Append row in sheet in Google Sheets",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
944,
432
],
"parameters": {
"columns": {
"value": {
"date": "={{$now.toFormat('d-M-yyyy HH:mm')}}",
"type": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('type', ``, 'string') }}",
"amount": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('amount', ``, 'string') }}",
"category": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('category', ``, 'string') }}",
"description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('description', ``, 'string') }}"
},
"schema": [
{
"id": "type",
"type": "string",
"display": true,
"required": false,
"displayName": "type",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "amount",
"type": "string",
"display": true,
"required": false,
"displayName": "amount",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "date",
"type": "string",
"display": true,
"required": false,
"displayName": "date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "category",
"type": "string",
"display": true,
"required": false,
"displayName": "category",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "description",
"type": "string",
"display": true,
"required": false,
"displayName": "description",
"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/1A2NOTd2OJwGgL_0t-QvEuLO0gaC5QKUDisy7jQwFAsI/edit#gid=0",
"cachedResultName": "EXPENSES"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1A2NOTd2OJwGgL_0t-QvEuLO0gaC5QKUDisy7jQwFAsI",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1A2NOTd2OJwGgL_0t-QvEuLO0gaC5QKUDisy7jQwFAsI/edit?usp=drivesdk",
"cachedResultName": "Expense Tracker"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "dd1a9dc6-7abc-42fb-a4d4-40ca980333f3",
"name": "Get row(s) in sheet in Google Sheets",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
1072,
432
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', ``, 'string') }}",
"lookupColumn": "date"
},
{
"lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values1_Value', ``, 'string') }}",
"lookupColumn": "category"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1A2NOTd2OJwGgL_0t-QvEuLO0gaC5QKUDisy7jQwFAsI/edit#gid=0",
"cachedResultName": "EXPENSES"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1A2NOTd2OJwGgL_0t-QvEuLO0gaC5QKUDisy7jQwFAsI",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1A2NOTd2OJwGgL_0t-QvEuLO0gaC5QKUDisy7jQwFAsI/edit?usp=drivesdk",
"cachedResultName": "Expense Tracker"
},
"combineFilters": "OR"
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "dc990648-0a23-4932-8188-0617818bf885",
"name": "OpenAI Chat Model4",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
816,
432
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "393a3daf-e91c-4e7b-8de5-074b50c7f098",
"name": "expense-tracker",
"type": "@n8n/n8n-nodes-langchain.agentTool",
"position": [
912,
224
],
"parameters": {
"text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
"options": {
"systemMessage": "=You are a precise personal finance assistant focused ONLY on expense tracking.\n\nAvailable tools:\n\u2022 Get row(s) in sheet in Google Sheets \u2192 read / filter expenses (use when user asks for summary, list, total, report, category breakdown, date range etc.)\n\u2022 Append row in sheet in Google Sheets \u2192 add new expense (use when user reports spending)\n\nColumns in sheet: type, amount, category, description, date (auto-filled)\n\nBehavior rules:\n\nWhen user reports spending \u2192 extract type, amount (number only, PKR), category, description, then append row.\n\nWhen user asks for summary / list / total / report \u2192 get row(s) with appropriate filters, then summarize concisely.\n\nAlways return amounts in PKR. Format nicely (e.g., \"Total food this month: 18,450 PKR\").\n\nIf ambiguous \u2192 ask ONE clarifying question.\n\nNever modify or delete rows \u2014 only read or append.\n\nBe accurate with numbers and dates.\n\nFinal answer should be short and tabular when showing multiple rows.\n\nExecute commands directly as instructed by the main agent.\nCurrent date: {{$now.toFormat('yyyy-MM-dd')}}\n\nRespond only with final answer or tool calls \u2014 no explanations, reasoning, or extra comments."
},
"toolDescription": "This agent will used for recording expenses and returning summaries when asked"
},
"typeVersion": 3
},
{
"id": "587260b9-5105-493e-b4de-cfb61b5eb039",
"name": "Task-manager-agent",
"type": "@n8n/n8n-nodes-langchain.agentTool",
"position": [
1536,
224
],
"parameters": {
"text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
"options": {
"systemMessage": "=You are a task execution agent for Google Tasks.\n\nYou DO NOT interpret user intent.\nYou DO NOT verify information.\nYou DO NOT ask questions unless explicitly instructed.\n\nYou ONLY execute the instruction provided by the main agent.\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nABSOLUTE RULES\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n1. Trust all IDs and values provided in the input.\n2. NEVER verify IDs by calling \"get list\".\n3. NEVER infer or guess missing information.\n4. NEVER call any tool unless explicitly required by the instruction.\n5. Call ONLY ONE tool per request.\n6. Use the provided values exactly as given.\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nEXECUTION LOGIC\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n- If input contains \"listId\":\n \u2192 Use it directly.\n \u2192 Call \"get tasks\".\n- If input contains \"createTask\":\n \u2192 Call \"Create a task in Google Tasks\".\n- If input contains \"createList\":\n \u2192 Call \"create list\".\n- If input contains \"updateTask\":\n \u2192 Call \"update task\".\n- If input contains \"deleteTask\":\n \u2192 Call \"delete task\".\n\nDO NOT perform any additional checks.\nDO NOT request confirmation.\nDO NOT call \"get list\" unless explicitly told to do so.\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nOUTPUT\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n- Return tool output as-is.\n- Do not add explanations.\n- Do not add extra text.\n\nCurrent date: {{$now.toFormat('yyyy-MM-dd')}}\n"
},
"toolDescription": "This will look after Google Tasks"
},
"typeVersion": 3
},
{
"id": "bcd84d68-b761-4619-9e7f-410452c7e647",
"name": "Tweet-agent",
"type": "@n8n/n8n-nodes-langchain.agentTool",
"position": [
2144,
224
],
"parameters": {
"text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
"options": {
"systemMessage": "=you are tweet agent\n\nuse post tweet tool to post.\n\nIf tweet is larger than 280 characters then suggest alternative\n\nIf you get Instructions to post a tweet then post it.\n\nnote: post only once"
},
"toolDescription": "This will do tweet"
},
"typeVersion": 3
},
{
"id": "17506000-9c4f-4b52-998c-537efbd94fd2",
"name": "Create Tweet in X",
"type": "n8n-nodes-base.twitterTool",
"position": [
2304,
432
],
"parameters": {
"text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text', ``, 'string') }}",
"additionalFields": {}
},
"credentials": {
"twitterOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "42fd020a-dcc1-402e-9af7-6f53ba274c49",
"name": "OpenAI Chat Model3",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2160,
432
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "b989707a-6baf-46e6-9d44-5c97426992e0",
"name": "get-gmail",
"type": "@n8n/n8n-nodes-langchain.agentTool",
"position": [
2592,
224
],
"parameters": {
"text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
"options": {
"systemMessage": "=you are gmail returever agent\n\nuse gmail tool attached when given task\n\n\nCurrent date: {{$now.toFormat('yyyy-MM-dd')}}\nKeep every answer very clean, short and structured. \nUse bullet points or numbered lists when showing multiple emails."
},
"toolDescription": "This tool will get Emails"
},
"typeVersion": 3
},
{
"id": "fe0a295f-5852-4915-a82c-8e6d4cfc90dc",
"name": "Get many messages in Gmail",
"type": "n8n-nodes-base.gmailTool",
"position": [
2736,
432
],
"parameters": {
"filters": {
"q": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Search', ``, 'string') }}",
"sender": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Sender', ``, 'string') }}",
"labelIds": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Label_Names_or_IDs', ``, 'string') }}",
"receivedAfter": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Received_After', ``, 'string') }}",
"receivedBefore": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Received_Before', ``, 'string') }}"
},
"operation": "getAll",
"returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "b00337c5-da5b-4347-ba20-887752b91999",
"name": "OpenAI Chat Model2",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2592,
432
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "b27b1739-fa14-41ab-bb63-dd7f094a744d",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
400,
0
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "42e2c543-db67-4b21-92a9-cd36ee33a84b",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1296,
432
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "df9c0dce-d5f9-4c86-94cd-8ccb481c3908",
"name": "Transcribe a recording",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
784,
-528
],
"parameters": {
"options": {},
"resource": "audio",
"operation": "transcribe"
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "52935b3c-e4dd-4978-beae-4a9fc5dab7e7",
"name": "download-audio",
"type": "n8n-nodes-base.httpRequest",
"position": [
560,
-528
],
"parameters": {
"url": "={{ $json.body.messageData.fileMessageData.downloadUrl }}",
"options": {}
},
"typeVersion": 4.3
},
{
"id": "f462c7b2-2164-4aed-994f-a85b1dd48531",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
128,
-464
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "audio",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "4e91b085-e2e0-4db2-84eb-cb1d29a574e1",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.messageData.typeMessage }}",
"rightValue": "audioMessage"
}
]
},
"renameOutput": true
},
{
"outputKey": "text",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "9aaebdb5-2671-4028-8cca-92a79534861c",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.messageData.typeMessage }}",
"rightValue": "textMessage"
}
]
},
"renameOutput": true
},
{
"outputKey": "image",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "ae1b36fc-ffa4-41e7-b67a-461160f16a31",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.messageData.typeMessage }}",
"rightValue": "imageMessage"
}
]
},
"renameOutput": true
},
{
"outputKey": "doc",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a255bfb4-c663-4d7d-9bff-59b2715e08e2",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.messageData.typeMessage }}",
"rightValue": "documentMessage"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.4
},
{
"id": "de5adec9-4c8c-406f-8f5a-1bd3aab0f5f2",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-112,
-432
],
"parameters": {
"path": "101813cf-8a7f-4f73-a8c6-3f22ee1f127f",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2.1
},
{
"id": "5583e250-b016-488b-a6d4-157ad21d7d11",
"name": "Generate audio",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
2256,
-288
],
"parameters": {
"input": "={{ $json.output }}",
"voice": "shimmer",
"options": {},
"resource": "audio"
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "ee4f85cd-1a5e-4ab4-94a5-5888e57dbf35",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
736,
16
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "ef6750dd-2606-46cc-b3d5-5def85de005c",
"name": "If",
"type": "n8n-nodes-base.if",
"onError": "continueRegularOutput",
"position": [
2032,
-192
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "ecafc1eb-b95f-4db8-9e21-b0add39af623",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $('set audio to one').item.json.audio }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.3
},
{
"id": "1d6ec277-c2b3-4f41-a90c-e7a2fd93b239",
"name": "main-agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1568,
-192
],
"parameters": {
"text": "={{ $json.text }}",
"options": {
"systemMessage": "=You are \"n8n Wizard\" \u2014 a fast, precise, no-nonsense personal assistant that helps the user manage daily life using ONLY the tools/sub-agents listed below.\n\nCurrent date: 2026-01-19\n\nAvailable tools / sub-agents \u2014 use ONLY when the intent clearly matches:\n\n1. expense-tracker\n \u2192 ANYTHING related to money out / in: recording expenses, income, purchases, viewing history, totals, category breakdowns, monthly/weekly summaries, budgets\n\n2. Task-manager-agent\n \u2192 ANYTHING related to tasks, to-dos, reminders, Google Tasks: create, list, update, complete, delete, show upcoming/due/overdue\n\n3. Tweet-agent\n \u2192 ANYTHING related to X/Twitter: writing posts, threads, drafting content, posting, scheduling ideas\n\n4. get-gmail\n \u2192 ANYTHING related to reading or searching Gmail: find emails, summarize inbox, check specific senders, labels, keywords, recent/unread messages\n \u2192 NEVER use for sending, replying, deleting or archiving\n\n5. Quick-google-search\n \u2192 ONLY when current, factual, real-time or external information is needed that you do not already know for sure:\n \u2022 weather, news, sports scores, stock/crypto prices, exchange rates\n \u2022 definitions, how-to guides, recipes, translations\n \u2022 current events, people, companies, product prices/availability\n \u2022 anything time-sensitive or post-training-cutoff\n\n6. Calculator\n \u2192 ONLY pure math, unit conversions, percentages, financial calculations, date differences \u2014 nothing else\n\nStrict routing rules \u2014 follow exactly:\n\nA. If the user message is clearly about ONE of the first 4 categories above \u2192 call ONLY that one sub-agent.\n Give it a short, complete, self-contained instruction that includes all important details from the user message.\n\nB. If the message requires up-to-date or external knowledge you cannot know \u2192 call Quick-google-search.\n You MUST provide a complete https:// URL (usually a Google search link).\n\nC. If the message is ONLY math / calculation \u2192 call Calculator.\n\nD. If the message matches NONE of the above categories \u2192 answer directly (short + helpful).\n Do NOT force a tool call. Do NOT hallucinate facts.\n\nE. If the message could match multiple tools \u2192 handle step-by-step in separate thoughts/tool calls:\n Example: \"What's the current USD/PKR rate? Also add 5000 PKR expense for groceries.\"\n \u2192 First Quick-google-search \u2192 then expense-tracker\n\nCritical safety rules:\n- NEVER invent numbers, dates, names, prices, email content, task lists, tweet results, etc.\n- If information is missing or ambiguous \u2192 ask ONE clear question \u2014 do NOT guess.\n- For Quick-google-search: you MUST output a full valid URL starting with https:// \u2014 never plain text.\n- For expense-tracker: never guess category, amount or type \u2014 ask if unclear.\n- Keep final answers very concise, natural and friendly.\n- Do not explain your reasoning in the final output unless the user asks.\n- Do not say \"I'm calling a tool\" or similar \u2014 just do the tool call or give the answer.\n\nRouting examples:\n\nUser: \"I spent 3200 on new shoes yesterday\" \u2192 expense-tracker\nUser: \"Remind me to pay electricity bill on 25th\" \u2192 Task-manager-agent\nUser: \"Tweet: Just launched my new n8n workflow!\" \u2192 Tweet-agent\nUser: \"Any emails from Zainab since Friday?\" \u2192 get-gmail\nUser: \"What's the weather like in Lahore right now?\" \u2192 Quick-google-search\nUser: \"19.5% tip on 4850 PKR bill\" \u2192 Calculator\nUser: \"How much did I spend on transport this month?\" \u2192 expense-tracker\nUser: \"Tell me a joke\" \u2192 direct answer (no tool)\n\nRespond ONLY with:\n- a direct final answer, or\n- one or more tool / sub-agent calls\n\nNo chit-chat, no meta comments, no apologies.\nCurrent date: {{$now.toFormat('yyyy-MM-dd')}}"
},
"promptType": "define"
},
"typeVersion": 3.1
},
{
"id": "9d2c7f04-423e-4084-89ca-e2e46f46efa4",
"name": "Create a task in Google Tasks",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
1424,
432
],
"parameters": {
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', ``, 'string') }}",
"method": "POST",
"options": {},
"jsonBody": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"toolDescription": "Use this to create task in google Tasks",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"nodeCredentialType": "googleTasksOAuth2Api"
},
"credentials": {
"googleTasksOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.3
},
{
"id": "9f043c17-fb66-4a10-8e43-c15c98d533f5",
"name": "create list",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
1552,
432
],
"parameters": {
"url": "https://tasks.googleapis.com/tasks/v1/users/@me/lists",
"method": "POST",
"options": {},
"jsonBody": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"nodeCredentialType": "googleTasksOAuth2Api"
},
"credentials": {
"googleTasksOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.3
},
{
"id": "e5426f29-a5f1-4d39-9202-8a4ead033ac3",
"name": "update task",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
1680,
432
],
"parameters": {
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', ``, 'string') }}",
"method": "PATCH",
"options": {},
"jsonBody": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"toolDescription": "update task",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"nodeCredentialType": "googleTasksOAuth2Api"
},
"credentials": {
"googleTasksOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.3
},
{
"id": "7b8e3f6c-b9ff-4254-95dd-9d5e4fdea014",
"name": "get list",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
1808,
432
],
"parameters": {
"url": "https://tasks.googleapis.com/tasks/v1/users/@me/lists",
"options": {},
"authentication": "predefinedCredentialType",
"toolDescription": "Use this node to get all lists",
"nodeCredentialType": "googleTasksOAuth2Api"
},
"credentials": {
"googleTasksOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.3
},
{
"id": "5a8af285-2a03-4052-afad-401f29d0971a",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-192,
-144
],
"parameters": {
"options": {}
},
"typeVersion": 1.4
},
{
"id": "dbfe4c17-b977-4359-8702-8aa26b2c4302",
"name": "get tasks",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
1936,
432
],
"parameters": {
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', ``, 'string') }}",
"options": {},
"jsonBody": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"toolDescription": "use this to get tasks",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"nodeCredentialType": "googleTasksOAuth2Api"
},
"credentials": {
"googleTasksOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.3
},
{
"id": "482968cb-5a05-4c74-bae3-10a08e1f0ead",
"name": "quick-web-search",
"type": "@n8n/n8n-nodes-langchain.toolSerpApi",
"position": [
560,
16
],
"parameters": {
"options": {}
},
"credentials": {
"serpApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "30df0de5-beea-4ed0-8ee8-a912804a8ea7",
"name": "send audio response",
"type": "n8n-nodes-base.httpRequest",
"position": [
2480,
-288
],
"parameters": {
"url": "=https://7105.media.greenapi.com/waInstance7105477333/sendFileByUpload/API_KEY_HERE",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "file",
"parameterType": "formBinaryData",
"inputDataFieldName": "data"
},
{
"name": "chatId",
"value": "={{ $item(\"0\").$node[\"Webhook\"].json[\"body\"][\"senderData\"][\"chatId\"] }}"
}
]
}
},
"typeVersion": 4.3
},
{
"id": "3f88db87-efe8-4fab-95d6-87356f19e993",
"name": "send text response",
"type": "n8n-nodes-base.httpRequest",
"position": [
2256,
-96
],
"parameters": {
"url": "=https://7105.api.greenapi.com/waInstance7105477333/sendMessage/API_KEY_HERE",
"method": "POST",
"options": {
"redirect": {
"redirect": {}
}
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "chatId",
"value": "={{ $item(\"0\").$node[\"Webhook\"].json[\"body\"][\"senderData\"][\"chatId\"] }}"
},
{
"name": "message",
"value": "={{ $json.output }}"
}
]
}
},
"typeVersion": 4.3
},
{
"id": "7a6cdfac-b462-4538-b22a-ee9bf6846c13",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1088,
-544
],
"parameters": {
"width": 736,
"height": 800,
"content": "\n## How it works\n1. Message arrives via Green-API webhook (text or voice) \n2. Voice messages \u2192 downloaded \u2192 transcribed (OpenAI Whisper) \n3. Main router agent reads intent and selects exactly one sub-agent/tool \n4. Sub-agents handle the action:\n\u2022 Expense tracking \u2190\u2192 Google Sheets\n\u2022 Tasks (create/list/update) \u2190\u2192 Google Tasks\n\u2022 Post tweet \u2190\u2192 X\n\u2022 Search emails \u2190\u2192 Gmail (read only)\n\u2022 Real-time facts \u2190\u2192 web search\n\u2022 Math & conversions \u2190\u2192 calculator \n5. Answer returns as text \u2014 or as voice if you sent voice (OpenAI TTS)\n\n### Rules the AI follows strictly\n\u2022 One tool call per clear intent\n\u2022 Never guesses categories/amounts/IDs\n\u2022 Never deletes or modifies existing data\n\u2022 Current date always passed: {{$now}}\n## Setup stepsActivate credentials:\n1. OpenAI (chat + whisper + TTS)\n\u2022 Green-API (webhook + send endpoints)\n\u2022 Google Sheets OAuth\n\u2022 Google Tasks OAuth\n\u2022 Twitter/X OAuth 2.0\n\u2022 Gmail OAuth (read scope)\n\u2022 SerpAPI (web search)\n2. Update hardcoded chatId in the two \u201csend response\u201d nodes \n3. Test with simple commands first:\n\u201cI spent 2500 on lunch\u201d\n\u201cWeather in Karachi now\u201d\n\u201cCreate task: Call dentist tomorrow\u201d\n\n"
},
"typeVersion": 1
},
{
"id": "1913fdaa-963b-4367-bf7c-65cdf2384b16",
"name": "set audio to one",
"type": "n8n-nodes-base.set",
"position": [
1008,
-528
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "7c95968d-34a0-4a56-8edd-92f584e8ff71",
"name": "text",
"type": "string",
"value": "={{ $json.text }}"
},
{
"id": "568af38d-27b8-487c-8f33-ce274b458663",
"name": "audio",
"type": "string",
"value": "1"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "162d4985-3b55-4c83-944a-7329fc65d695",
"name": "audio to 0",
"type": "n8n-nodes-base.set",
"position": [
1008,
-336
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "ce3c8872-9b17-4859-8c86-648c7233b6fa",
"name": "text",
"type": "string",
"value": "={{ $json.body.messageData.textMessageData.textMessage }}"
},
{
"id": "b6946a00-4400-46d5-a08c-e137e7ca4efd",
"name": "audio",
"type": "string",
"value": "0"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "aa8a710a-d07d-47ff-bda4-40a361d03e70",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-176,
-656
],
"parameters": {
"color": 4,
"width": 1344,
"height": 448,
"content": "## Classify input"
},
"typeVersion": 1
},
{
"id": "1041dbbb-a33e-4b72-9cd9-1f16b661687a",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1952,
-368
],
"parameters": {
"color": 4,
"width": 864,
"height": 416,
"content": "## send response according to input"
},
"typeVersion": 1
},
{
"id": "025c6b12-5d32-4975-81dd-f800309df132",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1488,
-272
],
"parameters": {
"color": 6,
"width": 400,
"height": 256,
"content": "## main Agent"
},
"typeVersion": 1
},
{
"id": "35551b4d-f23c-4eba-bb6c-791dea506d9b",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
800,
176
],
"parameters": {
"color": 5,
"width": 384,
"height": 448,
"content": "## Sub Agent for expense Tracking\n"
},
"typeVersion": 1
},
{
"id": "f8630511-aefd-46bf-9454-279df9c46aab",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1280,
160
],
"parameters": {
"color": 5,
"width": 752,
"height": 448,
"content": "## Sub Agent for Google Tasks\n"
},
"typeVersion": 1
},
{
"id": "a1399821-275d-4d3a-9002-6fcf970baf8b",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
2080,
160
],
"parameters": {
"color": 5,
"width": 384,
"height": 448,
"content": "## Sub Agent for Posting Tweet"
},
"typeVersion": 1
},
{
"id": "18b7565d-54b8-4a57-94eb-217bc9adea04",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
2528,
144
],
"parameters": {
"color": 5,
"width": 384,
"height": 448,
"content": "## Sub Agent for Gmail\n"
},
"typeVersion": 1
},
{
"id": "d90b4aee-88ac-4284-8908-c6d0bc9383b9",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
352,
-80
],
"parameters": {
"width": 656,
"height": 208,
"content": "## Tools to do websearch and calculate"
},
"typeVersion": 1
},
{
"id": "12f48fce-97e6-49b1-b484-373200c7e11b",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
-224
],
"parameters": {
"width": 256,
"height": 256,
"content": "## Chat Trigger for manual execution"
},
"typeVersion": 1
}
],
"connections": {
"If": {
"main": [
[
{
"node": "Generate audio",
"type": "main",
"index": 0
}
],
[
{
"node": "send text response",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "download-audio",
"type": "main",
"index": 0
}
],
[
{
"node": "audio to 0",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"get list": {
"ai_tool": [
[
{
"node": "Task-manager-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"get tasks": {
"ai_tool": [
[
{
"node": "Task-manager-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"get-gmail": {
"ai_tool": [
[
{
"node": "main-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Calculator": {
"ai_tool": [
[
{
"node": "main-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"audio to 0": {
"main": [
[
{
"node": "main-agent",
"type": "main",
"index": 0
}
]
]
},
"main-agent": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Tweet-agent": {
"ai_tool": [
[
{
"node": "main-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"create list": {
"ai_tool": [
[
{
"node": "Task-manager-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"update task": {
"ai_tool": [
[
{
"node": "Task-manager-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "main-agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Generate audio": {
"main": [
[
{
"node": "send audio response",
"type": "main",
"index": 0
}
]
]
},
"download-audio": {
"main": [
[
{
"node": "Transcribe a recording",
"type": "main",
"index": 0
}
]
]
},
"expense-tracker": {
"ai_tool": [
[
{
"node": "main-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"quick-web-search": {
"ai_tool": [
[
{
"node": "main-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"set audio to one": {
"main": [
[
{
"node": "main-agent",
"type": "main",
"index": 0
}
]
]
},
"Create Tweet in X": {
"ai_tool": [
[
{
"node": "Tweet-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Task-manager-agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "main-agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model2": {
"ai_languageModel": [
[
{
"node": "get-gmail",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model3": {
"ai_languageModel": [
[
{
"node": "Tweet-agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model4": {
"ai_languageModel": [
[
{
"node": "expense-tracker",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Task-manager-agent": {
"ai_tool": [
[
{
"node": "main-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Transcribe a recording": {
"main": [
[
{
"node": "set audio to one",
"type": "main",
"index": 0
}
]
]
},
"Get many messages in Gmail": {
"ai_tool": [
[
{
"node": "get-gmail",
"type": "ai_tool",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "main-agent",
"type": "main",
"index": 0
}
]
]
},
"Create a task in Google Tasks": {
"ai_tool": [
[
{
"node": "Task-manager-agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Append row in sheet in Google Sheets": {
"ai_tool": [
[
{
"node": "expense-tracker",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get row(s) in sheet in Google Sheets": {
"ai_tool": [
[
{
"node": "expense-tracker",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}
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.
gmailOAuth2googleSheetsOAuth2ApigoogleTasksOAuth2ApiopenAiApiserpApitwitterOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow transforms WhatsApp into a powerful personal AI using n8n + Green-API. Send text or voice messages — the assistant understands intent and handles daily tasks automatically. 💰 Expense & income tracking — record spending, view summaries & category breakdowns (Google…
Source: https://n8n.io/workflows/13160/ — 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.
Are you drowning in daily operational chaos, desperately trying to juggle sales, projects, content, and client communication? Imagine an AI brain that handles it all, freeing you to lead your business
This suite automates distinct aspects of real estate operations: incoming web lead qualification, scheduled/manual data research and content generation, and automated voice call outreach with lead qua
This workflow lets you build a Messenger AI Agent capable of understanding text, images, and voice notes, and replying intelligently in real time.
Universal Expense tracker. Uses telegram, httpRequest, openAi, googleSheets. Webhook trigger; 33 nodes.
This workflow automates intelligent fleet operations management for transport operators, logistics companies, and smart mobility teams. It solves the problem of manually triaging high-volume vehicle t