Bài 21/21Lý thuyết
Bài 21 — Monitoring, bảo mật & mở rộng hệ Agent
Giám sát execution, rotate credentials, thêm Agent mới (Email, Zalo OA).
18 min
Mục tiêu bài học
- Setup alert khi execution fail > 3 lần/ngày
- Quy trình rotate Telegram + API keys
- Thiết kế Agent thứ 5: Email Newsletter
Monitoring n8n production
- Executions tab — filter failed, review weekly
- Uptime Kuma / Better Stack ping n8n health endpoint
- Telegram daily digest: số execution success/fail
- n8n Log streaming → Grafana Loki (advanced)
Bảo mật
- Không commit credentials — dùng n8n credential store + env vars
- Giới hạn Telegram bot: chỉ accept chat_id whitelist (Code node filter)
- Google Sheet: share minimum permission
- Rotate LLM API keys quarterly
Mở rộng Agent mới
- Email Agent: Sub-workflow gửi newsletter từ Posts content_ready
- Zalo OA Agent: tích hợp Zalo API khi có official account
- Competitor Agent: scrape RSS đối thủ → Content Agent inspiration
- Approval Agent: gửi preview caption → chờ reply ✅ trước publish
Chúc mừng hoàn thành khóa học!
Bạn đã xây hệ Auto Marketing 5 lớp hoàn chỉnh: Telegram làm cockpit nhập liệu, Manager Agent điều phối, Google Workspace (Sheets/Docs/Drive) làm kho doanh nghiệp, MXH đa kênh làm publish engine, Sage Marketing làm hệ thống độc quyền. Tiếp theo: tối ưu System Prompt theo analytics, A/B test golden hours, thêm kênh Zalo OA hoặc Instagram Reels.
Bài tập cuối (tùy chọn)
- Thêm chat_id whitelist vào Orchestrator
- Thiết kế Agent thứ 5 trên giấy — input/output schema
- Chia sẻ case study lên LinkedIn #buildinpublic
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.