MinAI - Về trang chủ
Hướng dẫn
6/1340 phút
Đang tải...

Notion & Airtable Integration

Kết nối n8n với Notion databases và Airtable bases

Notion & Airtable Integration

Notion và Airtable là 2 tools phổ biến nhất cho project management và data management. Bài này dạy bạn tự động hóa chúng với n8n.

0

🎯 Mục tiêu bài học

TB5 min

🎯 Mục tiêu

  • CRUD operations với Notion databases
  • CRUD operations với Airtable bases
  • Sync data giữa Notion ↔ Airtable
  • Build project management automations

Checkpoint

CRUD là gì? Tại sao Notion và Airtable là 2 tools phổ biến cho project management?

1

📝 Notion Integration

TB5 min

1. Notion Integration

1.1 Setup Notion Connection

  1. Go to notion.so/my-integrations
  2. Click New integration
  3. Name: "n8n Automation"
  4. Chọn workspace
  5. Copy Internal Integration Token
  6. Trong Notion, share database với integration

1.2 Notion Node Operations

OperationMô tả
Get DatabaseLấy danh sách pages trong database
Create PageTạo page/row mới
Update PageCập nhật properties
Get PageLấy chi tiết 1 page
SearchTìm kiếm pages
Append BlockThêm content vào page

1.3 Read Database

Ví dụ
1Notion node:
2- Resource: Database Page
3- Operation: Get Many
4- Database: [Select your database]
5- Return All: toggle on (or set limit)

Output format:

JSON
1{
2 "id": "page-id-123",
3 "properties": {
4 "Name": {"title": [{"text": {"content": "Task ABC"}}]},
5 "Status": {"select": {"name": "In Progress"}},
6 "Due Date": {"date": {"start": "2026-01-15"}},
7 "Priority": {"select": {"name": "High"}}
8 }
9}

1.4 Create Page

Ví dụ
1Notion node:
2- Resource: Database Page
3- Operation: Create
4- Database: [Select]
5- Properties:
6 - Name (title): "New Task from n8n"
7 - Status (select): "To Do"
8 - Due Date (date): "2026-02-01"
9 - Priority (select): "Medium"

1.5 Update Page

Ví dụ
1Notion node:
2- Resource: Database Page
3- Operation: Update
4- Page ID: {{ $json.id }}
5- Properties:
6 - Status: "Done"
7 - Completed Date: {{ $now.format('yyyy-MM-dd') }}

1.6 Notion Automation Patterns

Pattern 1: Auto-assign tasks

Ví dụ
1Schedule (daily) → Notion Get (unassigned tasks)
2→ Round-robin assign → Notion Update → Slack notify

Pattern 2: Status change notification

Ví dụ
1Notion Trigger (page updated) → IF Status = "Done"
2→ Slack post → Google Sheets log

Pattern 3: Meeting notes → Tasks

Ví dụ
1Webhook (meeting notes) → AI Extract action items
2→ Loop → Notion Create (1 page per task)

Checkpoint

Để kết nối Notion với n8n, cần thực hiện những bước nào? Internal Integration Token là gì?

2

📊 Airtable Integration

TB5 min

2. Airtable Integration

2.1 Setup Airtable Connection

  1. Go to airtable.com/account → Generate API key (or Personal Access Token)
  2. In n8n: Add Airtable credentials
  3. Paste API key/token

2.2 Airtable Node Operations

OperationMô tả
ListLấy records từ table
CreateTạo record mới
UpdateCập nhật record
DeleteXóa record
GetLấy 1 record by ID

2.3 Read Records

Ví dụ
1Airtable node:
2- Operation: List
3- Base: [Select base]
4- Table: "Projects"
5- Return All: true
6- Filter: Status = "Active"

2.4 Create Record

Ví dụ
1Airtable node:
2- Operation: Create
3- Base: [Select]
4- Table: "Leads"
5- Fields:
6 - Name: {{ $json.name }}
7 - Email: {{ $json.email }}
8 - Source: "Website"
9 - Created: {{ $now }}

2.5 Update Record

Ví dụ
1Airtable node:
2- Operation: Update
3- Record ID: {{ $json.id }}
4- Fields:
5 - Status: "Contacted"
6 - Last Contact: {{ $now.format('yyyy-MM-dd') }}

2.6 Airtable Automation Patterns

Pattern 1: CRM Pipeline

Ví dụ
1Webhook (new lead) → Airtable Create → Email welcome
2→ Wait 3 days → Airtable Update (follow-up) → Email reminder

Pattern 2: Inventory Tracker

Ví dụ
1Schedule (hourly) → Airtable List (stock < threshold)
2→ Loop → Slack alert per item

Checkpoint

