1 line
4.1 KiB
JSON
1 line
4.1 KiB
JSON
[{"updatedAt":"2026-05-14T21:36:33.215Z","createdAt":"2026-05-14T21:36:33.215Z","id":"LF3i86l3NkxpayxL","name":"Obsidian Chat Summary Capture","description":null,"active":true,"isArchived":false,"nodes":[{"parameters":{"httpMethod":"POST","path":"obsidian-chat-summary","responseMode":"responseNode","options":{}},"id":"90069c7c-b6c9-4434-93f4-3b97061e590a","name":"Webhook - Chat Summary","type":"n8n-nodes-base.webhook","typeVersion":2,"position":[0,0],"webhookId":"obsidian-chat-summary"},{"parameters":{"jsCode":"\nconst input = $json.body ?? $json;\nconst now = new Date(); const iso = now.toISOString(); const date = iso.slice(0,10);\nconst type = String(input.type || 'chat').toLowerCase();\nconst folderMap = {meeting:'Meetings', call:'Meetings', zoom:'Meetings', teams:'Meetings', decision:'Decisions', runbook:'Runbooks', project:'Projects', resource:'Resources', daily:'Daily'};\nconst folder = folderMap[type] || 'Inbox/Chat Summaries';\nfunction clean(s){ return String(s||'Untitled Summary').replace(/[\\\\/:*?\"<>|#\\[\\]]/g,'').replace(/\\s+/g,' ').trim().slice(0,120) || 'Untitled Summary'; }\nconst title = clean(input.title || input.subject || `${type} summary`);\nconst summary = input.summary || input.text || input.content || '';\nconst content = input.markdown || input.content || summary;\nconst tags = Array.isArray(input.tags) ? input.tags : String(input.tags || '').split(',').map(s=>s.trim()).filter(Boolean);\nconst body = `---\ntitle: ${JSON.stringify(title)}\ntype: ${JSON.stringify(type)}\nsource: ${JSON.stringify(input.source || input.platform || 'webhook')}\ncreated: ${JSON.stringify(iso)}\ntags: ${JSON.stringify(['automation/n8n','chat-summary',...tags])}\n---\n\n# ${title}\n\n## Summary\n\n${summary || '_No summary provided._'}\n\n## Notes\n\n${content || '_No content provided._'}\n\n## Metadata\n\n\\`\\`\\`json\n${JSON.stringify(input.metadata || {}, null, 2)}\n\\`\\`\\`\n`;\nreturn [{json:{path:`${folder}/${date} - ${title}.md`, body, title, folder, type}}];\n"},"id":"e80e092c-4fc4-4159-ac7c-fc570ef1c761","name":"Prepare Chat Note","type":"n8n-nodes-base.code","typeVersion":2,"position":[280,0]},{"parameters":{"method":"PUT","url":"={{'http://172.19.0.1:27123/vault/' + encodeURIComponent($json.path).replace(/%2F/g, '/')}}","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Content-Type","value":"text/markdown"}]},"sendBody":true,"contentType":"raw","rawContentType":"text/markdown","body":"={{$json.body}}","options":{"timeout":30000},"authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth"},"id":"a616c85b-9898-42bc-866f-077037c07a41","name":"Write Chat Note","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[560,0],"credentials":{"httpHeaderAuth":{"id":"465Swz2b71O2KRAK","name":"Obsidian Local REST API"}}},{"parameters":{"respondWith":"json","responseBody":"={{JSON.stringify({ok:true, path:$('Prepare Chat Note').first().json.path, title:$('Prepare Chat Note').first().json.title, folder:$('Prepare Chat Note').first().json.folder})}}","options":{}},"id":"6944cd52-8614-4658-8907-b54a44fc01fa","name":"Respond","type":"n8n-nodes-base.respondToWebhook","typeVersion":1.1,"position":[840,0]}],"connections":{"Webhook - Chat Summary":{"main":[[{"node":"Prepare Chat Note","type":"main","index":0}]]},"Prepare Chat Note":{"main":[[{"node":"Write Chat Note","type":"main","index":0}]]},"Write Chat Note":{"main":[[{"node":"Respond","type":"main","index":0}]]}},"settings":{"executionOrder":"v1","callerPolicy":"workflowsFromSameOwner","availableInMCP":false},"staticData":null,"meta":null,"pinData":null,"versionId":"49e05c18-c8d6-4eac-b507-1833840d57fe","activeVersionId":"49e05c18-c8d6-4eac-b507-1833840d57fe","versionCounter":3,"triggerCount":1,"tags":[],"shared":[{"updatedAt":"2026-05-14T21:36:33.223Z","createdAt":"2026-05-14T21:36:33.223Z","role":"workflow:owner","workflowId":"LF3i86l3NkxpayxL","projectId":"WGdp8QunI1tHpjXa","project":{"updatedAt":"2026-03-11T21:08:10.005Z","createdAt":"2026-03-11T21:05:11.541Z","id":"WGdp8QunI1tHpjXa","name":"will will <will@wills-portal.com>","type":"personal","icon":null,"description":null,"creatorId":"5ad50ead-6e6a-4d12-ab5b-e5db15835bb5"}}],"versionMetadata":{"name":null,"description":null}}] |