Back to Catalog

Backup n8n workflows to Github

Dat ProtoDat Proto
2106 views
2/3/2026
Official Page

Introduction

This workflow will backup all of your existed workflows to a single Github repository.

The Backup folders' name are based on the current backup date and have default format: "yyyy/MM/dd" (setup at "Create sub path" node).

Throughout the backup process, the N8N will inform user via discord with clear message about Start, Success and Failure backups.

The workflow will be

Tech Stack

The following nodes / services / libraries are used in this workflow:

Nodes:

  1. Discord: To send message to configured setup channel.
  2. N8N: To get all workflows' information.
  3. Github: To store backup data.
  4. Code: To run data comparison (Existed vs Latest workflow data).
  5. Wait: To avoid discord message rate limit.

External libraries:

  1. Underscore.js: JavaScript library that provides lots of common Javascript functions, to help user save time when using code node.

Guideline

  1. Open "Config" node and setup the following information:
    • repo_owner: Your Github username.
    • repo_name: The repository that you want to store workflows backup data.
  2. Open "Create sub path" node and change the naming and path format of backup folder(s).
  3. Setup custom messages in 3 discord nodes:
    • Starting Message: N8N inform user at the time workflow start.
    • Inform Success Flows: After each success backup, N8N will notify user.
    • Inform Failed Flows: After each failure backup, N8N will notify user to have appropriate action.
    • Completed Notifications: Then at the final, the workflow will give user a summary.
  4. Setup "Schedule Trigger" node to change default automated backup time.

Screenshots

Discord output

image.png

n8n Workflow: Backup n8n Workflows to GitHub

This n8n workflow provides a robust solution for backing up your n8n workflows to a GitHub repository. It allows you to automatically export your active workflows, commit them to a specified GitHub repository, and even notify a Discord channel about the backup status. The workflow is designed to be flexible, supporting both manual execution and scheduled backups.

What it does

  1. Triggers Manually or on Schedule: The workflow can be initiated manually by clicking "Execute workflow" or automatically at a predefined schedule (e.g., daily, weekly).
  2. Retrieves n8n Workflows: It connects to your n8n instance to fetch a list of all active workflows.
  3. Filters out itself: It ensures that the backup workflow itself is not included in the list of workflows to be backed up.
  4. Processes Workflows in Batches: Each workflow is processed individually to prepare its data for GitHub.
  5. Formats Workflow Data: It extracts the workflow's JSON definition and prepares it for a file commit.
  6. Checks for Existing Workflow Files: For each workflow, it checks if a file with the same name already exists in the target GitHub repository.
  7. Determines GitHub Action:
    • If the workflow file exists and its content is identical, no action is taken.
    • If the workflow file exists but its content has changed, it updates the file in GitHub.
    • If the workflow file does not exist, it creates a new file in GitHub.
  8. Commits to GitHub: It performs the necessary Git operations (create, update) to store the workflow JSON files in your GitHub repository.
  9. Notifies Discord (Optional): If configured, it sends a message to a Discord channel indicating the success or failure of the backup operation, including details about which workflows were backed up or updated.

Prerequisites/Requirements

  • n8n Instance: An active n8n instance where this workflow will run.
  • GitHub Account: A GitHub account and a repository where you want to store your n8n workflow backups.
  • GitHub Credentials: An n8n credential for GitHub with appropriate permissions to create, read, and update files in your chosen repository.
  • Discord Account (Optional): A Discord server and channel if you wish to receive notifications.
  • Discord Webhook Credentials (Optional): An n8n credential for Discord to send messages.

Setup/Usage

  1. Import the Workflow: Import the provided JSON into your n8n instance.
  2. Configure Credentials:
    • GitHub: Set up a GitHub credential. You'll need to provide an Access Token with repo scope (or at least public_repo if the repository is public) for file operations.
    • Discord (Optional): Set up a Discord credential, typically a Webhook URL, if you want notifications.
  3. Configure Nodes:
    • GitHub Node (ID: 16):
      • Select your GitHub credential.
      • Specify the Owner (your GitHub username or organization name) and Repository name where you want to store the backups.
      • Set the Branch (e.g., main or master).
      • Adjust the File Path if you want to store workflows in a specific subdirectory (e.g., n8n-workflows/).
    • n8n Node (ID: 826): This node is used to fetch the workflows from your n8n instance. Ensure it's configured to list all active workflows.
    • Discord Node (ID: 60): If using, select your Discord credential and specify the Channel ID or Webhook URL.
  4. Activate the Workflow: Enable the workflow.
  5. Schedule (Optional): Configure the "Schedule Trigger" node (ID: 839) to run the workflow at your desired interval (e.g., once a day, once a week).
  6. Manual Execution: You can also manually trigger the workflow using the "Manual Trigger" node (ID: 838) for immediate backups.

Related Templates

Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax

Spark your creativity instantly in any chatโ€”turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. ๐Ÿ“‹ What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing ๐Ÿ”ง Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation ๐Ÿ”‘ Required Credentials OpenAI API Setup Go to platform.openai.com โ†’ API keys (sidebar) Click "Create new secret key" โ†’ Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai โ†’ Dashboard โ†’ API Keys Generate a new API key โ†’ Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) โš™๏ธ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflowโ€”chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" ๐ŸŽฏ Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration โš ๏ธ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions

Daniel NkenchoBy Daniel Nkencho
601

AI-powered code review with linting, red-marked corrections in Google Sheets & Slack

Advanced Code Review Automation (AI + Lint + Slack) Whoโ€™s it for For software engineers, QA teams, and tech leads who want to automate intelligent code reviews with both AI-driven suggestions and rule-based linting โ€” all managed in Google Sheets with instant Slack summaries. How it works This workflow performs a two-layer review system: Lint Check: Runs a lightweight static analysis to find common issues (e.g., use of var, console.log, unbalanced braces). AI Review: Sends valid code to Gemini AI, which provides human-like review feedback with severity classification (Critical, Major, Minor) and visual highlights (red/orange tags). Formatter: Combines lint and AI results, calculating an overall score (0โ€“10). Aggregator: Summarizes results for quick comparison. Google Sheets Writer: Appends results to your review log. Slack Notification: Posts a concise summary (e.g., number of issues and average score) to your teamโ€™s channel. How to set up Connect Google Sheets and Slack credentials in n8n. Replace placeholders (<YOURSPREADSHEETID>, <YOURSHEETGIDORNAME>, <YOURSLACKCHANNEL_ID>). Adjust the AI review prompt or lint rules as needed. Activate the workflow โ€” reviews will start automatically whenever new code is added to the sheet. Requirements Google Sheets and Slack integrations enabled A configured AI node (Gemini, OpenAI, or compatible) Proper permissions to write to your target Google Sheet How to customize Add more linting rules (naming conventions, spacing, forbidden APIs) Extend the AI prompt for project-specific guidelines Customize the Slack message formatting Export analytics to a dashboard (e.g., Notion or Data Studio) Why itโ€™s valuable This workflow brings realistic, team-oriented AI-assisted code review to n8n โ€” combining the speed of automated linting with the nuance of human-style feedback. It saves time, improves code quality, and keeps your teamโ€™s review history transparent and centralized.

higashiyama By higashiyama
90

Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.

gotoHumanBy gotoHuman
353