Bidirectional GitHub workflow sync & version control for n8n workflows
Who is this for? This template is ideal for n8n administrators, automation engineers, and DevOps teams who want to maintain bidirectional synchronization between their n8n workflows and GitHub repositories. It helps teams keep their workflow backups up-to-date and ensures consistency between their n8n instance and version control system. What problem is this workflow solving? Managing workflow versions across n8n and GitHub can become complex when changes happen in both places. This workflow solves that by automatically synchronizing workflows bidirectionally, ensuring that the most recent version is always available in both systems without manual intervention or version conflicts. What this workflow does: Runs on a weekly schedule (every Monday) to check for synchronization needs. Fetches all workflows from your n8n instance and compares them with GitHub repository files. Identifies workflows that exist only in n8n and uploads them to GitHub as JSON backups. Identifies workflows that exist only in GitHub and creates them in your n8n instance. For workflows that exist in both places, compares timestamps and syncs the most recent version: If n8n version is newer β Updates GitHub with the latest workflow If GitHub version is newer β Updates n8n with the latest workflow Automatically handles file naming, encoding/decoding, and commit messages with timestamps. Setup: Connect GitHub: Configure GitHub API credentials in the GitHub nodes. Note: Use a GitHub Personal Access Token (classic) with repo permissions to read and write workflow files. Connect n8n API: Provide your n8n API credentials in the n8n nodes. Check this doc Configure GitHub Details in the Set GitHub Details node: githubaccountname: Your GitHub username or organization githubreponame: The repository name where workflows should be stored repoworkflowspath: The folder path in your repo (e.g., workflows or n8n-workflows) Adjust Schedule: Modify the Schedule Trigger if you want a different sync frequency (currently set to weekly on Mondays). Test the workflow: Run it manually first to ensure all connections and permissions are working correctly. How to customize this workflow to your needs: Change sync frequency: Modify the Schedule Trigger to run daily, hourly, or on-demand. Add filtering: Extend the Filter node to exclude certain workflows (e.g., test workflows, templates). Add notifications: Insert Slack, email, or webhook notifications to report sync results. Implement conflict resolution: Add custom logic for handling workflows with the same timestamp. Add workflow validation: Include checks to validate workflow JSON before syncing. Branch management: Modify to sync to different branches or create pull requests instead of direct commits. Backup retention: Add logic to maintain multiple versions or archive old workflows. Key Features: Bidirectional sync: Handles changes from both n8n and GitHub Timestamp-based conflict resolution: Always keeps the most recent version Automatic file naming: Converts workflow names to valid filenames Base64 encoding/decoding: Properly handles JSON workflow data Comprehensive comparison: Uses dataset comparison to identify differences Automated commits: Includes timestamps in commit messages for traceability This automated synchronization workflow provides a robust backup and version control solution for n8n workflows, ensuring your automation assets are always safely stored and consistently available across environments.
Generate workflows from natural language using GPT-4o Mini and n8nBuilder API
π€ AI-Powered n8n Workflow Generator with n8nBuilder API Overview This workflow lets you generate complete n8n workflows from natural language descriptions using the n8nBuilder API. π Users submit a short description via a form, and the workflow returns a ready-to-import n8n workflow JSON. Why use it? β‘ AI-generated workflows from natural language π οΈ Production-ready patterns (triggers, error handling, best practices) π― Perfect for beginners who don't know which nodes to pick π Two modes: Form-based and AI Chat Agent --- Prerequisites π n8nBuilder account + API token β Get your free token at n8nbuilder.dev π’ An n8n instance (Cloud or self-hosted) π€ OpenAI API Key (Optional - to use with AI Agents) β οΈ Important: Never expose your API key in public workflows. Use n8n Credentials for production setups. --- Setup Instructions Get your n8nBuilder API token Visit n8nbuilder.dev Sign up or log in to your account Navigate to Account β API to generate your token Configure the Form The Form Trigger collects: api_token (required) β Your n8nBuilder API token email (required) β Your email address query (required) β Natural language description of the workflow (e.g., "Read RSS from https://n8nbuilder.dev/blog/feed.xml every hour and send Slack message if new post arrives") Workflow Execution User fills the form and submits Workflow sends a POST request to https://api.n8nbuilder.dev/api/generate n8nBuilder API processes the request and generates a complete workflow Response is cleaned and formatted User receives the generated workflow JSON ready to import Outputs The workflow returns: output β Complete n8n workflow JSON ready to import π‘ Tip: Copy the generated JSON and import it directly into your n8n instance via Settings β Workflows β Import from File. --- Customization Tips π Write clear descriptions: The more specific your query, the better the generated workflow π¨ Try different use cases: Data transformation, API integrations, scheduled tasks, webhooks, etc. π§ Edit after generation: Generated workflows are production-ready but you can always customize them further π€ Use AI Chat mode: Enable the AI Agent for conversational workflow generation --- Alternative: Use the n8nBuilder Community Node π Optional: Install the n8n-nodes-n8nbuilder community node if you prefer using a dedicated node instead of raw HTTP. See: GitHub Repository --- Troubleshooting 401/403 Unauthorized β Check your API token in the form Invalid JSON β Ensure your email and query are properly filled No output returned β Verify your API token is valid and active Slow response β Complex workflows may take a few seconds to generate --- Security Best Practices π Do not hardcode API tokens in public workflows π Use n8n Credentials for storing tokens securely π‘οΈ Keep your API token private and regenerate if compromised --- Learn More π n8nBuilder Documentation