Automate Workflow Versioning and Comparison with GitHub
detail.loadingPreview
This n8n workflow automates the process of versioning and comparing your workflows with their GitHub repository counterparts. It intelligently detects if a workflow is new, different, or the same, and can automatically create new files or update existing ones on GitHub.
About This Workflow
This powerful n8n workflow acts as a bridge between your n8n automation environment and your GitHub repository, specifically for managing workflow definitions. It triggers on manual execution and utilizes the n8n node to fetch the current workflow's state. The 'Get File' node attempts to retrieve the corresponding workflow definition from GitHub. An 'If file too large' node, along with a sophisticated 'isDiffOrNew' JavaScript node, then compares the fetched file with the current n8n workflow. It meticulously checks for differences, determines if the workflow is entirely new, or if it remains unchanged. Finally, based on these comparisons, it can create new files in your GitHub repository or inform you about the status.
Key Features
- Automatic Workflow Comparison: Accurately detects if a workflow is new, different, or identical to its GitHub version.
- Intelligent File Handling: Handles potential file size limitations and gracefully manages cases where no file exists on GitHub.
- Conditional GitHub Actions: Creates new workflow files on GitHub for new workflows or indicates when a file has been modified.
- Customizable Commit Messages: Generates informative commit messages based on the workflow name and its status.
How To Use
- Trigger: Initiate the workflow by clicking 'execute' on the manual trigger node.
- Fetch Current Workflow: The n8n node retrieves the current state of your n8n workflow.
- Retrieve GitHub File: The 'Get File' node attempts to download the corresponding workflow file from your GitHub repository based on provided URL or path.
- Compare Workflows: The 'If file too large' and 'isDiffOrNew' nodes compare the fetched GitHub file with the current n8n workflow, determining its status (new, different, or same).
- Status Check: The 'Check Status' node routes the workflow based on the determined status.
- GitHub Action (for new files): If the workflow is new, the 'Create new file' node (GitHub node) will create a new file in your specified GitHub repository with the appropriate content and commit message.
Apps Used
Workflow JSON
{
"id": "c086cd79-632b-4e2a-ab09-a616e904f758",
"name": "Automate Workflow Versioning and Comparison with GitHub",
"nodes": 9,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: c086cd79-632b...
About the Author
DevOps_Master_X
Infrastructure Expert
Specializing in CI/CD pipelines, Docker, and Kubernetes automations.
Statistics
Related Workflows
Discover more workflows you might like
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Robust Concurrency Control for n8n Workflows with Redis
Prevent simultaneous execution of critical n8n workflows or tasks using a centralized, Redis-backed locking mechanism. This reusable utility workflow ensures data integrity and resource management by allowing other workflows to acquire, check, and release locks.
Automate Qualys Report Generation and Retrieval
Streamline your Qualys security reporting by automating the generation and retrieval of reports. This workflow ensures timely access to crucial security data without manual intervention.