Airtable node hỗ trợ những operations nào? Cho ví dụ use case cho "Create" và "List".

3

🔄 Notion ↔ Airtable Sync

TB5 min

3. Notion ↔ Airtable Sync

3.1 One-Way Sync: Airtable → Notion

Ví dụ
1Schedule (every 15 min)
2→ Airtable List (modified_after: last_run)
3→ Loop each record
4 → Notion Search (find matching page)
5 → IF exists
6 → Notion Update
7 → ELSE: Notion Create

3.2 Two-Way Sync (Advanced)

Ví dụ
1⚠️ Two-way sync phức tạp — cần:
21. Unique ID mapping (Airtable ID ↔ Notion Page ID)
32. Last-modified timestamp tracking
43. Conflict resolution (which wins?)
54. Loop detection prevention
6
7Recommendation: Dùng one-way sync khi có thể.

3.3 Practical Example: Project Tracker

Ví dụ
1Source of truth: Airtable (project data)
2Display: Notion (team wiki)
3
4Airtable table "Projects":
5- Name, Status, Owner, Due Date, Budget
6
7Notion database "Project Dashboard":
8- Synced from Airtable every 15 min
9- Team adds notes/comments in Notion
10- Status changes flow back to Airtable

Checkpoint

Two-way sync giữa Notion và Airtable phức tạp vì sao? Cần giải quyết những vấn đề gì?

4

🏷️ Working with Properties

TB5 min

4. Working with Properties

4.1 Notion Property Types

JSON
1// Title
2"Name": {"title": [{"text": {"content": "My Title"}}]}
3
4// Select
5"Status": {"select": {"name": "Done"}}
6
7// Multi-select
8"Tags": {"multi_select": [{"name": "urgent"}, {"name": "bug"}]}
9
10// Date
11"Due": {"date": {"start": "2026-01-15", "end": "2026-01-20"}}
12
13// Number
14"Budget": {"number": 5000000}
15
16// Checkbox
17"Completed": {"checkbox": true}
18
19// URL
20"Link": {"url": "https://example.com"}
21
22// People
23"Assignee": {"people": [{"id": "user-id"}]}
24
25// Relation
26"Project": {"relation": [{"id": "page-id"}]}

4.2 Airtable Field Types

JSON
1// Text
2"Name": "Task ABC"
3
4// Single Select
5"Status": "In Progress"
6
7// Multiple Select
8"Tags": ["urgent", "bug"]
9
10// Date
11"Due Date": "2026-01-15"
12
13// Number / Currency
14"Budget": 5000000
15
16// Checkbox
17"Completed": true
18
19// Attachment
20"Files": [{"url": "https://..."}]
21
22// Linked Record
23"Project": ["rec123"]

5. Hands-on Lab

Lab 1: Task Manager

Build workflow nhận task từ Slack → tạo trong Notion:

  1. Slack Trigger — Message in #tasks channel
  2. AI Parse — Extract task name, assignee, due date
  3. Notion Create — Add to Tasks database
  4. Slack Reply — Confirm "✅ Task created!"

Lab 2: Lead Tracker

Build CRM workflow:

  1. Webhook (new lead from website)
  2. Airtable Create (save lead)
  3. Email (send welcome)
  4. Wait (3 days)
  5. Airtable Update (mark "Follow-up needed")
  6. Slack notify (sales team)

Lab 3: Content Calendar Sync

Sync content calendar từ Airtable → Notion:

  1. Schedule (every 30 min)
  2. Airtable List (upcoming content)
  3. Loop each item
  4. Notion Search (check if exists)
  5. Notion Create/Update accordingly

📝 Quiz

  1. Để kết nối Notion với n8n, cần gì?

    • Email và password
    • Internal Integration Token + share database
    • API key từ settings
    • OAuth chỉ có trên paid plan
  2. Airtable "List" operation dùng để?

    • Tạo record mới
    • Xóa records
    • Lấy danh sách records từ table
    • Create table
  3. Two-way sync giữa Notion và Airtable thì?

    • Đơn giản, chỉ cần 2 nodes
    • Không thể
    • Phức tạp, cần ID mapping + conflict resolution
    • Tự động sẵn

🎯 Key Takeaways

  1. Notion — Create, Read, Update pages + databases
  2. Airtable — CRUD operations trên bases/tables
  3. Sync — One-way sync đơn giản, two-way cần cẩn thận
  4. Properties — Mỗi tool có cú pháp riêng cho field types
  5. Patterns — Task management, CRM, content calendar

Checkpoint

Cú pháp property types của Notion khác Airtable như thế nào? Cho ví dụ về "Select" type ở cả hai.


🚀 Bài tiếp theo

Slack & Discord Automation — Tự động hóa team communication!