GitHub Fork Synchronization Status Monitor - n8n Workflow

Automate monitoring of GitHub forked repository sync status using this powerful n8n workflow. Get instant Telegram alerts when forks fall behind or pull ahead of their upstream source.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Open Source Contributors: Individuals needing to ensure their contributions (forks) are current with the main project.

  • DevOps Engineers: Teams requiring proactive monitoring of source code sync across multiple forks.

  • n8n Users: Those looking for advanced examples of using the n8n node structure for API chaining and complex data manipulation.

  • Technical Managers: Anyone who needs periodic, automated reports on project dependency freshness.

Overview

Maintaining consistency across numerous GitHub forks can be a labor-intensive manual task. This specialized n8n workflow solves this by providing a highly automated DevOps monitoring solution. The automation can be triggered manually or via a Telegram command, allowing users to instantly request a status check on up to 1000 repositories.

The core value of this n8n template lies in its ability to iterate through every forked repository, make specific branch comparison API calls, and consolidate the results (commits ahead/behind) into a clean, actionable Telegram message. This efficient n8n workflow ensures you never miss crucial updates or fall too far behind the upstream source, making it an essential tool for project tracking and management.

How it Works

This comprehensive n8n workflow operates in a multi-stage process:


  1. Trigger and Command Parsing: The workflow starts either with a manual n8n trigger or a Telegram message containing the /forkcheck N command. A Code n8n node parses the command, setting the maximum number of repositories (N) to check (defaulting to 1000).

  2. Repository Retrieval: The GitHub n8n node fetches the specified number of the user’s repositories. A subsequent Filter n8n node ensures that only repositories marked as forks are passed downstream.

  3. Looping and Detail Fetching: The Split In Batches n8n node initiates a loop, processing each fork individually. Inside the loop, another GitHub n8n node retrieves detailed repository information, including the crucial parent (upstream) repository data.

  4. Comparison Setup: The 'Prepare Upstream URL' Code n8n node dynamically constructs the required GitHub Compare API URL, comparing the fork's default branch against the upstream's default branch. This node also preserves essential metadata for later steps.

  5. API Call: An HTTP Request n8n node executes the branch comparison API call, determining the exact number of commits the fork is 'ahead by' or 'behind by'.

  6. Result Processing: The 'Process Comparison Result' Code n8n node extracts the behindby and aheadby counts from the API response, combining them with the preserved repository metadata to determine the overall synchronization status (UP-TO-DATE, AHEAD, or BEHIND).

  7. Reporting: Once the loop completes, the Merge n8n node combines all results. The 'Format for Telegram' Code n8n node then organizes this data into a clear MarkdownV2 table. Finally, the Telegram n8n node broadcasts the full status report, completing the n8n workflow execution.

Installation Guide

To deploy this specialized n8n workflow, follow these setup instructions:


  1. Import the n8n Workflow: Copy the provided JSON data and import it into your n8n instance via the 'Workflows' menu, using the 'New' button and selecting 'Import from JSON'.

  2. GitHub Credentials: Configure the GitHub n8n node credentials. You will need a GitHub Personal Access Token (PAT) with permissions to read user repositories.

  3. HTTP Request Credentials (PAT): The 'Compare Branches API Call' HTTP Request n8n node requires a Generic Credential Type configured as 'httpHeaderAuth'. Name this credential github-api-pat and set the header to Authorization: token .

  4. Telegram Credentials: Set up the Telegram n8n trigger and Telegram n8n node credentials. You will need a Bot Token and the Chat ID where the report should be sent (configured in the final Telegram n8n node).

  5. Activation: Activate the n8n workflow. It is now ready to be run manually or triggered by the designated Telegram command (/forkcheck).

Node Details

This n8n template uses several core and integration nodes to achieve its goal:

Telegram Trigger n8n node: The primary n8n trigger, listening for the /forkcheck command from a configured Telegram chat.
Code n8n node (Prepare Upstream URL): Crucial for dynamic URL construction. It takes the repository JSON, identifies the parent (upstream) repo details, and generates the exact GitHub API URL needed for branch comparison, ensuring the subsequent API call in the n8n workflow is precise.
GitHub n8n node (Get repos & get-repo-details): Used twice. First, to list all user repositories, applying the limit set by the n8n trigger. Second, within the loop, to fetch detailed metadata about the parent repository for comparison.
Filter n8n node: Ensures only records where fork property is true are processed, optimizing the n8n workflow efficiency.
HTTP Request n8n node (Compare Branches API Call): Executes the specialized GitHub API endpoint to compare commit divergence between the fork and the upstream branch.
Code n8n node (Process Comparison Result): Reads the results of the comparison API (behindby, aheadby) and structures the final output data used for reporting. This n8n node handles data transformation.
Split In Batches n8n node: Manages the iterative process, ensuring each forked repository is processed sequentially before all results are combined.
Code n8n node (Format for Telegram): The final transformation n8n node, responsible for rendering the technical results into a readable, Markdown-formatted status table suitable for Telegram.


  • Telegram n8n node: Sends the final, summarized report to the designated channel.

Related n8n Workflows

Free

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by
Manish
Manish

Featured*