N8n cli import

From 8Dvibes/n8n-cli · View interactive version

N8n cli import is an AI agent skill from the GitHub repository 8Dvibes/n8n-cli. Import n8n workflow JSON with guided credential mapping. Resolves credential references during import. Use when loading workflows from files, repos, or other instances into n8n.

How to use this skill

Skill file

/n8n-import — Import n8n Workflow with Credential Mapping

Import a workflow JSON file into n8n with guided credential resolution.

Arguments

/n8n-import <path-to-workflow.json> — Import a workflow file

/n8n-import <path-to-workflow.json> --activate — Import and activate

Procedure

Step 1: Read and Analyze the Workflow

# Read the workflow file to understand what it needs
cat <file.json> | python3 -c "
import sys, json
wf = json.load(sys.stdin)
print(f\"Name: {wf.get('name', 'untitled')}\")
print(f\"Nodes: {len(wf.get('nodes', []))}\")
for n in wf.get('nodes', []):
    creds = n.get('credentials', {})
    if creds:
        for ctype, cref in creds.items():
            print(f\"  Needs: {ctype} -> {cref.get('name', 'unnamed')} (ID: {cref.get('id', 'none')})\")
"

Step 2: Map Credentials

# List available credentials on the target instance
n8n-cli credentials list --json

Compare credential types needed by the workflow against what's available.

For each credential gap:

  1. Tell the user which credential type is missing
  2. Suggest creating it in the n8n UI (Settings > Credentials)
  3. Offer to update the workflow JSON with the correct credential IDs after creation

Step 3: Update Credential References (if needed)

If the user provides credential mappings, update the JSON:

Step 4: Import

# Import (inactive by default)
n8n-cli workflows import <file.json>

# Or import and activate
n8n-cli workflows import <file.json> --activate

Step 5: Verify

n8n-cli workflows get <new-id>

Output

Report:

  1. Workflow name and ID
  2. Number of nodes imported
  3. Credential status (mapped / missing / needs manual setup)
  4. Active/inactive status
  5. Direct link: https://aibuildlab.app.n8n.cloud/workflow/<id>
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.