About this workflow
AI-Powered n8n Creators Leaderboard Analytics Workflow
This n8n workflow template is a sophisticated, AI-driven analytics system designed to fetch, process, and generate insightful reports about top contributors and popular workflows in the n8n automation community. By leveraging publicly available statistics hosted on GitHub and integrating with OpenAI’s language models, it delivers dynamic, human-readable Markdown summaries tailored to specific creators—ideal for community engagement, performance benchmarking, and trend analysis.
What the Workflow Does
The workflow retrieves two JSON datasets from a public GitHub repository:
- Creator-level statistics: Aggregated metrics per user (e.g., total weekly/monthly inserters).
- Workflow-level statistics: Detailed metrics for individual workflows (e.g., unique visitors, usage trends).
It then processes this data by parsing, sorting, limiting, and merging records based on username. When triggered—either via a chat message or an external workflow execution—it filters results for a specified creator and uses an AI agent (powered by gpt-4o-mini) to synthesize a comprehensive Markdown report. This report includes summaries, comparative tables, popularity insights, and community impact analysis. Optionally, the output is saved as a timestamped .md file locally.
Key Features and Capabilities
- Dual Trigger Support: Can be activated either through a natural-language chat interface or programmatically via another workflow.
- AI-Powered Report Generation: Uses a structured prompt with
gpt-4o-minito produce well-formatted, insightful Markdown content. - Dynamic Data Fetching: Pulls live statistics from GitHub-hosted JSON files, ensuring up-to-date leaderboard data.
- Flexible Filtering: Focuses analysis on any specified n8n creator username.
- Local Output Saving: Automatically saves generated reports as Markdown files with timestamps for archival.
- Extensible Architecture: Includes commented-out support for local LLMs (e.g., Ollama) for privacy-conscious deployments.
- Rich Documentation: Embedded sticky notes provide clear guidance, explanations, and quick-start instructions.
Main Nodes and Their Purposes
| Node | Type | Purpose |
|---|---|---|
| When chat message received | @n8n/n8n-nodes-langchain.chatTrigger |
Entry point for natural-language queries (e.g., “show me stats for username joe”). |
| When Executed by Another Workflow | executeWorkflowTrigger |
Allows programmatic invocation with a JSON payload containing a username. |
| Global Variables | set |
Defines base URLs and filenames for GitHub-hosted data sources (stats_aggregate_creators.json, stats_aggregate_workflows.json). |
| stats_aggregate_creators / workflows | httpRequest |
Fetches creator and workflow statistics from GitHub. |
| Parse Creators/Workflow Data | set |
Extracts the data array from raw HTTP responses for downstream processing. |
| Split Out Creators/Workflows | splitOut |
Unpacks arrays into individual items for record-level operations. |
| Sort & Limit Nodes | sort + limit |
Ranks creators/workflows by weekly inserters and caps results (Top 25 creators, Top 300 workflows). |
| Creators/Workflows Data | set |
Standardizes field names and structures for consistent merging. |
| Merge Creators & Workflows | merge |
Joins creator and workflow records using username as the key. |
| Filter By Creator Username | filter |
Isolates data for the requested user (from trigger input). |
| Aggregate | aggregate |
Combines all filtered items into a single JSON array for the AI agent. |
| Workflow Response | set |
Formats the aggregated data as a string response. |
| n8n Creator Stats Agent | agent |
Orchestrates the AI reasoning loop using the OpenAI model and custom system prompt. |
| Workflow Tool | toolWorkflow |
Exposes this workflow itself as a callable tool for the AI agent, enabling recursive or modular design. |
| Summary Report → creator-summary → Save file | set → convertToFile → readWriteFile |
Converts AI output to text, then writes it to a local Markdown file with a timestamped name. |
| Sticky Notes | stickyNote |
Provide inline documentation, architecture diagrams, use cases, and setup guides throughout the canvas. |
Use Cases and Benefits
- Community Managers: Identify top contributors, track engagement trends, and spotlight impactful workflows.
- Workflow Creators: Benchmark their own workflows against peers and understand what drives adoption.
- New Users: Discover high-quality, popular automations to learn from or reuse.
- Data Analysts: Automate the extraction and interpretation of community usage patterns without manual scripting.
- AI Enthusiasts: Demonstrate how LLMs can transform raw metrics into narrative insights with minimal configuration.
Benefits include time savings, enhanced data interpretability, automated reporting, and deeper community visibility—all within the n8n ecosystem.
Step-by-Step Workflow Logic
-
Trigger: The workflow starts either via:
- A chat message (e.g., “show me stats for username joe”) → routed to the AI agent.
- An external workflow call with
{ "query": { "username": "joe" } }→ routed to Global Variables.
-
Data Preparation (for external triggers):
- Global Variables sets base URL and filenames.
- Two HTTP Request nodes fetch
creators.jsonandworkflows.jsonfrom GitHub.
-
Data Processing Pipeline:
- Raw JSON responses are parsed to extract the
dataarrays. - Arrays are split into individual records using Split Out nodes.
- Records are sorted by
sum_unique_weekly_inserters(creators) orunique_weekly_inserters(workflows). - Results are limited to Top 25 creators and Top 300 workflows.
- Field names are standardized via Creators Data and Workflows Data nodes.
- Raw JSON responses are parsed to extract the
-
Data Integration:
- Creator and workflow records are merged on
usernameusing the Merge node. - The merged dataset is filtered to retain only entries matching the input
username.
- Creator and workflow records are merged on
-
AI Analysis:
- Filtered data is aggregated into a single JSON array.
- The n8n Creator Stats Agent receives this data and uses
gpt-4o-miniwith a detailed system prompt to generate a structured Markdown report.
-
Output Handling:
- The AI’s response is captured in Summary Report.
- Converted to plain text via creator-summary.
- Saved as a local
.mdfile (e.g.,creator-summary-2024-06-15-03-45-22.md) using Save creator-summary.md.
-
Response Delivery:
- The final report is available both as a workflow output and a persistent local file.
This workflow exemplifies how n8n can bridge open data, automation, and generative AI to deliver actionable intelligence—turning raw community metrics into compelling narratives with zero manual intervention.
How to use: download the JSON, then in n8n choose “Import from File”.