{ "name": "Memento MCP — Email to Note", "nodes": [ { "parameters": { "pollTimes": { "item": [{ "mode": "everyMinute" }] }, "filters": { "hasReadStatus": true, "readStatus": "unread" } }, "id": "email-trigger", "name": "Email Trigger (IMAP)", "type": "n8n-nodes-base.emailTrigger", "typeVersion": 1.1, "position": [240, 300] }, { "parameters": { "jsCode": "const email = $input.item.json;\nconst subject = email.subject || 'Email (no subject)';\nconst from = email.from?.value?.[0]?.address || email.from || 'unknown';\nconst body = email.text || email.html?.replace(/<[^>]+>/g, '') || '';\nconst date = email.date ? new Date(email.date).toISOString() : new Date().toISOString();\n\nconst isUrgent = /(urgent|asap|important|deadline|critical)/i.test(subject + body);\n\nreturn [{\n json: {\n title: `📧 ${subject}`,\n content: `**From:** ${from}\\n**Date:** ${new Date(date).toLocaleString('en-GB')}\\n\\n---\\n\\n${body.trim().substring(0, 5000)}`,\n isMarkdown: true,\n color: isUrgent ? 'red' : 'blue',\n isPinned: isUrgent,\n labels: isUrgent ? ['email', 'urgent'] : ['email'],\n isUrgent\n }\n}];" }, "id": "format-email", "name": "Format Email as Note", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [480, 300] }, { "parameters": { "method": "POST", "url": "http://memento-mcp:3001/mcp", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" }, { "name": "x-api-key", "value": "={{ $vars.MEMENTO_API_KEY }}" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"tools/call\",\n \"params\": {\n \"name\": \"create_note\",\n \"arguments\": {\n \"title\": \"{{ $json.title }}\",\n \"content\": \"{{ $json.content }}\",\n \"isMarkdown\": {{ $json.isMarkdown }},\n \"color\": \"{{ $json.color }}\",\n \"isPinned\": {{ $json.isPinned }},\n \"labels\": {{ JSON.stringify($json.labels) }}\n }\n }\n}" }, "id": "mcp-create-note", "name": "MCP — Create Note", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [720, 300] }, { "parameters": { "conditions": { "conditions": [ { "id": "urgent", "leftValue": "={{ $('Format Email as Note').item.json.isUrgent }}", "rightValue": true, "operator": { "type": "boolean", "operation": "equals" } } ], "combinator": "and" } }, "id": "if-urgent", "name": "Urgent?", "type": "n8n-nodes-base.if", "typeVersion": 2.1, "position": [960, 300] }, { "parameters": { "channel": "alerts", "text": "🚨 *Urgent email saved to Memento!*\n\n{{ $('Format Email as Note').item.json.title }}\n\nOpen: http://memento:3000", "additionalFields": { "parse_mode": "Markdown" } }, "id": "slack-alert", "name": "Slack Alert", "type": "n8n-nodes-base.slack", "typeVersion": 2.1, "position": [1200, 200], "continueOnFail": true } ], "connections": { "Email Trigger (IMAP)": { "main": [[{ "node": "Format Email as Note", "type": "main", "index": 0 }]] }, "Format Email as Note": { "main": [[{ "node": "MCP — Create Note", "type": "main", "index": 0 }]] }, "MCP — Create Note": { "main": [[{ "node": "Urgent?", "type": "main", "index": 0 }]] }, "Urgent?": { "main": [ [{ "node": "Slack Alert", "type": "main", "index": 0 }], [] ] } }, "pinData": {}, "settings": { "executionOrder": "v1" }, "staticData": null, "tags": [{ "id": "memento-mcp", "name": "Memento MCP" }], "triggerCount": 1, "updatedAt": "2026-05-03T00:00:00.000Z", "versionId": "1" }