📝 Note-Taking Automation
🎯 Mục tiêu bài học
Sau bài học này, bạn sẽ:
✅ Kết nối Notion với n8n cho note management
✅ Xây dựng web clipper và email-to-notes workflows
✅ Implement auto-tagging và inbox processing
✅ Tạo daily notes tự động và sync giữa Notion/Obsidian
Capturing và organizing knowledge thủ công rất time-consuming. Bài này hướng dẫn automate note-taking để build personal knowledge base effortlessly.
🔍 Note Automation Overview
What to Automate:
Checkpoint
Ba category chính của note automation là gì?
🛠️ Notion Setup
Connect Notion:
11. Add Notion node22. Create Integration at notion.so/my-integrations33. Get Internal Integration Token44. Share database with integration55. Copy database ID from URLDatabase Structure:
Checkpoint
Notion database nên có những properties nào?
⚡ Workflow 1: Web Clipper
Save Articles via Webhook:
Web Clipper
Extract Article Content:
1const url = $input.item.json.url;23// Use HTTP Request to fetch page4// Or use external API like Mercury Parser56return {7 url,8 title: $input.item.json.title || 'Untitled',9 content: $input.item.json.content || '',10 extractedAt: new Date().toISOString()11};Create Notion Page:
1{2 "name": "Create Notion Page",3 "type": "n8n-nodes-base.notion",4 "parameters": {5 "operation": "create",6 "databaseId": "your-database-id",7 "title": "={{ $json.title }}",8 "properties": {9 "Type": {10 "select": { "name": "Article" }11 },12 "Status": {13 "select": { "name": "Inbox" }14 },15 "Source URL": {16 "url": "={{ $json.url }}"17 },18 "Created": {19 "date": { "start": "={{ $json.extractedAt }}" }20 },21 "Summary": {22 "rich_text": [{ "text": { "content": "={{ $json.summary }}" }}]23 }24 }25 }26}iOS Shortcut Integration:
1// Webhook receives from iOS Shortcut:2// {3// "url": "https://example.com/article",4// "title": "Article Title",5// "selection": "Selected text if any"6// }78const input = $input.item.json;910return {11 url: input.url,12 title: input.title,13 highlight: input.selection,14 source: 'iOS Shortcut',15 savedAt: new Date().toISOString()16};Checkpoint
Web clipper workflow hoạt động qua những bước nào?
🔧 Workflow 2: Email to Notes
Save Important Emails:
Email to Notion
Email Processing:
1const email = $input.item.json;23// Clean up email content4let content = email.text || email.snippet;56// Remove signatures7content = content.replace(/--\s*\n[\s\S]*$/m, '');8content = content.replace(/Sent from my iPhone/g, '');910// Extract key info11const fromName = email.from.split('<')[0].trim();12const date = new Date(email.internalDate);1314return {15 title: email.subject,16 content: content,17 source: fromName,18 sourceEmail: email.from,19 receivedDate: date.toISOString(),20 type: 'Email',21 emailId: email.id22};Checkpoint
Email-to-notes workflow xử lý content email như thế nào?
🏗️ Workflow 3: Social Bookmarks
Save Twitter/X Bookmarks:
Twitter to Notion
Tweet Processing:
1const tweet = $input.item.json;23// Extract thread if needed4const isThread = tweet.conversation_id !== tweet.id;56// Extract media7const hasMedia = tweet.attachments?.media_keys?.length > 0;89// Clean tweet text10let content = tweet.text;1112// Remove t.co links13content = content.replace(/https:\/\/t\.co\/\w+/g, '');1415return {16 title: content.substring(0, 50) + (content.length > 50 ? '...' : ''),17 content: content,18 author: tweet.author.username,19 authorName: tweet.author.name,20 tweetUrl: `https://twitter.com/${tweet.author.username}/status/${tweet.id}`,21 isThread,22 hasMedia,23 metrics: {24 likes: tweet.public_metrics.like_count,25 retweets: tweet.public_metrics.retweet_count26 },27 savedAt: new Date().toISOString()28};Checkpoint
Social bookmarks workflow kiểm tra duplicate bằng cách nào?
📊 Workflow 4: Auto-Tagging
Smart Tag Assignment:
1const note = $input.item.json;2const content = (note.title + ' ' + note.content).toLowerCase();34// Define tag rules5const tagRules = [6 { keywords: ['ai', 'machine learning', 'gpt', 'neural'], tag: 'AI/ML' },7 { keywords: ['javascript', 'react', 'node', 'typescript'], tag: 'Development' },8 { keywords: ['productivity', 'habit', 'routine', 'efficiency'], tag: 'Productivity' },9 { keywords: ['business', 'startup', 'entrepreneur', 'revenue'], tag: 'Business' },10 { keywords: ['design', 'ui', 'ux', 'figma'], tag: 'Design' },11 { keywords: ['marketing', 'seo', 'growth', 'conversion'], tag: 'Marketing' },12 { keywords: ['book', 'reading', 'author'], tag: 'Books' },13 { keywords: ['video', 'youtube', 'watch'], tag: 'Video' }14];1516const matchedTags = [];1718for (const rule of tagRules) {19 if (rule.keywords.some(kw => content.includes(kw))) {20 matchedTags.push(rule.tag);21 }22}2324// Default tag if no matches25if (matchedTags.length === 0) {26 matchedTags.push('Uncategorized');27}2829return {30 ...note,31 autoTags: matchedTags32};AI-Powered Tagging:
1// Use OpenAI to suggest tags2const note = $input.item.json;34const prompt = `5Analyze this note and suggest 1-3 relevant tags from this list:6[AI/ML, Development, Productivity, Business, Design, Marketing, Personal, Health, Finance, Books, Video, Tools]78Title: ${note.title}9Content: ${note.content.substring(0, 500)}1011Return only the tags as a comma-separated list, nothing else.12`;1314return {15 prompt,16 noteData: note17};1819// After OpenAI call:20// Parse response and extract tagsCheckpoint
Auto-tagging system sử dụng keyword matching rules như thế nào?
💡 Workflow 5: Inbox Processing
Weekly Inbox Cleanup:
Process Inbox
Inbox Processing Logic:
1const notes = $input.all();2const now = new Date();3const weekAgo = new Date(now - 7 * 24 * 60 * 60 * 1000);45const toArchive = [];6const toProcess = [];7const needsReview = [];89for (const note of notes) {10 const createdAt = new Date(note.json.created);11 const daysSince = Math.floor((now - createdAt) / (1000 * 60 * 60 * 24));12 13 if (createdAt < weekAgo) {14 // Old unprocessed notes go to archive15 toArchive.push({16 id: note.json.id,17 title: note.json.title,18 reason: `Unprocessed for ${daysSince} days`19 });20 } else if (note.json.autoTags?.length === 0) {21 // Needs tagging22 needsReview.push({23 id: note.json.id,24 title: note.json.title,25 action: 'needs_tags'26 });27 } else {28 toProcess.push({29 id: note.json.id,30 title: note.json.title,31 tags: note.json.autoTags32 });33 }34}3536return {37 toArchive,38 toProcess,39 needsReview,40 summary: {41 total: notes.length,42 archiving: toArchive.length,43 processing: toProcess.length,44 review: needsReview.length45 }46};Checkpoint
Inbox processing workflow xử lý notes cũ hơn 7 ngày như thế nào?
🌟 Workflow 6: Obsidian Sync
Sync Notion to Obsidian:
Notion → Obsidian
Convert to Markdown:
1const page = $input.item.json;23// Convert Notion properties to frontmatter4const frontmatter = `---5title: "${page.title}"6tags: [${page.tags?.join(', ') || ''}]7source: ${page.sourceUrl || ''}8created: ${page.created}9status: ${page.status}1011`;1213// Convert Notion blocks to markdown14const content = page.content || '';1516// Build wikilinks for tags17const wikilinks = page.tags?.map(tag => `[[${tag}]]`).join(' ') || '';1819const markdown = frontmatter + content + '\n\n' + wikilinks;2021return {22 filename: page.title.replace(/[<>:"/\\|?*]/g, '-') + '.md',23 content: markdown,24 folder: page.type || 'Inbox'25};Checkpoint
Notion to Obsidian sync convert content thành format gì?
📈 Workflow 7: Daily Notes
Auto-Generate Daily Note:
Daily Note Creator
Daily Note Template:
1const events = $('Get Calendar').all();2const tasks = $('Get Tasks').all();3const yesterdayNotes = $('Get Notes').all();45const today = new Date();6const dateStr = today.toISOString().split('T')[0];7const dayName = today.toLocaleDateString('en-US', { weekday: 'long' });89const template = `10# ${dayName}, ${dateStr}1112## �� Focus13What's the ONE thing I need to accomplish today?14- [ ] 1516## �� Schedule17${events.map(e => `- ${new Date(e.json.start.dateTime).toLocaleTimeString('en-US', {hour: '2-digit', minute:'2-digit'})} - ${e.json.summary}`).join('\n') || 'No meetings scheduled'}1819## ✅ Tasks20### Carried Over21${tasks.filter(t => !t.json.completed).slice(0, 5).map(t => `- [ ] ${t.json.title}`).join('\n') || '- [ ] All caught up!'}2223### Today24- [ ] 25- [ ] 26- [ ] 2728## �� Notes29(Quick capture throughout the day)3031## �� Learning32Notes saved yesterday: ${yesterdayNotes.length}33${yesterdayNotes.slice(0, 3).map(n => `- [[${n.json.title}]]`).join('\n')}3435## �� Evening Review36- What went well?37- What could be improved?38- What am I grateful for?3940*Daily note auto-generated by n8n*41`;4243return {44 title: `Daily Note - ${dateStr}`,45 content: template,46 date: dateStr47};Checkpoint
Daily notes template bao gồm những sections nào?
📋 Best Practices
Capture:
- ✅ Make capture frictionless (1-click)
- ✅ Add source URL always
- ✅ Capture now, process later
Organize:
- ✅ Use consistent tagging
- ✅ Regular inbox cleanup
- ✅ Link related notes
Avoid:
- ❌ Over-capturing (quality > quantity)
- ❌ Too many tags
- ❌ Orphan notes (no connections)
Checkpoint
Tại sao nên capture now, process later?
📝 Bài Tập Thực Hành
Build your knowledge system:
- Create web clipper webhook + iOS Shortcut
- Set up email to notes workflow
- Implement auto-tagging system
- Build weekly inbox processor
- Create daily note template generator
Build your second brain! 🧠
Checkpoint
Bạn đã hoàn thành những challenges nào trong bài tập?
🧠 Key Takeaways
- 📥 Capture fast - Minimize friction
- 🏷️ Tag smart - Auto-tag when possible
- 📦 Process regularly - Inbox zero weekly
- 🔗 Connect notes - Build knowledge graph
- 🔄 Sync everywhere - Access from any device
Checkpoint
Nguyên tắc Inbox zero weekly nghĩa là gì?
🚀 Bài tiếp theo
Personal Dashboards — Daily briefings và information aggregation.
