Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The most dependable setup is a scheduled export that writes one readable JSON file per n8n workflow, compares that export with the previous Git tree, commits only additions, changes, and deletions, and pushes to a private GitHub repository. For self-hosted n8n, the CLI is the simplest implementation. An n8n API workflow can perform the same job from inside n8n, while built-in source-control environments add branch-based promotion for Business and Enterprise plans.

A workflow export is not a complete disaster-recovery backup. Recovery also requires the n8n database, deployment configuration, environment variables, the N8N_ENCRYPTION_KEY (or the original .n8n configuration), and any external storage used by the deployment. Treat GitHub as the versioned workflow layer, then test the full restore procedure separately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The backup pattern that works

An automatic n8n-to-GitHub backup has four stages:

  1. Export: run the n8n CLI or call the n8n API on a schedule.
  2. Normalize and organize: keep one readable JSON document per workflow, with a small inventory and operating notes.
  3. Detect change: compare the new export with the checked-in tree, including deleted or renamed workflows.
  4. Version and push: commit only when the tree changed, then push to a private repository.

This separation is important. Exporting on a timer without comparing files creates noisy commits; comparing files without removing files for deleted workflows leaves false backups; and storing credentials beside ordinary workflow JSON can expose secrets.

Choose an implementation

Implementation What it backs up Draft or published fidelity Secret handling Restore use Availability and complexity
n8n CLI plus ordinary Git Workflow JSON, with credentials exported separately Reflects the state returned by the CLI export Credential exports are encrypted unless deliberately exported decrypted; keep them outside ordinary tracked files Import workflows and credentials after restoring the n8n platform Best for self-hosted installations; requires host, container, or job-runner access
n8n API plus GitHub Data API Workflow records selected by the API, with custom normalization Depends on the API data and the workflow you build Uses n8n and GitHub API credentials; design least-privilege access and avoid logging secrets Can recreate repository files and feed them back to n8n through the API Runs inside n8n, but requires more logic, security review, and deletion handling
Built-in source-control environments Environment-linked workflow changes and branch history n8n pushes the current saved version, not the published version Uses n8n’s source-control integration; still keep credentials and platform configuration in a separate recovery plan Branch-based promotion and pull operations, not a replacement for a full platform backup Available on Business and Enterprise plans; suited to teams already using environments
n8n CLI package export Portable folders or projects with dependency-aware packaging Depends on the package contents and import process Apply the same credential and key protections as other exports Useful for moving a portable project between installations The .n8np format is documented as beta and may change

If you control the machine running n8n, start with CLI plus Git. Select the API route when the backup must run entirely within n8n or needs custom filtering. Select source-control environments when branch promotion is the main requirement and your plan includes the feature. Use package export for portability, not as the only disaster-recovery copy.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Prepare a private GitHub repository

Create the repository and first commit

Create a private repository and make an initial commit before the first automated push. The initial tree can contain directories such as backups/workflows/, a protected location for credential exports, an inventory file, and an operations document. A first commit also gives the automation an unambiguous branch and base tree to compare.

Record the n8n version, repository and branch name, backup frequency, retention policy, required environment-variable names, and the person or team responsible for a restore. These notes turn a collection of JSON files into an operational backup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep secrets out of normal workflow files

Do not place decrypted credentials, encryption keys, API tokens, or database dumps in ordinary repository files. n8n credential exports are encrypted unless you explicitly request a decrypted export. A decrypted export is sensitive data and should be handled as a restricted artifact, not committed to the normal workflow directory.

Use a GitHub token limited to the target repository and the actions the job actually needs. Keep the token in the scheduler, container secret store, or n8n credential store; never hard-code it in a workflow JSON file or shell script. Restrict repository collaborators and enable the repository’s normal review and audit controls.

Method 1: scheduled n8n CLI export with Git

1. Export workflows as separate readable files

Run the n8n CLI job in the same environment that can read the n8n data. The backup form of the command is:

n8n export:workflow --backup --output=backups/workflows/

The --backup flag sets --all, --pretty, and --separate. The result is a complete export of all workflows as separate, human-readable JSON files rather than one opaque stream.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Export credentials separately when your recovery policy requires them:

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
n8n export:credentials --backup --output=backups/credentials/

Protect that output. Keep it in a restricted location or encrypted artifact store, and do not automatically add it to the ordinary workflow commit unless your security policy explicitly permits encrypted credential files and controls who can read them.

2. Run the job from the right environment

Choose one scheduler that can access the n8n installation and its configuration:

  • A host scheduler for a direct self-hosted installation.
  • A container or orchestration job that mounts the export destination and receives the required n8n environment variables.
  • A dedicated automation workflow that invokes the CLI in a controlled job runner.

