{ "id": "EVctKxhQ2eyGd3gD", "name": "GTasks: Get All Tasks", "nodes": [ { "parameters": { "inputSource": "passthrough" }, "type": "n8n-nodes-base.executeWorkflowTrigger", "typeVersion": 1.1, "position": [ -496, -32 ], "id": "4d0aa270-fd61-4aaf-94e0-38546c9f332a", "name": "When Executed by Another Workflow" }, { "parameters": { "url": "https://tasks.googleapis.com/tasks/v1/users/@me/lists", "authentication": "predefinedCredentialType", "nodeCredentialType": "googleTasksOAuth2Api", "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ -288, -32 ], "id": "27dac4dc-08a7-4dd5-b526-a600d7aa3133", "name": "HTTP Request", "credentials": { "googleTasksOAuth2Api": { "id": "ErcYIjq8Xs0GRaPF", "name": "ben.io-gtasks" } } }, { "parameters": { "fieldToSplitOut": "items", "options": {} }, "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ -80, -32 ], "id": "d46ab354-a184-4dfc-b378-ac31cd986be4", "name": "Split Out" }, { "parameters": { "url": "=https://tasks.googleapis.com/tasks/v1/lists/{{ $json.id }}/tasks", "authentication": "predefinedCredentialType", "nodeCredentialType": "googleTasksOAuth2Api", "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 128, -32 ], "id": "d7de2397-4e7f-4b27-aeed-231959bf4939", "name": "Get List of Tasks", "credentials": { "googleTasksOAuth2Api": { "id": "ErcYIjq8Xs0GRaPF", "name": "ben.io-gtasks" } } }, { "parameters": { "mode": "raw", "jsonOutput": "={{ \n (() => {\n // We don't need to find listId outside the loop anymore\n \n const cleanTasks = $json.items.map(t => {\n // FIX: Extract List ID from the 'selfLink' URL\n // regex captures the text between \"lists/\" and \"/tasks\"\n const listId = t.selfLink.match(/lists\\/([^\\/]+)\\/tasks/)[1];\n\n return {\n \"list_id\": listId, \n \"task_id\": t.id,\n \"title\": t.title,\n \"status\": t.status,\n \"due\": t.due,\n \"updated\": t.updated,\n \"notes\": t.notes,\n \"links\": t.links,\n \"webViewLink\": t.webViewLink\n };\n });\n\n return { \"tasks\": cleanTasks };\n })() \n}}", "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 528, -32 ], "id": "9aa7eef0-f197-4491-bbff-39f52343e050", "name": "Edit Fields" }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 3 }, "conditions": [ { "id": "564f2ac0-81d2-4c47-a090-7a7e73dff62b", "leftValue": "={{ $json.items }}", "rightValue": 1, "operator": { "type": "array", "operation": "lengthGt", "rightType": "number" } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.filter", "typeVersion": 2.3, "position": [ 336, -32 ], "id": "6ff11d12-d94a-4148-bb21-cda69e06536d", "name": "Filter Empty List" } ], "connections": { "When Executed by Another Workflow": { "main": [ [ { "node": "HTTP Request", "type": "main", "index": 0 } ] ] }, "HTTP Request": { "main": [ [ { "node": "Split Out", "type": "main", "index": 0 } ] ] }, "Split Out": { "main": [ [ { "node": "Get List of Tasks", "type": "main", "index": 0 } ] ] }, "Get List of Tasks": { "main": [ [ { "node": "Filter Empty List", "type": "main", "index": 0 } ] ] }, "Filter Empty List": { "main": [ [ { "node": "Edit Fields", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "triggerCount": 0, "versionId": "993969fa-c72b-43e0-8a7e-498badc87e2c", "owner": { "type": "personal", "projectId": "FeLO36wNUAcn61Wj", "projectName": "Ben W ", "personalEmail": "admin@ben.io" }, "parentFolderId": "OJ2UfPNUOAOHlllh", "isArchived": false }