{
  "name": "Selectively import workflows from GitHub, including nested folders",
  "nodes": [
    {
      "id": "24c3218c-60f2-479b-9b33-e937ed02a66c",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        208,
        960
      ]
    },
    {
      "id": "f7b064a7-6d45-4c71-81ad-2864dbe0ead6",
      "name": "Get repositories for an organization",
      "type": "n8n-nodes-base.github",
      "position": [
        432,
        960
      ]
    },
    {
      "id": "bd4a5a1d-b995-42f0-8daf-41b6e45dc09b",
      "name": "Get a file",
      "type": "n8n-nodes-base.github",
      "position": [
        3120,
        656
      ]
    },
    {
      "id": "4ae0a2ed-2ea5-47df-bc34-8071140bfef5",
      "name": "Create a workflow",
      "type": "n8n-nodes-base.n8n",
      "position": [
        4256,
        736
      ]
    },
    {
      "id": "907610ef-f214-44ba-bbc9-63e86a45540a",
      "name": "Extract JSON From File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        3344,
        656
      ]
    },
    {
      "id": "8ac9b4e7-4eb5-4a24-abd3-d2785a858931",
      "name": "Select Repos",
      "type": "n8n-nodes-base.form",
      "position": [
        1328,
        960
      ]
    },
    {
      "id": "354a0959-9f43-471a-a9d4-886a4b64dd9e",
      "name": "Set Name and Data",
      "type": "n8n-nodes-base.set",
      "position": [
        3568,
        656
      ]
    },
    {
      "id": "4f9dbf09-965e-4542-b970-a16120aa50d7",
      "name": "Results",
      "type": "n8n-nodes-base.form",
      "position": [
        4928,
        656
      ]
    },
    {
      "id": "71a8cd4a-bd98-424a-935f-ec987a356912",
      "name": "Initialise Loop State",
      "type": "n8n-nodes-base.code",
      "position": [
        1552,
        960
      ]
    },
    {
      "id": "9e74c6ba-20d5-407e-9768-343712895b5a",
      "name": "If Has Next Page",
      "type": "n8n-nodes-base.if",
      "position": [
        1776,
        960
      ]
    },
    {
      "id": "2e8e8640-3a22-4f6c-bc47-1aba9bd38f8e",
      "name": "Set Current Path",
      "type": "n8n-nodes-base.code",
      "position": [
        2000,
        960
      ]
    },
    {
      "id": "5247e689-d8ae-45ea-a466-e1c20c67934a",
      "name": "Process Directory Contents",
      "type": "n8n-nodes-base.code",
      "position": [
        2448,
        1040
      ]
    },
    {
      "id": "ae27ea62-07cb-4ba9-96dd-e091587514d3",
      "name": "List Files",
      "type": "n8n-nodes-base.github",
      "position": [
        2224,
        960
      ]
    },
    {
      "id": "234b026c-beb1-4646-b982-fed9b972e52f",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2000,
        656
      ]
    },
    {
      "id": "d3fc2f6a-9dec-4e8e-863c-c71f6966649e",
      "name": "Split Out All Workflows",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2672,
        560
      ]
    },
    {
      "id": "0a257332-d249-4557-a33c-42e51059e1d1",
      "name": "Select Workflow(s)",
      "type": "n8n-nodes-base.form",
      "position": [
        2448,
        752
      ]
    },
    {
      "id": "c44dae85-5b3f-478a-9d75-d3ebf11c03b7",
      "name": "Split Out Selected Workflow(s)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2672,
        752
      ]
    },
    {
      "id": "88c99aad-81a2-4c55-92bc-4d8cf11ae7fa",
      "name": "Get Target Repo(s) Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        2896,
        656
      ]
    },
    {
      "id": "b0420013-78e9-4956-a99b-d9011754c5bc",
      "name": "Strip Incompatible API Fields",
      "type": "n8n-nodes-base.code",
      "position": [
        4032,
        736
      ]
    },
    {
      "id": "bec998ab-87cf-4cfc-930e-b4fd021e9910",
      "name": "Merge Success and Failed Workflows",
      "type": "n8n-nodes-base.merge",
      "position": [
        4480,
        656
      ]
    },
    {
      "id": "97ee2cbd-0308-49f6-b6a7-d33c17815bcf",
      "name": "Create JSON Repo Options",
      "type": "n8n-nodes-base.code",
      "position": [
        1104,
        960
      ]
    },
    {
      "id": "9c94bde0-b38c-4ad7-8f21-886c658bd15d",
      "name": "Create JSON Workflow Options",
      "type": "n8n-nodes-base.code",
      "position": [
        2224,
        752
      ]
    },
    {
      "id": "b9e24add-326f-4f88-b92b-103591149d1e",
      "name": "Found Matching Workflow?",
      "type": "n8n-nodes-base.if",
      "position": [
        3808,
        656
      ]
    },
    {
      "id": "7950f4b5-f330-43a6-9988-1fd43b22d86e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        640
      ],
      "parameters": {
        "width": 640,
        "height": 608,
        "content": "## Configure Repo Owner\n\nSet your GitHub repository owner using the form field.\n\nKeep:\n• Field Name: `Repo Owner` \n• Label: `Repo Owner`  \n• Type: `Dropdown` \n\nOnly update the `default value` and `dro"
      }
    },
    {
      "id": "5d67cd01-67f5-429f-85e6-aa05f59030c9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        784
      ],
      "parameters": {
        "width": 640,
        "height": 464,
        "content": "## Create Repository Form Data Structure\n\nBuilds the JSON for the dynamic repository selection form (JSON mode)."
      }
    },
    {
      "id": "e31fbad3-ff42-49bd-9abe-b6c1290918b6",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        400
      ],
      "parameters": {
        "width": 640,
        "height": 848,
        "content": "## How it works 🧠 (Workflow Explanation)\nThis workflow lets you selectively import n8n workflows from a GitHub repository, including repositories that use nested folders.\n\nInstead of recursion or mult"
      }
    },
    {
      "id": "abf5f7c0-1b9d-493a-982c-a2c2e6b465b5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1936,
        272
      ],
      "parameters": {
        "width": 1104,
        "height": 656,
        "content": "## Create Workflow File Form Data Structure\n\nBuilds the JSON used to populate the Workflow Selection form.\n\nThis section:\n• Splits the discovered repository files  \n• Creates dynamic SELECT_WORKFLOWS "
      }
    },
    {
      "id": "c60b75a7-292b-458d-a502-4fe9fdbe4e86",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3744,
        368
      ],
      "parameters": {
        "width": 880,
        "height": 592,
        "content": "## Format Workflows\n\nPrepares selected workflow files for safe import into n8n.\n\nThis section:\n• Verifies the file was successfully retrieved  \n• Removes fields incompatible with the n8n API  \n• Build"
      }
    },
    {
      "id": "4ae216b8-d24f-4123-b13f-9a1556adc674",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4672,
        400
      ],
      "parameters": {
        "width": 416,
        "height": 560,
        "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."
      }
    },
    {
      "id": "2073950e-cbdc-49ea-a62d-f084418a0868",
      "name": "Aggregate Repositories",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        880,
        960
      ]
    },
    {
      "id": "c2a6b4fa-36a1-4659-80be-d61a81106a83",
      "name": "Aggregate Selected Workflows",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        4704,
        656
      ]
    },
    {
      "id": "39860e04-98b9-4e10-ae3c-4f3f423f392e",
      "name": "Set Repository Name and URL",
      "type": "n8n-nodes-base.set",
      "position": [
        656,
        960
      ]
    },
    {
      "id": "d81f3cd2-0dd1-41a6-924d-3595702615ab",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1088,
        -912
      ],
      "parameters": {
        "width": 528,
        "height": 2160,
        "content": "## How it works 🧠 (Cue Logic Explanation)\nThis section traverses a GitHub repository using a queue-based state object inside a single workflow execution.\n\nIt:\n\t•\tStarts at the repository root\n\t•\tFetch"
      }
    }
  ],
  "connections": {
    "Results": {
      "main": [
        []
      ]
    },
    "Get a file": {
      "main": [
        [
          {
            "node": "Extract JSON From File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Files": {
      "main": [
        [
          {
            "node": "Process Directory Contents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Repos": {
      "main": [
        [
          {
            "node": "Initialise Loop State",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Has Next Page": {
      "main": [
        [
          {
            "node": "Set Current Path",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Current Path": {
      "main": [
        [
          {
            "node": "List Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a workflow": {
      "main": [
        [
          {
            "node": "Merge Success and Failed Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Name and Data": {
      "main": [
        [
          {
            "node": "Found Matching Workflow?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Get repositories for an organization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Workflow(s)": {
      "main": [
        [
          {
            "node": "Split Out Selected Workflow(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialise Loop State": {
      "main": [
        [
          {
            "node": "If Has Next Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Repositories": {
      "main": [
        [
          {
            "node": "Create JSON Repo Options",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract JSON From File": {
      "main": [
        [
          {
            "node": "Set Name and Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Target Repo(s) Data": {
      "main": [
        [
          {
            "node": "Get a file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out All Workflows": {
      "main": [
        [
          {
            "node": "Get Target Repo(s) Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create JSON Repo Options": {
      "main": [
        [
          {
            "node": "Select Repos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Found Matching Workflow?": {
      "main": [
        [
          {
            "node": "Strip Incompatible API Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge Success and Failed Workflows",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "No Operation, do nothing": {
      "main": [
        [
          {
            "node": "Create JSON Workflow Options",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out All Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Directory Contents": {
      "main": [
        [
          {
            "node": "If Has Next Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Repository Name and URL": {
      "main": [
        [
          {
            "node": "Aggregate Repositories",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Selected Workflows": {
      "main": [
        [
          {
            "node": "Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create JSON Workflow Options": {
      "main": [
        [
          {
            "node": "Select Workflow(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Strip Incompatible API Fields": {
      "main": [
        [
          {
            "node": "Create a workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Selected Workflow(s)": {
      "main": [
        [
          {
            "node": "Get Target Repo(s) Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge Success and Failed Workflows": {
      "main": [
        [
          {
            "node": "Aggregate Selected Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get repositories for an organization": {
      "main": [
        [
          {
            "node": "Set Repository Name and URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}