{ "nodes": [ { "id": "assign-inbox-task-priorities-with-ai-0", "name": "Update priority in todoist", "type": "n8n-nodes-base.todoist", "position": [ 2060, 520 ], "parameters": { "taskId": "={{ $('Get inbox tasks').item.json.id }}", "operation": "update", "updateFields": { "priority": "={{ $('Your Projects').first().json.projects[$json.message.content.trim()] }}" } }, "typeVersion": 2.2 }, { "id": "assign-inbox-task-priorities-with-ai-1", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ 600, 520 ], "parameters": { "rule": { "interval": [ {} ] } }, "typeVersion": 1.2 }, { "id": "assign-inbox-task-priorities-with-ai-2", "name": "Get inbox tasks", "type": "n8n-nodes-base.todoist", "position": [ 1020, 520 ], "parameters": { "filters": { "projectId": "YOUR_INBOX_PROJECT_ID" }, "operation": "getAll", "returnAll": true }, "typeVersion": 2.2 }, { "id": "assign-inbox-task-priorities-with-ai-3", "name": "Your Projects", "type": "n8n-nodes-base.set", "position": [ 820, 520 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "50dc1412-21f8-4158-898d-3940a146586b", "name": "projects", "type": "object", "value": "={{ {\n apartment: 1,\n health: 2,\n german: 3\n} }}" } ] } }, "typeVersion": 3.4 }, { "id": "assign-inbox-task-priorities-with-ai-4", "name": "Categorize", "type": "@n8n/n8n-nodes-langchain.openAi", "position": [ 1460, 520 ], "parameters": { "modelId": { "__rl": true, "mode": "list", "value": "gpt-4o-mini", "cachedResultName": "GPT-4O-MINI" }, "options": {}, "messages": { "values": [ { "role": "system", "content": "=Categorize the user's todo item to a project. Return the project name or just \"other\" if it does not belong to a project." }, { "content": "=Projects:\n{{ Object.keys($('Your Projects').first().json.projects).join('\\n') }}\n\nTodo item:\n{{ $('Get inbox tasks').item.json.content }}" } ] } }, "typeVersion": 1.4 }, { "id": "assign-inbox-task-priorities-with-ai-5", "name": "If task is not a subtask", "type": "n8n-nodes-base.filter", "position": [ 1240, 520 ], "parameters": { "options": {}, "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "36dd4bc9-1282-4342-89dd-1dac81c7290e", "operator": { "type": "string", "operation": "empty", "singleValue": true }, "leftValue": "={{ $json.parent_id ?? '' }}", "rightValue": "" } ] } }, "typeVersion": 2.1 }, { "id": "assign-inbox-task-priorities-with-ai-6", "name": "If other or ai hallucinates", "type": "n8n-nodes-base.filter", "position": [ 1820, 520 ], "parameters": { "options": {}, "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "c4f69265-abe1-451c-8462-e68ff3b06799", "operator": { "type": "array", "operation": "contains", "rightType": "any" }, "leftValue": "={{ Object.keys($('Your Projects').first().json.projects) }}", "rightValue": "={{ $json.message.content.trim() }}" } ] } }, "typeVersion": 2.1 } ], "pinData": {}, "connections": { "Categorize": { "main": [ [ { "node": "If other or ai hallucinates", "type": "main", "index": 0 } ] ] }, "Your Projects": { "main": [ [ { "node": "Get inbox tasks", "type": "main", "index": 0 } ] ] }, "Get inbox tasks": { "main": [ [ { "node": "If task is not a subtask", "type": "main", "index": 0 } ] ] }, "Schedule Trigger": { "main": [ [ { "node": "Your Projects", "type": "main", "index": 0 } ] ] }, "If task is not a subtask": { "main": [ [ { "node": "Categorize", "type": "main", "index": 0 } ] ] }, "If other or ai hallucinates": { "main": [ [ { "node": "Update priority in todoist", "type": "main", "index": 0 } ] ] } }, "name": "Assign Inbox Task Priorities with AI", "active": false, "settings": { "timezone": "UTC", "executionOrder": "v1" } }