Bài 5/21Thực hành
Bài 5 — Telegram Bot + Google Sheets: credential đầu tiên
Tạo Telegram Bot, OAuth Google Sheets trên n8n Cloud, gửi tin test.
24 min
Mục tiêu bài học
- Tạo Telegram Bot qua @BotFather và credential n8n
- Kết nối Google Sheets OAuth trên n8n Cloud (managed OAuth)
- Chạy workflow test Append Sheet → Telegram
Tài liệu chính thức — Telegram
Bước A — Tạo Bot qua @BotFather
- Mở Telegram → chat @BotFather → gửi /newbot
- Đặt tên hiển thị và username (phải kết thúc bằng bot)
- Copy HTTP API Token — dùng trong n8n Credentials → Telegram API
- Chat với bot của bạn một lần (Start) để bot nhận tin nhắn
Bước B — Telegram credential trên n8n Cloud
- n8n Cloud → Credentials → Add credential → Telegram API
- Dán Access Token từ BotFather → Save
- Thêm node Telegram Trigger → chọn credential → n8n Cloud tự tạo webhook HTTPS
- Lưu chat_id từ output node (dùng cho Send Message sau này)

Tài liệu chính thức — Google Sheets


Bước C — Google Sheets trên n8n Cloud
- Credentials → Google Sheets OAuth2 API → Sign in with Google → Allow
- Share Google Sheet Auto Marketing Tracker cho email Google vừa OAuth
- Node Google Sheets → Operation Append → chọn Document + Sheet Products
- Map cột: product_id, name, description, created_at
Workflow test tích hợp

[Manual Trigger]
→ [Google Sheets: Append row to Products tab]
→ [Telegram: Send Message "Đã thêm sản phẩm {{ $json.name }}"]
→ [Execute Workflow] — lưu workflow, bấm Test hoặc PublishBài tập thực hành
- Tạo Bot + credential Telegram trên n8n Cloud
- Kết nối Google Sheets OAuth + append 1 dòng Products
- Gửi Telegram confirm — screenshot Executions success
Tiếp tục lộ trình
Hoàn thành từng bài thực hành để xây hệ Auto Marketing Multi-Agent của riêng bạn.