{
  "name": "Transfer credentials to other n8n instances using a multi-form",
  "nodes": [
    {
      "id": "9bb3fd8d-cead-4325-9c77-2c1d203ac805",
      "name": "Success",
      "type": "n8n-nodes-base.form",
      "position": [
        680,
        300
      ]
    },
    {
      "id": "0c90e8d6-3230-4139-a625-e8656fe1c4d9",
      "name": "Error",
      "type": "n8n-nodes-base.form",
      "position": [
        680,
        460
      ]
    },
    {
      "id": "050bb8b6-faf5-4190-a727-986d7fe6b28a",
      "name": "Create Credential",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        460,
        340
      ]
    },
    {
      "id": "17072ec2-526c-49b4-8384-e9ca347b8748",
      "name": "Get Instance Names",
      "type": "n8n-nodes-base.code",
      "position": [
        680,
        -240
      ]
    },
    {
      "id": "27fdd4c4-5c39-497b-91b3-e468b20e8f8c",
      "name": "Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        460,
        -240
      ]
    },
    {
      "id": "76b7d9d2-c919-42a6-8724-8771d9415e3e",
      "name": "Export Credentials",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        240,
        40
      ]
    },
    {
      "id": "b5f53aa1-ccf6-43b0-9f4c-cfc52f99aabf",
      "name": "Get Credentials Data",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        460,
        40
      ]
    },
    {
      "id": "16fdae2d-f3e6-4030-859a-ecba74dfe4c2",
      "name": "Binary to JSON",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        680,
        40
      ]
    },
    {
      "id": "3d590285-e82c-4754-8618-2a52fcda6253",
      "name": "Get Credential Names",
      "type": "n8n-nodes-base.code",
      "position": [
        900,
        40
      ]
    },
    {
      "id": "21615934-6834-4b4e-b521-942a24f64388",
      "name": "Choose Instance",
      "type": "n8n-nodes-base.form",
      "position": [
        900,
        -240
      ]
    },
    {
      "id": "d36a41c4-6ed3-4939-8562-e3f50ffcd72b",
      "name": "Choose Credential",
      "type": "n8n-nodes-base.form",
      "position": [
        1120,
        40
      ]
    },
    {
      "id": "4391f0d9-3ed5-4e2b-a761-ab7bf41959f1",
      "name": "Prepare Request Data",
      "type": "n8n-nodes-base.code",
      "position": [
        240,
        340
      ]
    },
    {
      "id": "571cd727-218b-4a5d-97fe-a8dcbcf15cce",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -340
      ],
      "parameters": {
        "width": 216.47293010628914,
        "height": 255.86856541619233,
        "content": "## Setup instances\nEach instnce requires a name, apiKey and baseURL"
      }
    },
    {
      "id": "7f717bed-fac5-4b1e-acc7-a6ad9d1c4be4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -340
      ],
      "parameters": {
        "width": 527.8711162255479,
        "height": 223.19907940161124,
        "content": "## Instances config example\n```\n[\n  {\n    \"name\": \"n8n-test\",\n    \"apiKey\": \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"baseUrl\": \"https://n8n-test.example.com/api/v1\"\n  },\n  {\n    ...\n  }\n]\n```"
      }
    },
    {
      "id": "5e27ad60-7e65-452d-8c33-56c6c85911d3",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -340
      ],
      "parameters": {
        "width": 216.47293010628914,
        "height": 255.86856541619233,
        "content": "A form with no input fields initiates the process.\n*Consider securing the form using Basic Auth.*"
      }
    },
    {
      "id": "0b69effa-44e4-41e1-bb5d-934ed19b8488",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -60
      ],
      "parameters": {
        "width": 655.5152156976209,
        "height": 255.86856541619233,
        "content": "Credentials are being fetched using the cmd tools, since there is no API endpoint available for this. The data is then converted into a JSON object."
      }
    },
    {
      "id": "a0f83646-dcf3-4893-bca0-a2b0ec4942b6",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        -340
      ],
      "parameters": {
        "width": 435.9715408127852,
        "height": 255.86856541619233,
        "content": "A list of the instance names is being extracted from the settings and used as dynamic options for the dropdown in a new form page."
      }
    },
    {
      "id": "78611a9e-5949-44c4-af23-78e8f689de2b",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        -60
      ],
      "parameters": {
        "width": 435.9715408127852,
        "height": 255.86856541619233,
        "content": "A list of the credential names is being extracted from the settings and used as dynamic options for the dropdown in a new form page."
      }
    },
    {
      "id": "23e9b0ea-f6a7-4072-8e87-292ba432a24d",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        240
      ],
      "parameters": {
        "width": 216.47293010628914,
        "height": 255.86856541619233,
        "content": "Based on the selections made by the user, the necessary data is being provided."
      }
    },
    {
      "id": "f13a3bce-d92d-4e2c-bb63-b37c4aa89b9b",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        240
      ],
      "parameters": {
        "width": 216.47293010628914,
        "height": 255.86856541619233,
        "content": "The credential data is being transferred to the selected instance based using dynamic authentication"
      }
    },
    {
      "id": "1788ed42-44be-41c3-8a45-3d8c74925ded",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        240
      ],
      "parameters": {
        "width": 216.47293010628914,
        "height": 376.16893354714523,
        "content": "Display a confirmation/error message to the user"
      }
    },
    {
      "id": "58cbb873-906e-4215-b501-4a1b31fdcbd9",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        240,
        -240
      ]
    }
  ],
  "connections": {
    "Settings": {
      "main": [
        [
          {
            "node": "Get Instance Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Binary to JSON": {
      "main": [
        [
          {
            "node": "Get Credential Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Choose Instance": {
      "main": [
        [
          {
            "node": "Export Credentials",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Choose Credential": {
      "main": [
        [
          {
            "node": "Prepare Request Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Credential": {
      "main": [
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Export Credentials": {
      "main": [
        [
          {
            "node": "Get Credentials Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Instance Names": {
      "main": [
        [
          {
            "node": "Choose Instance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Credential Names": {
      "main": [
        [
          {
            "node": "Choose Credential",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Credentials Data": {
      "main": [
        [
          {
            "node": "Binary to JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Request Data": {
      "main": [
        [
          {
            "node": "Create Credential",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}