The job must use the same n8n data source and configuration as the instance being protected. Running an export against a different database, project, or encryption configuration can produce a valid-looking but incomplete backup.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Commit only a changed tree

Initialize the checkout once, configure the private remote and target branch, and run the export into the checkout. A shell job can follow this pattern:

set -eu
n8n export:workflow --backup --output=backups/workflows/

git add backups/workflows/
if git diff --cached --quiet; then
  echo "No workflow changes"
else
  git commit -m "Backup n8n workflows"
  git push origin main
fi

Replace main with the branch selected for your backup policy. The important behavior is the staged-tree test: no file changes means no commit, while added, modified, or deleted JSON files produce a commit. Run the credential export in a protected path before or after this step, but do not stage it accidentally with a broad git add ..

4. Handle renames and deletions

Keep the export directory as the authoritative snapshot for that run. If an export no longer contains a workflow file, remove the corresponding old file from the checkout before staging. Otherwise a deleted workflow remains in Git and appears restorable even though it no longer exists in n8n.

When filenames are generated from workflow names, a rename can look like an addition plus a deletion. That is acceptable: Git records the content change and the resulting repository tree contains only current workflows. Keep a stable inventory containing workflow IDs and names if operators need to identify a rename.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

5. Choose retention deliberately

Git preserves every commit unless you rewrite history, so decide how long the repository should retain workflow versions. A simple policy might keep the full Git history while pruning restricted credential artifacts separately. Document who can delete history and how long off-site or immutable copies are retained. Retention for workflow JSON and retention for encrypted credentials do not have to be identical.

Method 2: build the backup inside n8n with its API

An n8n workflow can call the n8n API to list workflows and the GitHub Data API to write repository content. This is useful when you cannot run a host-level CLI job or when you need custom filtering and normalization.

Suggested workflow sequence

  1. Start with a schedule trigger at the interval your recovery objectives require.
  2. Authenticate to the n8n API and retrieve the workflows that belong in the backup scope.
  3. Convert each workflow to a stable, readable JSON representation. Remove or normalize volatile fields that change on every read but do not represent an intentional workflow edit.
  4. Assign a deterministic path for each workflow and build an inventory containing its ID and name.
  5. Read the current repository tree through the GitHub Data API.
  6. Compare the generated paths and content with the repository tree. Create or update files for additions and changes.
  7. Delete repository files that are no longer present in the generated set, so removed or renamed workflows do not become orphaned backups.
  8. Create a commit and update the target branch only when the resulting tree differs from the previous one.

Use separate credentials for n8n and GitHub, with permissions limited to the required API operations. Do not print API responses containing credentials or sensitive node parameters. Add loop protection and error handling so a failed GitHub write cannot trigger an unbounded retry cycle inside n8n.

The API design gives you control over normalization, but that control is also its main risk. If you remove a field that affects execution, the repository is no longer a faithful backup. Test the generated JSON by importing it into a disposable n8n instance before relying on the process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Method 3: n8n source-control environments

n8n’s built-in source-control environments connect instances and branches for team workflows. The feature is available on Business and Enterprise plans. It is designed for controlled promotion between environments, so configure the branch mapping, repository access, and push/pull process described by n8n for your plan.

There is a critical semantic difference from a “what is running now” backup: n8n states that source control pushes the current saved version, not the published version, of a workflow. Decide whether your policy protects drafts, published behavior, or both. If operators edit a workflow without publishing it, the source-control commit can contain that draft while production continues to execute the earlier published version.

Source control also does not remove the need to protect the database, encryption key, environment variables, deployment definition, and external storage. Treat its branch history as the workflow-change record and maintain a separate platform recovery copy.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Using the CLI package export

The n8n CLI package format, written as .n8np, is intended for portable folders or projects and can preserve dependencies for moves between installations. n8n documents the format as beta, so its structure and behavior may change. Keep a normal JSON export as an additional recovery path, pin the n8n version used for package creation where practical, and test package imports before making them your only migration method.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a complete restore requires

A Git repository containing workflow JSON cannot by itself recreate a working n8n installation. n8n identifies the database, configuration, encryption key, deployment environment variables, and external storage settings as part of complete recovery.

