Gửi Báo Cáo GitHub Hàng Tuần qua Telegram với Qwen & OpenRouter
Sẵn sàng sử dụng?
Resources & Links
1. Tổng quan dự án (Overview)
Đây là workflow tự động theo dõi toàn bộ GitHub repositories trên tài khoản của bạn và tạo báo cáo kỹ thuật bằng AI, gửi trực tiếp đến Telegram. Chạy tự động mỗi thứ Hai lúc 9 giờ sáng — hoặc tức thì khi bạn gửi lệnh /report, /issues, /prs, /status đến bot Telegram. Không cần dashboard, không cần BI setup, không cần báo cáo thủ công. Chỉ đơn giản là một bot giúp bạn luôn thấy rõ hoạt động kỹ thuật của mình.
Workflow này hoàn hảo cho indie hackers, solo developers, open-source maintainers và các nhóm kỹ thuật nhỏ muốn có báo cáo engineering hàng tuần nhẹ nhàng mà không cần công cụ analytics đắt tiền hay setup Jira phức tạp.
Mục tiêu chính: Giữ visibility liên tục về hoạt động engineering mà không cần rời khỏi Telegram — bot tự động tổng hợp, AI tạo báo cáo dễ đọc, con người quyết định hành động.
🚀 Điểm nổi bật: Hai trigger trong một workflow — lịch trình hàng tuần cho báo cáo tự động, bot Telegram cho truy vấn tức thì. Stats được tổng hợp trước khi gửi LLM nên tiết kiệm token đáng kể. Nếu AI gặp sự cố, node code dự phòng vẫn tạo báo cáo từ dữ liệu thô — không bao giờ mất kết nối.
2. Tính năng nổi bật (Key Features)
A. Báo Cáo Đa Chế Độ qua Telegram Bot hỗ trợ 4 lệnh khác nhau, mỗi lệnh cho ra output phù hợp với nhu cầu cụ thể, từ báo cáo tổng quan đến kiểm tra nhanh sức khỏe repo.
- Chi tiết 1:
/reporttạo báo cáo tuần đầy đủ 4 phần (highlights, per-repo details, weekly insights, next-week priorities)./issuesliệt kê tất cả open issues./prshiển thị trạng thái PR./statuscho health check nhanh với emoji indicators. - Chi tiết 2: Báo cáo được chia thành nhiều message Telegram để giữ trong giới hạn 4096 ký tự và tối ưu khả năng đọc trên mobile.
B. Thu Thập & Tổng Hợp Thông Minh Workflow tự động lấy toàn bộ repo, lọc bỏ archived, thu thập events và tổng hợp stats trước khi gửi cho AI — tiết kiệm token và chi phí API.
- Chi tiết 1: Kéo danh sách repo qua GitHub User Repos API, tự động lọc archived repo. Với mỗi repo, gọi Events API lấy tối đa 100 events gần nhất.
- Chi tiết 2: Events được nhóm theo repo, đếm theo loại (commits, issues, PRs, releases), track contributors và phát hiện repo stale. Chỉ counts (không raw payloads) được gửi đến LLM — giảm đáng kể token usage.
C. Xử Lý Lỗi & Fallback Toàn Diện Workflow được thiết kế để luôn phản hồi cho người dùng, không bao giờ im lặng khi có lỗi ở bất kỳ tầng nào.
- Chi tiết 1: Switch node xử lý 3 đường: có activity (tạo báo cáo), tất cả repo lỗi (gửi alert API error), không activity (dừng im lặng).
- Chi tiết 2: Nếu AI model fail, node code dự phòng format stats thô mà không cần AI. Nếu tất cả GitHub repo fail, error alert gửi đến Telegram. Người dùng luôn nhận được phản hồi.
D. Token-Efficient & Chi Phí Thấp Hoạt động repo được tổng hợp và nén thành stats summary trước khi gửi LLM. Không vector DB, không embeddings, không subscription thêm. AI làm tổng hợp, không làm retrieval.
3. Hướng dẫn cài đặt chi tiết (Setup Guide)
Để chạy workflow này, bạn cần chuẩn bị các tài nguyên sau:
⚙️ Yêu cầu môi trường (Prerequisites)
- n8n Instance: Bản self-hosted hoặc cloud đều được.
- GitHub Personal Access Token: Fine-grained với quyền Contents (Read-only), scope vào các repo muốn theo dõi. Hoặc dùng Classic PAT với scope
repo. - Telegram Bot Token + Chat ID: Tạo bot qua @BotFather, lấy bot token. Lấy chat ID bằng cách gửi tin nhắn cho bot rồi gọi
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates. - OpenRouter API Key: Hoặc bất kỳ endpoint tương thích OpenAI nào.
Các bước thực hiện:
- Cấu hình GitHub: Tạo Fine-grained PAT với quyền Contents Read-only, scope vào repo muốn monitor. Hoặc Classic PAT với scope
repo. - Tạo Telegram Bot: Tạo qua @BotFather, lấy bot token và chat ID của bạn.
- Lấy OpenRouter API Key: Đăng ký tại openrouter.ai.
- Thêm Credentials vào n8n: Header Auth (GitHub token) + Telegram Bot API + OpenAI API (OpenRouter).
- Cấu hình Nodes: Trong nodes “Fetch GitHub Repositories” và “Retrieve GitHub Events” — gán GitHub Header Auth credential. Trong nodes “Send Messages to Telegram” và “Send Error Alert” — set chat ID Telegram. Trong node “OpenAI Report Model” — gán OpenRouter credential. Trong node “Telegram Message Trigger” — gán Telegram Bot credential.
- Active: Bật workflow. Gửi
/reportđến Telegram bot để test ngay.
⚠️ Lưu ý chi phí (Cost Warning): Workflow gọi OpenRouter API mỗi lần tạo báo cáo (tự động hàng tuần hoặc khi gửi lệnh). Stats được tổng hợp trước khi gửi LLM nên token usage thấp. Với tài khoản có hàng trăm repo, chi phí mỗi lần chạy vẫn rất nhỏ do chỉ gửi counts, không gửi raw event payloads.
4. Tùy chỉnh (Customization)
- Filter repos: Nếu có hơn 100 repositories, GitHub User Repos API trả về phân trang. Thêm node Code giữa “Fetch GitHub Repositories” và “Retrieve GitHub Events” để xử lý phân trang, hoặc lọc repo cụ thể:
var myRepos = ['owner/repo1', 'owner/repo2'];
items = items.filter(function(item) {
return myRepos.indexOf(item.json.full_name) !== -1;
});
- Đổi lịch chạy: Chỉnh cron trong “Weekly Digest Trigger”. Hàng ngày 9am = mỗi ngày, Thứ 6 5pm = mỗi thứ 6, Hai lần/tuần = thứ Hai và thứ Năm.
- Swap the LLM: Đổi model trong “OpenAI Report Model” thành bất kỳ model nào OpenRouter hỗ trợ (GPT-4o, Claude, Gemini) hoặc trỏ sang model tự host bằng cách đổi base URL trong credential.
- Đổi kênh output: Thay “Send Messages to Telegram” bằng node Discord, Slack, Notion hoặc Email. Định dạng báo cáo hoạt động tốt trên mọi nền tảng.
- Thêm lệnh mới: Chỉnh “Parse Telegram Command” để chấp nhận lệnh mới (ví dụ: /releases, /contributors). Thêm logic lệnh mới trong LLM prompt dưới một section MODE mới.
- Single message mode: Bỏ logic tách ||| trong “Format Telegram Messages” và nối tất cả phần báo cáo thành một message duy nhất.
5. Hướng phát triển (What’s Next)
Workflow hiện tại được thiết kế như một nền tảng. Đây là những hướng mở rộng khi nhu cầu tăng lên:
A. Social Media Auto-post Tái sử dụng weekly digest thành bài đăng LinkedIn hoặc Twitter với nút approve trên Telegram trước khi publish.
B. Obsidian Sync Đẩy mỗi báo cáo dưới dạng Markdown file vào Obsidian vault qua Git. Xây dựng second brain có thể tìm kiếm về lịch sử dự án.
C. Unified Weekly Report Tổng hợp GitHub + Gmail + Google Calendar + WakaTime (coding time) + Notion tasks vào một báo cáo duy nhất. Tất cả nguồn đều có tích hợp n8n sẵn.
D. Error Knowledge Base Trích xuất pattern lỗi từ issues, append vào JSON knowledge base. Đưa vào RAG chatbot cho Q&A trong tương lai.
E. Multi-channel Delivery Gửi cùng lúc báo cáo đến Telegram + Email + Discord + Slack.
Phiên bản hiện tại cố ý giữ đơn giản. Đơn giản nghĩa là chạy rẻ, ít lỗi, dễ debug. Độ phức tạp có thể thêm dần khi use case thực tế đòi hỏi.
6. Yêu cầu hệ thống (Requirements)
- n8n instance (self-hosted hoặc cloud)
- GitHub Personal Access Token (Fine-grained với Contents Read-only, hoặc Classic với scope repo)
- Telegram Bot token + chat ID
- OpenRouter API key (hoặc bất kỳ endpoint tương thích OpenAI nào)
- GitHub account có ít nhất một repository
7. Sample Output
/report — Full Weekly Digest (4 messages)
Message 1/4:
📊 GitHub Weekly Digest
14 May – 21 May 2026
This week recorded 13 activities across 5 repositories:
11 issues opened, no commits, no pull requests. All activity
was concentrated in triage-demo through issue tracking.
🔥 HIGHLIGHTS
• dothanhvinh17 dominated 100% of activity (13/13 actions)
via issue creation in triage-demo
• No commits or releases published this week
⚠️ NEEDS ATTENTION
• 4 repos are stale (0 events): rag-kb, bepchu7-landing,
Kevin-Do-System, dothanhvinh17
• triage-demo has 11 issues and 0 commits — imbalance may
signal unresolved backlog
Message 2/4:
🔹 dothanhvinh17/triage-demo — 0 commits, 11 issues, 0 PRs
All weekly GitHub activity (11 issues) occurred in this repo.
No code changes or pull requests were made, indicating a focus
on issue tracking or backlog creation.
👤 Key Contributor: dothanhvinh17 (11 issues opened)
📈 Trend: needs attention — high issue volume with zero
implementation effort this week
Message 3/4:
🔹 dothanhvinh17/dothanhvinh17 — 0 commits, 0 issues, 0 PRs
No activity recorded. Repo may need maintenance or archival.
🔹 dothanhvinh17/rag-kb — 0 commits, 0 issues, 0 PRs
STALE — Zero activity this week. Consider reviewing
ownership or relevance.
🔹 dothanhvinh17/bepchu7-landing — 0 commits, 0 issues, 0 PRs
STALE — Landing page repo with no recent engagement.
🔹 dothanhvinh17/Kevin-Do-System — 0 commits, 0 issues, 0 PRs
STALE — No activity observed. Likely inactive project.
Message 4/4:
📈 WEEKLY INSIGHTS
• Activity highly concentrated: 100% of actions in 1 repo
• Overall development velocity is 0 — no commits or PRs
• Risk: 4/5 repos show no activity
👥 CONTRIBUTORS
• dothanhvinh17 (13 total actions): Sole contributor,
created 11 issues in triage-demo
🔮 NEXT WEEK PRIORITIES
1. Address backlog in triage-demo — schedule triage session
to convert issues into tasks
2. Review stale repos for archiving or reactivation
3. Restart development velocity: target ≥1 commit or PR
across any repo by end of week
4. Investigate if stale repos are still needed
—
GitHub Activity Digest | Powered by n8n
/issues — Open Issues Report (1 message)
📋 Open Issues Report — 21 May 2026
dothanhvinh17/triage-demo
• Issue #11 Test issue for triage demo — open (0 days)
• Issue #10 Another test issue — open (0 days)
• Issue #9 SQL injection vulnerability — open (5 days) ⚠️
• Issue #8 Consider switching to pnpm — open (5 days) ⚠️
• Issue #7 API auth docs outdated — open (5 days) ⚠️
• Issue #6 Webhook notification question — open (5 days) ⚠️
• Issue #5 CSV export option — open (7 days) ⚠️
• Issue #4 Login 500 error after password reset — open (7 days) ⚠️
• Issue #3 Dark mode not saved — open (7 days) ⚠️
• Issue #2 Dark mode not saved — open (7 days) ⚠️
• Issue #1 Login 500 error after password reset — open (7 days) ⚠️
9 of 11 issues older than 3 days. Recommend prioritizing
issue #9 (SQL injection) as it is a security risk.
—
GitHub Activity Digest | Powered by n8n
/prs — Pull Request Status (1 message)
🔀 Pull Request Status — 21 May 2026
No pull requests this week.
—
GitHub Activity Digest | Powered by n8n
/status — Repository Health Check (1 message)
🩺 Repository Health Check
🟢 dothanhvinh17/triage-demo: Active (11 issues)
🟡 dothanhvinh17/dothanhvinh17: Low activity (0 events)
🔴 dothanhvinh17/rag-kb: Stale (0 events)
🔴 dothanhvinh17/bepchu7-landing: Stale (0 events)
🔴 dothanhvinh17/Kevin-Do-System: Stale (0 events)
Total events this week: 11
Recommendation: Triage issues in triage-demo,
review stale repos for archival.
—
GitHub Activity Digest | Powered by n8n