Restore and Recover n8n Credentials from Google Drive Backups with Duplication Protection

**This n8n workflow template uses community nodes and is only compatible with the self-hosted version of n8n.** ## **Restore n8n Credentials from Google Drive Backup** This template enables you to **restore your n8n credentials from a backup file in Google Drive**. It's an essential companion to a credential backup workflow, ensuring you can recover your setup in case of data loss, instance migration, or disaster recovery. The workflow **intelligently checks for existing credentials to prevent accidental overwrites of credentials** with the same name that are already present. This workflow is manually triggered. We recommend you use this restore workflow in conjunction with a backup solution like our [Auto Backup Credentials to Google Drive template](https://aiautomationpro.org/products/n8n-auto-backup-credentials-to-google-drive/). For more powerful n8n templates, visit our website or contact us at [**AI Automation Pro**](https://aiautomationpro.org/). We help your business build custom AI workflow automation and apps. ### Who is this for? This workflow is for n8n administrators and users who have backed up their n8n credentials to Google Drive (e.g., using a companion backup template) and need to restore them to the same or a different n8n instance. It's crucial for those managing self-hosted instances. ### What problem is this workflow solving? / use case If an n8n instance becomes corrupted, needs to be migrated, or if credentials are accidentally deleted, a manual re-creation of all credentials can be extremely time-consuming and error-prone. This workflow automates the restoration process from a known backup, saving significant time and ensuring accuracy. It's particularly useful for: - Disaster recovery. - Migrating n8n instances. - Quickly setting up a new n8n instance with existing credentials. ### What this workflow does The workflow is manually triggered and performs the following operations: 1. **Fetch Current Credentials:** - An On Click trigger starts the process. - It executes the command `npx n8n export:credentials --all --decrypted` via the Execute Command Get All Credentials node to get a list of all credentials currently in your n8n instance. - This list is then processed by JSON Formatting Data and Aggregate Credentials nodes to extract just the names of existing credentials for comparison. 2. **Download Backup File from Google Drive:** - The Google Drive Get Credentials File node searches your Google Drive for the `n8n_backup_credentials.json` file. - The Google Drive Download File node then downloads the found file. 3. **Process Backup Data:** - The Convert Files to JSON (an Extract From File node) converts the downloaded file content, expected to be JSON, into a usable JSON object. - Split Out nodes then process this data to handle individual credential entries from the backup file. 4. **Loop and Restore Credentials:** - The Loop Over Items (a SplitInBatches node) iterates through each credential from the backup file. - **Duplicate Check:** For each credential, an IF node (Check For Skipped Credentials) checks two conditions using an OR combinator: - If the credential name from the backup (`$(Loop Over Items).item.json.name`) is empty. - If a credential with the same name already exists in the current n8n instance (by checking against the list from the Aggregate Credentials node). - **Conditional Restore:** If the credential name is NOT empty AND it does NOT already exist (i.e., the conditions in the IF node are false), the workflow proceeds to the Restore N8n Credentials node (an n8n API node). This node uses the `name`, `type`, and `data` for each new credential from the backup file to create it in the n8n instance. Credentials with empty names or those already present are skipped as they take the true path of the IF node, which loops back. - A Wait node introduces a 1-second delay after each restoration attempt, to prevent API rate limiting before looping to the next item. ### Step-by-step setup 1. **n8n Instance Environment (for current credentials check):** - The n8n instance must have access to `npx` and `n8n-cli` for the Execute Command Get All Credentials node to function. 2. **Google Drive Credentials:** - Configure the Google Drive Get Credentials File and Google Drive Download File nodes with your Google OAuth2 credentials. 3. **n8n API Credentials:** - Configure the Restore N8n Credentials node with your n8n API credentials. This API key needs permissions to manage credentials. 4. **Backup File Name:** - The workflow is configured to search for a file named `n8n_backup_credentials.json` in the Google Drive Get Credentials File node. If your backup file has a different name or you want to specify a path, update the Query String parameter in this node. ### How to customize this workflow to your needs * **Backup**

n8n
Restore and Recover n8n Credentials from Google Drive Backups with Duplication Protection
$9.99
Last updated September 5, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related Development & IT workflows

More from Daniel Ng

Need this deployed? We'll set it up for you.

Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.