Robust Workflow Importer and Credential Mapper - n8n Workflow

Use this powerful n8n workflow to seamlessly import n8n templates from files or remote n8n instances while automatically mapping or creating necessary credentials. Automate complex n8n node configuration.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

n8n Administrators: Individuals managing multiple n8n instances who need a reliable way to migrate configurations and n8n templates. DevOps Teams: Teams requiring automated, audited migration paths for production n8n workflow deployments.* Power Users: Those who frequently download and import n8n templates and want to streamline credential setup, avoiding manual updates for every n8n node.

Overview

Managing credentials across different environments is a major challenge when migrating n8n workflows. This advanced n8n workflow solves this by providing a user-friendly, multi-step interface for importing workflow JSON (either via file upload or remote n8n API pull) and ensuring all credential dependencies are met on the destination instance.

It dynamically extracts all required credentials from the imported n8n workflow and cross-references them with existing local credentials. Users are then presented with a custom form to select an existing credential or opt to create a new placeholder credential, which is marked with '⚠️' for easy post-import configuration. This ensures the newly imported n8n workflow is immediately functional, minimizing downtime and manual configuration of sensitive n8n node settings.

How it Works

The process begins with an n8n trigger, a Form Trigger asking the user for the workflow source (File Upload or Remote Instance).


  1. Source Input: Based on the choice, the automation either prompts for a file upload or retrieves a list of available n8n workflows from a configured remote n8n instance via the HTTP Request n8n node.

  2. Local Credential Export: Regardless of the source, the current n8n workflow exports all existing local credentials using the Execute Command n8n node (n8n export:credentials).

  3. Workflow Consolidation: The imported n8n workflow JSON is combined with the local credential list.

  4. Credential Dependency Extraction: The flow analyzes every n8n node in the imported n8n workflow to identify all required credentials (name, type, and ID).

  5. Mapping Interface: The Generate Credential Options code node dynamically creates a form, presenting the user with options for each required credential: map it to an existing local credential of the same type or select [create new].

  6. Credential Management: The flow splits the results:

Existing: If mapped, the local credential ID and name are retrieved.
New: If [create new] is chosen, an empty credential is created via the n8n API, flagged with '⚠️' in its name.

  1. Workflow Update: A Code n8n node iterates through the imported n8n workflow JSON and replaces the old credential references in every n8n node with the new local IDs and names.

  2. Final Import: The complete, updated n8n workflow JSON is imported into the local n8n instance using the n8n node, completing the migration of the n8n templates.

Installation Guide


  1. Import: Import this n8n workflow JSON into your target n8n instance.

  2. API Key Configuration: The n8n node (Create Workflow) requires an n8n API credential to interact with the local instance. Create one and map it to the respective credential fields within the Create Workflow node.

  3. Remote Instance Setup (If needed): Configure the Settings n8n node by providing a JSON array defining your remote n8n instances (name, API Key, and base URL).

  4. Activation: Ensure the n8n workflow is activated. Since the n8n trigger is a Form Trigger, you will interact with it via its execution URL.

Node Details

This complex n8n workflow relies on several specialized n8n nodes:

On form submission (Form Trigger): The starting n8n trigger. Presents the initial choice between File Upload or Remote Instance.
Settings (Set Node): Used to hardcode the connection details (API Key, Base URL) for potential remote n8n instances.
Get Workflows (HTTP Request): Fetches the list of all available n8n workflows from the chosen remote n8n instance.
Export Credentials (Execute Command): Executes a shell command (n8n export:credentials) to dump the decrypted list of all current local credentials. This is crucial for the mapping step of the n8n workflow.
Extract from File / Binary to JSON (Extract from File Node): Used to handle file inputs (for uploaded workflow JSON) and convert the binary output of the credential export command into structured JSON data.
Map Credentials (Form Node): Presents the dynamic multi-form to the user, allowing them to map required credentials from the source n8n workflow to existing credentials on the destination n8n instance.


  • Create Empty Credentials / Create Workflow (n8n Node): Utilizes the n8n API to programmatically create new credentials or upload the final, adjusted n8n workflow JSON.

Related n8n Workflows

Free

Nodes: 18 Nodes
Updated: December 26 2025
View all
Created by

Workflow Optimization Expert | Software Architect. Use my link to book an initial consultation for custom built workflows using n8n.

Featured*