{
  "name": "Load Selected n8n Workflow (Dynamic API)",
  "nodes": [
    {
      "parameters": {
        "formTitle": "N8n Workflow Loader",
        "formDescription": "Load select workflows from your chosen n8n instance. ",
        "formFields": {
          "values": [
            {
              "fieldName": "Choose A Mode",
              "fieldLabel": "Mode",
              "fieldType": "dropdown",
              "defaultValue": "Default",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Default"
                  },
                  {
                    "option": "Dynamic"
                  }
                ]
              },
              "requiredField": true
            }
          ]
        },
        "options": {
          "appendAttribution": false,
          "buttonLabel": "Find Workflows",
          "path": "migrate-dynamic-n8n-workflows",
          "customCss": ":root {\n\t--font-family: 'Open Sans', sans-serif;\n\t--font-weight-normal: 400;\n\t--font-weight-bold: 600;\n\t--font-size-body: 12px;\n\t--font-size-label: 14px;\n\t--font-size-test-notice: 12px;\n\t--font-size-input: 14px;\n\t--font-size-header: 20px;\n\t--font-size-paragraph: 14px;\n\t--font-size-link: 12px;\n\t--font-size-error: 12px;\n\t--font-size-html-h1: 28px;\n\t--font-size-html-h2: 20px;\n\t--font-size-html-h3: 16px;\n\t--font-size-html-h4: 14px;\n\t--font-size-html-h5: 12px;\n\t--font-size-html-h6: 10px;\n\t--font-size-subheader: 14px;\n\n\t/* Colors - Granite Marketing Dark Theme */\n\t--color-background: #171717;\n\t--color-test-notice-text: #fbbf24;\n\t--color-test-notice-bg: #1f1f1f;\n\t--color-test-notice-border: #404040;\n\t--color-card-bg: #1e1e1e;\n\t--color-card-border: #404040;\n\t--color-card-shadow: rgba(0, 0, 0, 0.3);\n\t--color-link: #a5a5a5;\n\t--color-header: #f5f5f5;\n\t--color-label: #d4d4d4;\n\t--color-input-border: #404040;\n\t--color-input-text: #e5e5e5;\n\t--color-focus-border: #4ade80;\n\t--color-submit-btn-bg: #4ade80;\n\t--color-submit-btn-text: #171717;\n\t--color-error: #f87171;\n\t--color-required: #4ade80;\n\t--color-clear-button-bg: #525252;\n\t--color-html-text: #d4d4d4;\n\t--color-html-link: #4ade80;\n\t--color-header-subtext: #a5a5a5;\n\n\t/* Border Radii - Matching Granite Marketing */\n\t--border-radius-card: 12px;\n\t--border-radius-input: 6px;\n\t--border-radius-clear-btn: 50%;\n\t--card-border-radius: 12px;\n\n\t/* Spacing */\n\t--padding-container-top: 24px;\n\t--padding-card: 24px;\n\t--padding-test-notice-vertical: 12px;\n\t--padding-test-notice-horizontal: 24px;\n\t--margin-bottom-card: 16px;\n\t--padding-form-input: 12px;\n\t--card-padding: 24px;\n\t--card-margin-bottom: 16px;\n\n\t/* Dimensions */\n\t--container-width: 448px;\n\t--submit-btn-height: 48px;\n\t--checkbox-size: 18px;\n\n\t/* Others */\n\t--box-shadow-card: 0px 4px 16px 0px var(--color-card-shadow);\n\t--opacity-placeholder: 0.5;\n}"
        }
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.4,
      "position": [
        -1504,
        320
      ],
      "id": "414365db-f0bb-4fbc-a61a-3dab2c000c88",
      "name": "On form submission",
      "webhookId": "9febeedc-e010-4cf0-84f4-57594aeb42a2"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "/**\n * Build an n8n-API-safe workflow payload\n * using a strict allowlist (NOT a denylist).\n */\n\n// --------------------\n// Helpers\n// --------------------\n\nfunction pick(obj, allowedKeys) {\n  if (!obj || typeof obj !== 'object') return {};\n  return Object.fromEntries(\n    Object.entries(obj).filter(([key]) => allowedKeys.includes(key))\n  );\n}\n\nfunction cleanNode(node) {\n  return {\n    id: node.id,\n    name: node.name,\n    type: node.type,\n    typeVersion: node.typeVersion,\n    position: node.position,\n    parameters: node.parameters ?? {},\n    credentials: node.credentials ?? {},\n    disabled: node.disabled ?? false,\n    notes: node.notes,\n    notesInFlow: node.notesInFlow,\n  };\n}\n\n// --------------------\n// ENTRY POINT\n// --------------------\n\nconst source = $json;\n\n// ---- Top-level allowlist ----\nconst workflow = {\n  name: source.name,\n  nodes: source.nodes.map(cleanNode),\n  connections: source.connections,\n  settings: {\n    \"saveExecutionProgress\": true,\n    \"saveManualExecutions\": true,\n    \"saveDataErrorExecution\": \"all\",\n    \"saveDataSuccessExecution\": \"all\",\n    \"executionTimeout\": 3600,\n    \"timezone\": \"America/New_York\",\n    \"executionOrder\": \"v1\",\n    \"callerPolicy\": \"workflowsFromSameOwner\",\n    \"callerIds\": \"14, 18, 23\",\n    \"timeSavedPerExecution\": 1,\n    \"availableInMCP\": false\n  }\n};\n\n// ---- Settings allowlist ----\nconst ALLOWED_SETTINGS = [\n  'timezone',\n  'executionTimeout',\n  'saveExecutionProgress',\n  'saveManualExecutions',\n  'errorWorkflowId',\n];\n\nif (source.settings) {\n  const cleanedSettings = pick(source.settings, ALLOWED_SETTINGS);\n  if (Object.keys(cleanedSettings).length > 0) {\n    workflow.settings = cleanedSettings;\n  }\n}\n\n// ---- Optional staticData ----\nif (source.staticData) {\n  workflow.staticData = source.staticData;\n}\n\nreturn workflow;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        3216,
        1136
      ],
      "id": "32bdb310-b735-4c67-9732-50cce94cee8f",
      "name": "Strip Incompatible API Fields"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "20678e33-3415-4d80-890c-752435182ddd",
              "leftValue": "={{ $json.isArchived }}",
              "rightValue": false,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.3,
      "position": [
        1424,
        1136
      ],
      "id": "825b6057-fbdc-4f15-9d22-30316612dae5",
      "name": "Filter Our Archived Items"
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        1872,
        1200
      ],
      "id": "94f8e97a-cff9-4534-9538-c1d0c1e7d7d6",
      "name": "Aggregate Workflows"
    },
    {
      "parameters": {
        "defineForm": "json",
        "jsonOutput": "=[\n  {\n    \"fieldLabel\": \"workflows\",\n    \"fieldType\": \"checkbox\",\n    \"fieldOptions\": {\n      \"values\": [\n        {{ $json.options }}\n      ]\n    }\n  }\n]\n",
        "options": {
          "formTitle": "Select Workflows",
          "buttonLabel": "Select Workflows",
          "customCss": ":root {\n\t--font-family: 'Open Sans', sans-serif;\n\t--font-weight-normal: 400;\n\t--font-weight-bold: 600;\n\t--font-size-body: 12px;\n\t--font-size-label: 14px;\n\t--font-size-test-notice: 12px;\n\t--font-size-input: 14px;\n\t--font-size-header: 20px;\n\t--font-size-paragraph: 14px;\n\t--font-size-link: 12px;\n\t--font-size-error: 12px;\n\t--font-size-html-h1: 28px;\n\t--font-size-html-h2: 20px;\n\t--font-size-html-h3: 16px;\n\t--font-size-html-h4: 14px;\n\t--font-size-html-h5: 12px;\n\t--font-size-html-h6: 10px;\n\t--font-size-subheader: 14px;\n\n\t/* Colors - Granite Marketing Dark Theme */\n\t--color-background: #171717;\n\t--color-test-notice-text: #fbbf24;\n\t--color-test-notice-bg: #1f1f1f;\n\t--color-test-notice-border: #404040;\n\t--color-card-bg: #1e1e1e;\n\t--color-card-border: #404040;\n\t--color-card-shadow: rgba(0, 0, 0, 0.3);\n\t--color-link: #a5a5a5;\n\t--color-header: #f5f5f5;\n\t--color-label: #d4d4d4;\n\t--color-input-border: #404040;\n\t--color-input-text: #e5e5e5;\n\t--color-focus-border: #4ade80;\n\t--color-submit-btn-bg: #4ade80;\n\t--color-submit-btn-text: #171717;\n\t--color-error: #f87171;\n\t--color-required: #4ade80;\n\t--color-clear-button-bg: #525252;\n\t--color-html-text: #d4d4d4;\n\t--color-html-link: #4ade80;\n\t--color-header-subtext: #a5a5a5;\n\n\t/* Border Radii - Matching Granite Marketing */\n\t--border-radius-card: 12px;\n\t--border-radius-input: 6px;\n\t--border-radius-clear-btn: 50%;\n\t--card-border-radius: 12px;\n\n\t/* Spacing */\n\t--padding-container-top: 24px;\n\t--padding-card: 24px;\n\t--padding-test-notice-vertical: 12px;\n\t--padding-test-notice-horizontal: 24px;\n\t--margin-bottom-card: 16px;\n\t--padding-form-input: 12px;\n\t--card-padding: 24px;\n\t--card-margin-bottom: 16px;\n\n\t/* Dimensions */\n\t--container-width: 448px;\n\t--submit-btn-height: 48px;\n\t--checkbox-size: 18px;\n\n\t/* Others */\n\t--box-shadow-card: 0px 4px 16px 0px var(--color-card-shadow);\n\t--opacity-placeholder: 0.5;\n}\n\n.multiselect {\n  max-height: 300px;\n  overflow: scroll;\n}"
        }
      },
      "type": "n8n-nodes-base.form",
      "typeVersion": 2.4,
      "position": [
        2320,
        1200
      ],
      "id": "d2f0afdd-b0b1-413a-8701-7bdde6c5c57e",
      "name": "Select Workflows",
      "webhookId": "d6923eb5-f79c-4d3f-8108-9ba7bdb79a2b"
    },
    {
      "parameters": {
        "mode": "combine",
        "advanced": true,
        "mergeByFields": {
          "values": [
            {
              "field1": "name",
              "field2": "workflows"
            }
          ]
        },
        "outputDataFrom": "input1",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        2768,
        1136
      ],
      "id": "c919a8ea-89b0-4e20-82b3-cc789c8b323c",
      "name": "Select Matching Workflows"
    },
    {
      "parameters": {
        "fieldToSplitOut": "workflows",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        2544,
        1200
      ],
      "id": "e1713e37-cc19-4bf1-a3a7-79c5547c052f",
      "name": "Split Out Workflows"
    },
    {
      "parameters": {
        "jsCode": "const data = $input.first().json.data;\n\nconst options = data\n  .map(item => `{\n  \"option\": \"${item.workflow_name}\"}`)\n  .join(\",\");\n\nreturn {\n  json: {\n    options,\n  },\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2096,
        1200
      ],
      "id": "ab45dc71-c898-4918-aa29-bbc0a70b1c4b",
      "name": "Create JSON Workflow Options"
    },
    {
      "parameters": {
        "fieldToSplitOut": "data",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1200,
        1136
      ],
      "id": "e87b9bc3-f88e-4820-be50-e774e59afb32",
      "name": "Split Out"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json[\"Choose A Mode\"] }}",
                    "rightValue": "Default",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "f9af535e-1cd8-43dd-9285-4f8185632c76"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "default"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "b33acb3e-d4de-444b-8913-16c0b13d906b",
                    "leftValue": "={{ $json[\"Choose A Mode\"] }}",
                    "rightValue": "Dynamic",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "dynamic"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.4,
      "position": [
        -1280,
        320
      ],
      "id": "a408cb7c-ebd2-4101-b4ca-d2c51e8fdeba",
      "name": "Route Mode"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "/**\n * Build an n8n-API-safe workflow payload\n * using a strict allowlist (NOT a denylist).\n */\n\n// --------------------\n// Helpers\n// --------------------\n\nfunction pick(obj, allowedKeys) {\n  if (!obj || typeof obj !== 'object') return {};\n  return Object.fromEntries(\n    Object.entries(obj).filter(([key]) => allowedKeys.includes(key))\n  );\n}\n\nfunction cleanNode(node) {\n  return {\n    id: node.id,\n    name: node.name,\n    type: node.type,\n    typeVersion: node.typeVersion,\n    position: node.position,\n    parameters: node.parameters ?? {},\n    credentials: node.credentials ?? {},\n    disabled: node.disabled ?? false,\n    notes: node.notes,\n    notesInFlow: node.notesInFlow,\n  };\n}\n\n// --------------------\n// ENTRY POINT\n// --------------------\n\nconst source = $json;\n\n// ---- Top-level allowlist ----\nconst workflow = {\n  name: source.name,\n  nodes: source.nodes.map(cleanNode),\n  connections: source.connections,\n};\n\n// ---- Settings allowlist ----\nconst ALLOWED_SETTINGS = [\n  'timezone',\n  'executionTimeout',\n  'saveExecutionProgress',\n  'saveManualExecutions',\n  'errorWorkflowId',\n];\n\nif (source.settings) {\n  const cleanedSettings = pick(source.settings, ALLOWED_SETTINGS);\n  if (Object.keys(cleanedSettings).length > 0) {\n    workflow.settings = cleanedSettings;\n  }\n}\n\n// ---- Optional staticData ----\nif (source.staticData) {\n  workflow.staticData = source.staticData;\n}\n\nreturn workflow;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        960,
        144
      ],
      "id": "cb312746-0bc2-4cfe-8141-39a1acbfb7d3",
      "name": "Strip Incompatible API Fields1"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "20678e33-3415-4d80-890c-752435182ddd",
              "leftValue": "={{ $json.isArchived }}",
              "rightValue": false,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.3,
      "position": [
        -832,
        144
      ],
      "id": "0deef991-e5b1-45fc-99e5-6e0c290b2fa0",
      "name": "Filter Our Archived Items1"
    },
    {
      "parameters": {
        "defineForm": "json",
        "jsonOutput": "=[\n  {\n    \"fieldLabel\": \"workflows\",\n    \"fieldType\": \"checkbox\",\n    \"fieldOptions\": {\n      \"values\": [\n        {{ $json.options }}\n      ]\n    }\n  }\n]\n",
        "options": {
          "formTitle": "Select Workflows",
          "buttonLabel": "Select Workflows",
          "customCss": ":root {\n\t--font-family: 'Open Sans', sans-serif;\n\t--font-weight-normal: 400;\n\t--font-weight-bold: 600;\n\t--font-size-body: 12px;\n\t--font-size-label: 14px;\n\t--font-size-test-notice: 12px;\n\t--font-size-input: 14px;\n\t--font-size-header: 20px;\n\t--font-size-paragraph: 14px;\n\t--font-size-link: 12px;\n\t--font-size-error: 12px;\n\t--font-size-html-h1: 28px;\n\t--font-size-html-h2: 20px;\n\t--font-size-html-h3: 16px;\n\t--font-size-html-h4: 14px;\n\t--font-size-html-h5: 12px;\n\t--font-size-html-h6: 10px;\n\t--font-size-subheader: 14px;\n\n\t/* Colors - Granite Marketing Dark Theme */\n\t--color-background: #171717;\n\t--color-test-notice-text: #fbbf24;\n\t--color-test-notice-bg: #1f1f1f;\n\t--color-test-notice-border: #404040;\n\t--color-card-bg: #1e1e1e;\n\t--color-card-border: #404040;\n\t--color-card-shadow: rgba(0, 0, 0, 0.3);\n\t--color-link: #a5a5a5;\n\t--color-header: #f5f5f5;\n\t--color-label: #d4d4d4;\n\t--color-input-border: #404040;\n\t--color-input-text: #e5e5e5;\n\t--color-focus-border: #4ade80;\n\t--color-submit-btn-bg: #4ade80;\n\t--color-submit-btn-text: #171717;\n\t--color-error: #f87171;\n\t--color-required: #4ade80;\n\t--color-clear-button-bg: #525252;\n\t--color-html-text: #d4d4d4;\n\t--color-html-link: #4ade80;\n\t--color-header-subtext: #a5a5a5;\n\n\t/* Border Radii - Matching Granite Marketing */\n\t--border-radius-card: 12px;\n\t--border-radius-input: 6px;\n\t--border-radius-clear-btn: 50%;\n\t--card-border-radius: 12px;\n\n\t/* Spacing */\n\t--padding-container-top: 24px;\n\t--padding-card: 24px;\n\t--padding-test-notice-vertical: 12px;\n\t--padding-test-notice-horizontal: 24px;\n\t--margin-bottom-card: 16px;\n\t--padding-form-input: 12px;\n\t--card-padding: 24px;\n\t--card-margin-bottom: 16px;\n\n\t/* Dimensions */\n\t--container-width: 448px;\n\t--submit-btn-height: 48px;\n\t--checkbox-size: 18px;\n\n\t/* Others */\n\t--box-shadow-card: 0px 4px 16px 0px var(--color-card-shadow);\n\t--opacity-placeholder: 0.5;\n}\n\n.multiselect {\n  max-height: 300px;\n  overflow: scroll;\n}"
        }
      },
      "type": "n8n-nodes-base.form",
      "typeVersion": 2.4,
      "position": [
        64,
        224
      ],
      "id": "d1336a70-e981-4237-974d-ed1f8c12e356",
      "name": "Select Workflows1",
      "webhookId": "ef927f26-9ac5-4967-b812-7dbe8df9db45"
    },
    {
      "parameters": {
        "mode": "combine",
        "advanced": true,
        "mergeByFields": {
          "values": [
            {
              "field1": "name",
              "field2": "workflows"
            }
          ]
        },
        "outputDataFrom": "input1",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        512,
        144
      ],
      "id": "cfca096f-71dd-455a-bdcf-12a637594ee2",
      "name": "Select Matching Workflows1"
    },
    {
      "parameters": {
        "fieldToSplitOut": "workflows",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        288,
        224
      ],
      "id": "0081a07b-68a7-4022-8933-5a4bd708a15b",
      "name": "Split Out Workflows1"
    },
    {
      "parameters": {
        "jsCode": "const data = $input.first().json.data;\n\nconst options = data\n  .map(item => `{\n  \"option\": \"${item.workflow_name}\"}`)\n  .join(\",\");\n\nreturn {\n  json: {\n    options,\n  },\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -160,
        224
      ],
      "id": "0d2abeb8-1973-4004-983d-c6ad519fbd33",
      "name": "Create JSON Workflow Options1"
    },
    {
      "parameters": {
        "resource": "databasePage",
        "operation": "getAll",
        "databaseId": {
          "__rl": true,
          "value": "306785c0-cfab-80a8-9236-f9c9b14042b5",
          "mode": "list",
          "cachedResultName": "Granite n8n Keys",
          "cachedResultUrl": "https://www.notion.so/306785c0cfab80a89236f9c9b14042b5"
        },
        "returnAll": true,
        "options": {}
      },
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2.2,
      "position": [
        -1040,
        1136
      ],
      "id": "39db5553-77e5-4a12-9b98-716d16bcb445",
      "name": "Get Instance Information",
      "credentials": {
        "notionApi": {
          "id": "i9koSu1TWLJJkhIS",
          "name": "Stephen Notion account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const data = $input.first().json.data;\n\nconst options = data\n  .map(item => `{\n  \"option\": \"${item.workflow_name}\"}`)\n  .join(\",\");\n\nreturn {\n  json: {\n    options,\n  },\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -352,
        1360
      ],
      "id": "29e48900-5423-45eb-bfb4-d4fa68ae2f14",
      "name": "Create JSON Workflow Options2"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "0e1b7526-faf5-4001-ba27-3005836cc58f",
              "name": "workflow_name",
              "value": "={{ $json.name }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -800,
        1360
      ],
      "id": "fe306b93-ef43-496d-bb74-d8d4b4a5a778",
      "name": "Set Source Name and URL"
    },
    {
      "parameters": {
        "defineForm": "json",
        "jsonOutput": "=[\n  {\n    \"fieldLabel\": \"source\",\n    \"fieldType\": \"dropdown\",\n    \"fieldOptions\": {\n      \"values\": [\n        {{ $json.options }}\n      ]\n    }\n  },\n  {\n    \"fieldLabel\": \"target\",\n    \"fieldType\": \"dropdown\",\n    \"fieldOptions\": {\n      \"values\": [\n        {{ $json.options }}\n      ]\n    }\n  }\n]\n",
        "options": {
          "formTitle": "Select Source Instance",
          "buttonLabel": "Select Source Instance",
          "customCss": ":root {\n\t--font-family: 'Open Sans', sans-serif;\n\t--font-weight-normal: 400;\n\t--font-weight-bold: 600;\n\t--font-size-body: 12px;\n\t--font-size-label: 14px;\n\t--font-size-test-notice: 12px;\n\t--font-size-input: 14px;\n\t--font-size-header: 20px;\n\t--font-size-paragraph: 14px;\n\t--font-size-link: 12px;\n\t--font-size-error: 12px;\n\t--font-size-html-h1: 28px;\n\t--font-size-html-h2: 20px;\n\t--font-size-html-h3: 16px;\n\t--font-size-html-h4: 14px;\n\t--font-size-html-h5: 12px;\n\t--font-size-html-h6: 10px;\n\t--font-size-subheader: 14px;\n\n\t/* Colors - Granite Marketing Dark Theme */\n\t--color-background: #171717;\n\t--color-test-notice-text: #fbbf24;\n\t--color-test-notice-bg: #1f1f1f;\n\t--color-test-notice-border: #404040;\n\t--color-card-bg: #1e1e1e;\n\t--color-card-border: #404040;\n\t--color-card-shadow: rgba(0, 0, 0, 0.3);\n\t--color-link: #a5a5a5;\n\t--color-header: #f5f5f5;\n\t--color-label: #d4d4d4;\n\t--color-input-border: #404040;\n\t--color-input-text: #e5e5e5;\n\t--color-focus-border: #4ade80;\n\t--color-submit-btn-bg: #4ade80;\n\t--color-submit-btn-text: #171717;\n\t--color-error: #f87171;\n\t--color-required: #4ade80;\n\t--color-clear-button-bg: #525252;\n\t--color-html-text: #d4d4d4;\n\t--color-html-link: #4ade80;\n\t--color-header-subtext: #a5a5a5;\n\n\t/* Border Radii - Matching Granite Marketing */\n\t--border-radius-card: 12px;\n\t--border-radius-input: 6px;\n\t--border-radius-clear-btn: 50%;\n\t--card-border-radius: 12px;\n\n\t/* Spacing */\n\t--padding-container-top: 24px;\n\t--padding-card: 24px;\n\t--padding-test-notice-vertical: 12px;\n\t--padding-test-notice-horizontal: 24px;\n\t--margin-bottom-card: 16px;\n\t--padding-form-input: 12px;\n\t--card-padding: 24px;\n\t--card-margin-bottom: 16px;\n\n\t/* Dimensions */\n\t--container-width: 448px;\n\t--submit-btn-height: 48px;\n\t--checkbox-size: 18px;\n\n\t/* Others */\n\t--box-shadow-card: 0px 4px 16px 0px var(--color-card-shadow);\n\t--opacity-placeholder: 0.5;\n}\n\n.multiselect {\n  max-height: 300px;\n  overflow: scroll;\n}"
        }
      },
      "type": "n8n-nodes-base.form",
      "typeVersion": 2.4,
      "position": [
        -128,
        1360
      ],
      "id": "50c2da2f-7466-42ec-b821-4ca920396414",
      "name": "Select Workflows2",
      "webhookId": "d6923eb5-f79c-4d3f-8108-9ba7bdb79a2b"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a9355cc3-a088-47cb-a25b-2d6a7886efea",
              "name": "type",
              "value": "=source",
              "type": "string"
            },
            {
              "id": "03af0601-f7c7-48a9-96fe-27be9a08def5",
              "name": "name",
              "value": "={{ $json.name }}",
              "type": "string"
            },
            {
              "id": "851da7d5-da27-41fc-9dcb-8b85831518e3",
              "name": "url",
              "value": "={{ $json.property_url }}",
              "type": "string"
            },
            {
              "id": "bf6b054b-70c9-4639-8912-f0c3a0492a39",
              "name": "id",
              "value": "={{ $json.id }}",
              "type": "string"
            },
            {
              "id": "2a8178d4-e97c-48bb-9287-cdf5908f68e5",
              "name": "api_key",
              "value": "={{ $json.property_api_key }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        304,
        992
      ],
      "id": "290df874-e6f0-4ebb-8712-5e8b72f066fd",
      "name": "Set Source"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a9355cc3-a088-47cb-a25b-2d6a7886efea",
              "name": "type",
              "value": "=target",
              "type": "string"
            },
            {
              "id": "d65a1dab-d672-4e68-b282-57f876dfa91c",
              "name": "name",
              "value": "={{ $json.name }}",
              "type": "string"
            },
            {
              "id": "2bc3812b-f884-4e33-8647-e9876b836585",
              "name": "url",
              "value": "={{ $json.property_url }}",
              "type": "string"
            },
            {
              "id": "1bebcd7a-fbda-4c83-8512-db3f8c86bc74",
              "name": "id",
              "value": "={{ $json.id }}",
              "type": "string"
            },
            {
              "id": "9e23c106-67c2-43ed-a12a-adeae6650a23",
              "name": "api_key",
              "value": "={{ $json.property_api_key }}",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        304,
        1248
      ],
      "id": "4d933d73-4313-4ace-8106-6c9ffae8430c",
      "name": "Set Target"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        528,
        1136
      ],
      "id": "3587aff3-37b0-4269-82c0-08621aee9440",
      "name": "Merge Source and Target"
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        752,
        1136
      ],
      "id": "28b7f023-ae1a-4de9-9c7d-a8bd7b2340f4",
      "name": "Source and Target"
    },
    {
      "parameters": {
        "content": "## How it works 🧠 (Workflow explanation)\n\nThis workflow lets you selectively import workflows between n8n instances using the n8n API and forms.\n\nInstead of bulk imports or manual exports, it dynamically retrieves workflows from a source instance and lets you choose exactly what to load into a target instance.\n\n### Here’s what happens:\n1. The workflow retrieves workflows from a source n8n instance via the API.\n2. A dynamic form is generated listing available workflows.\n3. You select which workflows to import.\n4. Selected workflows are formatted for API compatibility.\n5. Workflows are created in the target n8n instance.\n\n### This ensures:\n- No bulk imports  \n- No accidental overwrites  \n- Full control over what gets moved  \n- Safe, API-driven workflow creation  \n\n## Setup steps ⚙️\n\n**Estimated setup time:** 2–5 minutes\n\n### Simple mode (default)\n1. Add API credentials for the source n8n instance.\n2. Add API credentials for the target n8n instance.\n3. Execute the workflow and select workflows to import.\n\n### Dynamic mode (optional)\n1. Connect a database (e.g. Notion or Supabase) containing:\n   - n8n instance URLs  \n   - n8n API keys  \n2. Select the source and target instances via the form.\n3. Choose which workflows to import and run.\n\nOnce credentials are connected, the workflow is ready to use 🚀",
        "height": 912,
        "width": 640
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2272,
        -384
      ],
      "id": "e81152b3-6806-4cdd-97d5-6df45be96409",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "mode": "combine",
        "advanced": true,
        "mergeByFields": {
          "values": [
            {
              "field1": "name",
              "field2": "source"
            }
          ]
        },
        "outputDataFrom": "input1",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        80,
        992
      ],
      "id": "aa97f607-1d01-471c-92ac-94e55d1aaaca",
      "name": "Merge Source Instance"
    },
    {
      "parameters": {
        "mode": "combine",
        "advanced": true,
        "mergeByFields": {
          "values": [
            {
              "field1": "name",
              "field2": "target"
            }
          ]
        },
        "outputDataFrom": "input1",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        80,
        1248
      ],
      "id": "313c8ba3-12f8-4c19-8be2-7e533a8ab0a0",
      "name": "Merge Target Instance"
    },
    {
      "parameters": {
        "content": "## 🔁 Mode selection (static vs dynamic)\n\nThis section determines how the source and target n8n instances are configured.\n\n**Simple mode**\n- Uses n8n API credentials configured directly in the workflow\n- Source and target instances are fixed\n- Fastest way to get started\n\n**Dynamic mode**\n- Loads instance URLs and API keys from an external database (e.g. Notion)\n- Lets you select source and target instances via a form\n- Ideal for managing multiple n8n instances securely\n\nBoth modes use the same import logic downstream; only the instance configuration differs.",
        "height": 624,
        "width": 544,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1616,
        -96
      ],
      "id": "1f9403cb-fec5-4f4e-b06d-af4af49d9b72",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Discover & Select Workflows (static mode)\n\nThis section retrieves workflows from the source n8n instance and prepares them for user selection.\n\n**What happens**\n- Fetches all available workflows via the n8n API\n- Filters out archived or inactive workflows\n- Aggregates results into a single list\n- Builds a dynamic selection form (JSON mode)\n\nYou then select exactly which workflows to import.  \nOnly selected workflows continue downstream.",
        "height": 576,
        "width": 1728,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -880,
        -176
      ],
      "id": "7590dc36-3de9-4e8f-b3c1-e806ff06566b",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Import & Clean Workflows\n\nThis section prepares selected workflows for safe import into the target n8n instance.\n\n**What happens**\n- Retrieves each selected workflow via the n8n API\n- Removes fields that are incompatible with workflow creation\n- Normalises the workflow structure for API import\n- Creates the workflow in the target instance\n\nThis ensures workflows are imported cleanly without conflicts or invalid metadata.",
        "height": 576,
        "width": 448,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        896,
        -176
      ],
      "id": "266c504c-152d-4a26-bd2a-8d69980a888c",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## Structure Success Message\n\nFormats the final result for each processed workflow by creating a clean summary showing whether each workflow was created or failed.",
        "height": 576,
        "width": 416,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1376,
        -176
      ],
      "id": "36ce80fb-b1ec-4f29-b9e4-0d2d983c4d90",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "content": "## Discover workflows\n\nThis section retrieves all workflows from the selected n8n instance.\n\nIt:\n- Calls the n8n `/api/v1/workflows` endpoint\n- Filters out archived workflows\n- Aggregates active workflows into a single list\n\nPagination is handled using a cursor-based approach, ensuring all workflows are retrieved even on large instances.",
        "height": 576,
        "width": 640,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        912,
        864
      ],
      "id": "081ae916-8888-436a-9dd3-ed45ff6d98d1",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "content": "## Select source and target instances (dynamic mode)\n\nThis section builds the final **Source and Target** payload by combining:\n\n- **Instance records** pulled from your database (e.g. Notion)\n- The user’s form selections (which instance is “source” and which is “target”)\n\n### What happens\n1. **Get Instance Information** loads all saved instances (URL + API key + display name).\n2. Two branches prepare each side:\n   - **Merge Source Instance → Set Source**\n   - **Merge Target Instance → Set Target**\n3. **Merge Source and Target** appends both objects into one array.\n4. **Source and Target** outputs a single structure used downstream to dynamically set:\n   - The base URL (instance URL)\n   - The API key header\n   - The instance role (`source` vs `target`)\n\n✅ Outcome: downstream nodes can reference the selected instances without hardcoding credentials in the workflow.\n⚠️ Keep API keys in a secure database, not inside n8n nodes or sticky notes.",
        "height": 928,
        "width": 1760,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1072,
        624
      ],
      "id": "76c30303-351e-48e3-81f4-3e2e8f7e30c5",
      "name": "Sticky Note5"
    },
    {
      "parameters": {
        "content": "## Select workflows\n\nBuilds a dynamic form that allows you to choose which workflows to import.\n\nIt:\n- Converts the discovered workflows into form options\n- Presents them using an n8n Form node\n- Passes only selected workflows downstream\n\nOnly workflows selected by the user continue to the import stage.",
        "height": 576,
        "width": 1520,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1600,
        864
      ],
      "id": "f493d528-77b1-4ef6-bfc8-b290348555d7",
      "name": "Sticky Note7"
    },
    {
      "parameters": {
        "content": "## Import & clean workflows\n\nThis section prepares selected workflows for safe import into the target n8n instance.\n\n**What happens**\n- Retrieves each selected workflow via the n8n API\n- Removes fields incompatible with workflow creation\n- Normalises the workflow structure for import\n- Creates the workflow in the target instance\n\nThis ensures workflows are imported cleanly without conflicts or invalid metadata.",
        "height": 656,
        "width": 448,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        3152,
        784
      ],
      "id": "7e413e9f-583e-4a13-a9b2-982af9dc2edc",
      "name": "Sticky Note8"
    },
    {
      "parameters": {
        "content": "## Structure success message\n\nFormats the final result for each processed workflow.\n\nCreates a clear summary showing whether each workflow was successfully created or failed, ensuring a consistent and easy-to-read output.",
        "height": 576,
        "width": 416,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        3632,
        864
      ],
      "id": "4f760b5e-5160-40b4-ba0b-5555d5340a37",
      "name": "Sticky Note9"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Source and Target').first().json.data.filter(item => item.type === 'target').map(item => item.url).toString() }}/api/v1/workflows",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-N8N-API-KEY",
              "value": "={{ $('Source and Target').first().json.data.filter(item => item.type === 'target').map(item => item.api_key).toString() }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ $json.toJsonString() }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        3440,
        1136
      ],
      "id": "23fb1ba2-f2ef-415d-b242-1fdd30bfff3d",
      "name": "Create Workflow(s)"
    },
    {
      "parameters": {
        "operation": "create",
        "workflowObject": "={{ $json.toJsonString() }}",
        "requestOptions": {}
      },
      "type": "n8n-nodes-base.n8n",
      "typeVersion": 1,
      "position": [
        1184,
        144
      ],
      "id": "88e497d6-e750-4459-b9f4-7034829ee3a8",
      "name": "Create Workflow(s)1",
      "credentials": {
        "n8nApi": {
          "id": "bwFt15fTGCe0JsbT",
          "name": "Stephen n8n account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "0e1b7526-faf5-4001-ba27-3005836cc58f",
              "name": "workflow_name",
              "value": "={{ $json.name }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1648,
        1200
      ],
      "id": "9bbe2872-4bc4-4e6f-a6d5-d76bbe5103e0",
      "name": "Set Workflow Display Name (Dynamic)"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "0e1b7526-faf5-4001-ba27-3005836cc58f",
              "name": "workflow_name",
              "value": "={{ $json.name }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -608,
        224
      ],
      "id": "5ce849fa-e09a-4dec-9924-d6899eaa8d22",
      "name": "Set Workflow Display Name (Static)"
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        3664,
        1136
      ],
      "id": "a583fd79-551e-463c-9057-a4ce273533a3",
      "name": "Aggregate Workflows (Dynamic)"
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        1408,
        144
      ],
      "id": "d6e06702-4767-4245-84d8-994da8f7f60d",
      "name": "Aggregate Workflows (Static)"
    },
    {
      "parameters": {
        "operation": "completion",
        "completionTitle": "Results",
        "completionMessage": "={{ $json.data.map(item =>\n`${item.is_empty === true ? item.name + ' - Failed ❌' : item.name + ' - Success! ✅'}`\n).join('\\n\\n') }}",
        "options": {
          "customCss": ":root {\n\t--font-family: 'Open Sans', sans-serif;\n\t--font-weight-normal: 400;\n\t--font-weight-bold: 600;\n\t--font-size-body: 12px;\n\t--font-size-label: 14px;\n\t--font-size-test-notice: 12px;\n\t--font-size-input: 14px;\n\t--font-size-header: 20px;\n\t--font-size-paragraph: 14px;\n\t--font-size-link: 12px;\n\t--font-size-error: 12px;\n\t--font-size-html-h1: 28px;\n\t--font-size-html-h2: 20px;\n\t--font-size-html-h3: 16px;\n\t--font-size-html-h4: 14px;\n\t--font-size-html-h5: 12px;\n\t--font-size-html-h6: 10px;\n\t--font-size-subheader: 14px;\n\n\t/* Colors - Granite Marketing Dark Theme */\n\t--color-background: #171717;\n\t--color-test-notice-text: #fbbf24;\n\t--color-test-notice-bg: #1f1f1f;\n\t--color-test-notice-border: #404040;\n\t--color-card-bg: #1e1e1e;\n\t--color-card-border: #404040;\n\t--color-card-shadow: rgba(0, 0, 0, 0.3);\n\t--color-link: #a5a5a5;\n\t--color-header: #f5f5f5;\n\t--color-label: #d4d4d4;\n\t--color-input-border: #404040;\n\t--color-input-text: #e5e5e5;\n\t--color-focus-border: #4ade80;\n\t--color-submit-btn-bg: #4ade80;\n\t--color-submit-btn-text: #171717;\n\t--color-error: #f87171;\n\t--color-required: #4ade80;\n\t--color-clear-button-bg: #525252;\n\t--color-html-text: #d4d4d4;\n\t--color-html-link: #4ade80;\n\t--color-header-subtext: #a5a5a5;\n\n\t/* Border Radii - Matching Granite Marketing */\n\t--border-radius-card: 12px;\n\t--border-radius-input: 6px;\n\t--border-radius-clear-btn: 50%;\n\t--card-border-radius: 12px;\n\n\t/* Spacing */\n\t--padding-container-top: 24px;\n\t--padding-card: 24px;\n\t--padding-test-notice-vertical: 12px;\n\t--padding-test-notice-horizontal: 24px;\n\t--margin-bottom-card: 16px;\n\t--padding-form-input: 12px;\n\t--card-padding: 24px;\n\t--card-margin-bottom: 16px;\n\n\t/* Dimensions */\n\t--container-width: 448px;\n\t--submit-btn-height: 48px;\n\t--checkbox-size: 18px;\n\n\t/* Others */\n\t--box-shadow-card: 0px 4px 16px 0px var(--color-card-shadow);\n\t--opacity-placeholder: 0.5;\n}\n\n.multiselect {\n  max-height: 300px;\n  overflow: scroll;\n}"
        }
      },
      "type": "n8n-nodes-base.form",
      "typeVersion": 2.4,
      "position": [
        3888,
        1136
      ],
      "id": "6ad71500-d0a6-4011-9ce5-8d4dbb4ec6e9",
      "name": "Results (Dynamic)",
      "webhookId": "50111f86-1e6e-44f9-9d76-8add726b5668"
    },
    {
      "parameters": {
        "operation": "completion",
        "completionTitle": "Results",
        "completionMessage": "={{ $json.data.map(item =>\n`${item.is_empty === true ? item.name + ' - Failed ❌' : item.name + ' - Success! ✅'}`\n).join('\\n\\n') }}",
        "options": {
          "customCss": ":root {\n\t--font-family: 'Open Sans', sans-serif;\n\t--font-weight-normal: 400;\n\t--font-weight-bold: 600;\n\t--font-size-body: 12px;\n\t--font-size-label: 14px;\n\t--font-size-test-notice: 12px;\n\t--font-size-input: 14px;\n\t--font-size-header: 20px;\n\t--font-size-paragraph: 14px;\n\t--font-size-link: 12px;\n\t--font-size-error: 12px;\n\t--font-size-html-h1: 28px;\n\t--font-size-html-h2: 20px;\n\t--font-size-html-h3: 16px;\n\t--font-size-html-h4: 14px;\n\t--font-size-html-h5: 12px;\n\t--font-size-html-h6: 10px;\n\t--font-size-subheader: 14px;\n\n\t/* Colors - Granite Marketing Dark Theme */\n\t--color-background: #171717;\n\t--color-test-notice-text: #fbbf24;\n\t--color-test-notice-bg: #1f1f1f;\n\t--color-test-notice-border: #404040;\n\t--color-card-bg: #1e1e1e;\n\t--color-card-border: #404040;\n\t--color-card-shadow: rgba(0, 0, 0, 0.3);\n\t--color-link: #a5a5a5;\n\t--color-header: #f5f5f5;\n\t--color-label: #d4d4d4;\n\t--color-input-border: #404040;\n\t--color-input-text: #e5e5e5;\n\t--color-focus-border: #4ade80;\n\t--color-submit-btn-bg: #4ade80;\n\t--color-submit-btn-text: #171717;\n\t--color-error: #f87171;\n\t--color-required: #4ade80;\n\t--color-clear-button-bg: #525252;\n\t--color-html-text: #d4d4d4;\n\t--color-html-link: #4ade80;\n\t--color-header-subtext: #a5a5a5;\n\n\t/* Border Radii - Matching Granite Marketing */\n\t--border-radius-card: 12px;\n\t--border-radius-input: 6px;\n\t--border-radius-clear-btn: 50%;\n\t--card-border-radius: 12px;\n\n\t/* Spacing */\n\t--padding-container-top: 24px;\n\t--padding-card: 24px;\n\t--padding-test-notice-vertical: 12px;\n\t--padding-test-notice-horizontal: 24px;\n\t--margin-bottom-card: 16px;\n\t--padding-form-input: 12px;\n\t--card-padding: 24px;\n\t--card-margin-bottom: 16px;\n\n\t/* Dimensions */\n\t--container-width: 448px;\n\t--submit-btn-height: 48px;\n\t--checkbox-size: 18px;\n\n\t/* Others */\n\t--box-shadow-card: 0px 4px 16px 0px var(--color-card-shadow);\n\t--opacity-placeholder: 0.5;\n}\n\n.multiselect {\n  max-height: 300px;\n  overflow: scroll;\n}"
        }
      },
      "type": "n8n-nodes-base.form",
      "typeVersion": 2.4,
      "position": [
        1632,
        144
      ],
      "id": "6ee57cda-2a89-4095-adf0-c86f15eabced",
      "name": "Results (Static)",
      "webhookId": "d8aa349e-f077-43a8-984e-9e830d680f11"
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        -384,
        224
      ],
      "id": "6bbb950a-08a2-4a55-b210-ad4306f7f600",
      "name": "Aggregate Workflow Options (Static)"
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        -576,
        1360
      ],
      "id": "abdd0e91-b796-4448-a258-e34fee9b7543",
      "name": "Aggregate Workflow Options (Dynamic)"
    },
    {
      "parameters": {
        "filters": {},
        "requestOptions": {}
      },
      "type": "n8n-nodes-base.n8n",
      "typeVersion": 1,
      "position": [
        -1056,
        144
      ],
      "id": "8c78bada-c093-48d7-a66b-0172ae9578e8",
      "name": "Get All Source Instance Workflows",
      "credentials": {
        "n8nApi": {
          "id": "bwFt15fTGCe0JsbT",
          "name": "Stephen n8n account"
        }
      }
    },
    {
      "parameters": {
        "url": "={{ $('Source and Target').first().json.data.filter(item => item.type === 'source').map(item => item.url).toString() }}/api/v1/workflows",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-N8N-API-KEY",
              "value": "={{ $('Source and Target').first().json.data.filter(item => item.type === 'source').map(item => item.api_key).toString() }}"
            }
          ]
        },
        "options": {
          "pagination": {
            "pagination": {
              "parameters": {
                "parameters": [
                  {
                    "name": "cursor",
                    "value": "={{ $response.body.nextCursor }}"
                  }
                ]
              },
              "paginationCompleteWhen": "receiveSpecificStatusCodes",
              "statusCodesWhenComplete": "400",
              "requestInterval": 1000
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        976,
        1136
      ],
      "id": "aeb77c8c-caa9-4ec0-aca4-9df3d94c0800",
      "name": "Get Source Workflows With Pagination"
    },
    {
      "parameters": {
        "operation": "get",
        "workflowId": {
          "__rl": true,
          "value": "={{ $('Select Matching Workflows1').item.json.id }}",
          "mode": "id"
        },
        "requestOptions": {}
      },
      "type": "n8n-nodes-base.n8n",
      "typeVersion": 1,
      "position": [
        736,
        144
      ],
      "id": "1b80098e-71c0-4e25-a270-cd0834d20a6a",
      "name": "Get Workflow JSON(s)",
      "credentials": {
        "n8nApi": {
          "id": "bwFt15fTGCe0JsbT",
          "name": "Stephen n8n account"
        }
      }
    },
    {
      "parameters": {
        "url": "={{ $('Source and Target').first().json.data.filter(item => item.type === 'source').map(item => item.url).toString() }}/api/v1/workflows/{{ $('Select Matching Workflows').item.json.id }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-N8N-API-KEY",
              "value": "={{ $('Source and Target').first().json.data.filter(item => item.type === 'source').map(item => item.api_key).toString() }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        2992,
        1136
      ],
      "id": "bb3947af-344d-4b9c-8387-6942d6abdfcd",
      "name": "Get Workflow JSON(s)1"
    }
  ],
  "pinData": {
    "On form submission": [
      {
        "json": {
          "Choose A Mode": "Dynamic",
          "submittedAt": "2026-02-16T09:19:37.843-05:00",
          "formMode": "production"
        },
        "pairedItem": {
          "item": 0
        }
      }
    ]
  },
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "Route Mode",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow": {
      "main": [
        [
          {
            "node": "Limit1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Strip Incompatible API Fields": {
      "main": [
        [
          {
            "node": "Create Workflow(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Our Archived Items": {
      "main": [
        [
          {
            "node": "Set Workflow Display Name (Dynamic)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Select Matching Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Workflows": {
      "main": [
        [
          {
            "node": "Create JSON Workflow Options",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Workflows": {
      "main": [
        [
          {
            "node": "Split Out Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Matching Workflows": {
      "main": [
        [
          {
            "node": "Get Workflow JSON(s)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Workflows": {
      "main": [
        [
          {
            "node": "Select Matching Workflows",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Create JSON Workflow Options": {
      "main": [
        [
          {
            "node": "Select Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Mode": {
      "main": [
        [
          {
            "node": "Get All Source Instance Workflows",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Instance Information",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Filter Our Archived Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Strip Incompatible API Fields1": {
      "main": [
        [
          {
            "node": "Create Workflow(s)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Our Archived Items1": {
      "main": [
        [
          {
            "node": "Set Workflow Display Name (Static)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Select Matching Workflows1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Workflows1": {
      "main": [
        [
          {
            "node": "Split Out Workflows1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Matching Workflows1": {
      "main": [
        [
          {
            "node": "Get Workflow JSON(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Workflows1": {
      "main": [
        [
          {
            "node": "Select Matching Workflows1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Create JSON Workflow Options1": {
      "main": [
        [
          {
            "node": "Select Workflows1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Instance Information": {
      "main": [
        [
          {
            "node": "Set Source Name and URL",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Target Instance",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Source Instance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Source Name and URL": {
      "main": [
        [
          {
            "node": "Aggregate Workflow Options (Dynamic)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create JSON Workflow Options2": {
      "main": [
        [
          {
            "node": "Select Workflows2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Workflows2": {
      "main": [
        [
          {
            "node": "Merge Source Instance",
            "type": "main",
            "index": 1
          },
          {
            "node": "Merge Target Instance",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Set Source": {
      "main": [
        [
          {
            "node": "Merge Source and Target",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Target": {
      "main": [
        [
          {
            "node": "Merge Source and Target",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge Source and Target": {
      "main": [
        [
          {
            "node": "Source and Target",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Source and Target": {
      "main": [
        [
          {
            "node": "Get Source Workflows With Pagination",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Source Instance": {
      "main": [
        [
          {
            "node": "Set Source",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Target Instance": {
      "main": [
        [
          {
            "node": "Set Target",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Workflow(s)": {
      "main": [
        [
          {
            "node": "Aggregate Workflows (Dynamic)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Workflow(s)1": {
      "main": [
        [
          {
            "node": "Aggregate Workflows (Static)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Workflow Display Name (Dynamic)": {
      "main": [
        [
          {
            "node": "Aggregate Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Workflow Display Name (Static)": {
      "main": [
        [
          {
            "node": "Aggregate Workflow Options (Static)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Workflows (Dynamic)": {
      "main": [
        [
          {
            "node": "Results (Dynamic)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Workflows (Static)": {
      "main": [
        [
          {
            "node": "Results (Static)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Results (Dynamic)": {
      "main": [
        []
      ]
    },
    "Aggregate Workflow Options (Static)": {
      "main": [
        [
          {
            "node": "Create JSON Workflow Options1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Workflow Options (Dynamic)": {
      "main": [
        [
          {
            "node": "Create JSON Workflow Options2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Source Instance Workflows": {
      "main": [
        [
          {
            "node": "Filter Our Archived Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Source Workflows With Pagination": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Workflow JSON(s)": {
      "main": [
        [
          {
            "node": "Strip Incompatible API Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Workflow JSON(s)1": {
      "main": [
        [
          {
            "node": "Strip Incompatible API Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false,
    "timeSavedMode": "fixed",
    "errorWorkflow": "UisvlfUaFcbSJoN4",
    "binaryMode": "separate",
    "timeSavedPerExecution": 5
  },
  "versionId": "51c9d280-c0c3-4e3f-9f03-6de9cedd442d",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "91ff29cf289b94d2caa8a7a4821e53d150affc29af69fb5d8a62fce13e322667"
  },
  "id": "mCjdyaObrYiNmI4Q",
  "tags": [
    {
      "updatedAt": "2026-02-10T16:54:20.430Z",
      "createdAt": "2026-02-10T16:54:20.430Z",
      "id": "WiPfwUZYcO7Er2qC",
      "name": "Template"
    }
  ]
}