Restore sequence

  1. Recreate the deployment: restore the host or container definition, n8n version, network settings, volumes, and runtime environment variables.
  2. Restore the database: recover the database snapshot appropriate to your n8n deployment and verify that the instance starts against it.
  3. Restore configuration: restore the .n8n configuration or set the same N8N_ENCRYPTION_KEY used by the original instance.
  4. Restore external storage: reconnect any object storage, filesystem volume, or other external service required by nodes and binary-data settings.
  5. Import workflows: use the n8n CLI workflow import process or API to load the JSON files from the selected Git commit.
  6. Restore credentials: import the protected credential export only after the encryption key is present. The encryption key is required to restore credentials.
  7. Validate execution: check that workflow IDs and names are present, credentials resolve, schedules are enabled as intended, and representative workflows can complete a controlled test run.

Do not test restoration by overwriting production. Use an isolated instance or maintenance window, record the exact commit and database snapshot used, and document any manual steps that were needed.

Draft-versus-published policy

Write the policy before automating the job. A CLI export or API export may capture the records available from that interface, while built-in source control explicitly captures the saved version. These are not automatically the same as the version currently published for execution.

  • Draft protection: useful when Git is the authoritative development history and unfinished edits must be recoverable.
  • Published protection: useful when the objective is to reproduce production behavior, but it requires a process that identifies the published revision rather than simply exporting every saved record.
  • Both: keep the normal workflow export and record publication state in the inventory, or maintain separate development and production branches with clear ownership.

Whichever policy you choose, state it in the repository’s operating notes so a responder knows what a recovered file represents.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Scheduling, observability, and failure handling

Set a schedule tied to the recovery objective

Run the export often enough that the maximum acceptable loss of workflow edits is covered. A daily job is a starting point for many small installations; a team making frequent changes may choose an hourly or event-driven run. The correct interval depends on how quickly the organization must recover and how much change it can recreate manually.

Make failures visible

Have the scheduler fail when export, comparison, commit, or push fails. Send the failure to the same operational channel used for other infrastructure alerts. Record the n8n version, export timestamp, source instance, commit ID, and error output without recording tokens or credential values.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Prevent overlapping runs

Use a lock or scheduler concurrency limit so two exports cannot write the same checkout simultaneously. A second run that starts while the first is pushing can create a confusing race, duplicate commits, or a partially updated working tree.

Verify the remote after a successful push

A zero exit code from the local export does not prove that GitHub contains the new commit. Check that the push reached the intended repository and branch, and retain the resulting commit ID in the job log or inventory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting common failures

The job succeeds but Git shows no changes

Confirm that the command is connected to the intended n8n database and instance. Check the export path, file permissions, and whether the scheduler is running in a container with an empty volume. If the workflows really have not changed, a no-op is correct.

Old workflow files remain after deletion

The automation is probably only adding and updating files. Generate a complete file list on every run, remove paths absent from that list, and stage the deletions before the change test.

Every run creates a new commit

Inspect volatile metadata in the exported JSON. In the API implementation, normalize fields that change on read without changing behavior. In the CLI implementation, compare the actual generated files and check that line-ending or formatting changes are not being introduced by the scheduler environment.

Credentials fail after import

Verify that the original N8N_ENCRYPTION_KEY is restored exactly and that the protected credential export was not altered or exported in an incompatible form. n8n cannot decrypt credentials with a different key.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The restored workflow differs from what production ran

Check whether the repository captured a saved draft while production used a published revision. Review the inventory and publication policy, then select the commit or n8n revision that matches the recovery objective.

The repository contains sensitive values

Stop the push, restrict repository access, rotate exposed tokens, and remove the sensitive artifact according to your incident procedure. Deleting a file in a later commit does not erase it from Git history; history retention and credential rotation must be handled separately.

Operational checklist

  • Private repository created with an initial commit.
  • Workflow JSON stored as separate readable files.
  • Credential exports separated and protected.
  • GitHub token limited to the target repository.
  • Export runs from the correct n8n instance and configuration.
  • Changes, additions, renames, and deletions all update the repository tree.
  • No-op runs do not create commits.
  • Failures alert an owner and overlapping runs are prevented.
  • n8n version, branch, schedule, retention, environment-variable names, and restore owner are documented.
  • Database, deployment configuration, encryption key, and external storage are backed up separately.
  • A restore has been tested on an isolated instance, including credential decryption and representative workflow execution.

Recommended choice

For most self-hosted installations, implement the CLI export with ordinary Git first: it is transparent, easy to audit, and independent of an n8n workflow that might itself be unavailable during an outage. Add protected credential handling and a tested platform backup before calling the process disaster recovery.

Use the API and GitHub Data API when the job must live inside n8n or needs custom normalization and filtering. Use built-in source-control environments when your Business or Enterprise plan and team process require branch-based promotion, while explicitly accounting for their saved-versus-published behavior. Keep the beta package format as a portability tool rather than your sole backup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.