{
  "name": "Bidirectional GitHub workflow sync & version control for n8n workflows",
  "nodes": [
    {
      "id": "ffc98138-8afa-4cd6-8ba4-b235cc18c739",
      "name": "Create new workflow in n8n",
      "type": "n8n-nodes-base.n8n",
      "position": [
        1740,
        780
      ]
    },
    {
      "id": "d4891039-f8d2-465b-bbb6-098050f9e06c",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -260,
        280
      ]
    },
    {
      "id": "174b78dc-e584-4fc1-82a2-0e58b4a98b36",
      "name": "List files from repo",
      "type": "n8n-nodes-base.github",
      "position": [
        360,
        400
      ]
    },
    {
      "id": "3dcf4423-8024-4797-adee-71912ba87c2b",
      "name": "GitHub",
      "type": "n8n-nodes-base.github",
      "position": [
        800,
        400
      ]
    },
    {
      "id": "315a2e65-1c4d-46b4-b17d-b949c776c116",
      "name": "n8n",
      "type": "n8n-nodes-base.n8n",
      "position": [
        580,
        200
      ]
    },
    {
      "id": "404e87cf-e561-4807-865a-26a6109c228f",
      "name": "Upload file",
      "type": "n8n-nodes-base.github",
      "position": [
        2400,
        -80
      ]
    },
    {
      "id": "aee4f541-7ff4-441d-9c6b-1545676be55a",
      "name": "Json file",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1740,
        -80
      ]
    },
    {
      "id": "9047c039-ef8e-4fb2-b58c-3056f02366c7",
      "name": "To base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1960,
        -80
      ]
    },
    {
      "id": "e5208d64-7f41-4be4-ad09-313aeb5fa89d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1620,
        180
      ],
      "parameters": {
        "width": 340,
        "height": 400,
        "content": "## CHECK WHICH IS NEWER\n\n**IF TRUE** github workflow is the most recent, n8n to be updated\n\n**IF FALSE** n8n workflow is the most recent, github to be updated\n\n"
      }
    },
    {
      "id": "138bd609-541a-46d6-aa1e-792e85a58c05",
      "name": "Update file",
      "type": "n8n-nodes-base.github",
      "position": [
        3220,
        560
      ]
    },
    {
      "id": "72bd601d-fdce-4643-a26d-23e95f278110",
      "name": "Json file1",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        2560,
        560
      ]
    },
    {
      "id": "3974d157-1135-4068-bc3e-b295917cd49b",
      "name": "To base",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2780,
        560
      ]
    },
    {
      "id": "eee2bfd1-e0e3-4db5-b4da-1bbc189f45e7",
      "name": "n8n vs GitHub",
      "type": "n8n-nodes-base.compareDatasets",
      "position": [
        1260,
        280
      ]
    },
    {
      "id": "a94d4e6e-a250-4fe8-a092-a9e1697745c5",
      "name": "Update workflow in n8n",
      "type": "n8n-nodes-base.n8n",
      "position": [
        2340,
        300
      ]
    },
    {
      "id": "09d43ee5-7a21-47cd-8bec-45ae16e8422f",
      "name": "Code - InputB",
      "type": "n8n-nodes-base.code",
      "position": [
        2120,
        300
      ]
    },
    {
      "id": "d3be821f-a331-4dc7-993d-6af348fb1fb2",
      "name": "Code - InputA",
      "type": "n8n-nodes-base.code",
      "position": [
        2120,
        560
      ]
    },
    {
      "id": "2a173594-512b-4308-b685-540bac3e2338",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        2340,
        560
      ]
    },
    {
      "id": "7a43de98-2d25-4d0f-9b7c-47258dc7b405",
      "name": "Edit for Upload",
      "type": "n8n-nodes-base.set",
      "position": [
        2180,
        -80
      ]
    },
    {
      "id": "911736bd-1c6d-4b49-ade2-52d95f075a7f",
      "name": "Edit for Update",
      "type": "n8n-nodes-base.set",
      "position": [
        3000,
        560
      ]
    },
    {
      "id": "1193d962-fb0d-4b9e-b94c-04c8942860e4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1620,
        -200
      ],
      "parameters": {
        "width": 1000,
        "height": 320,
        "content": "## IF ONLY IN N8N\nUpdate GitHub with the relevant workflows"
      }
    },
    {
      "id": "e48eda08-7f73-46d6-ba81-f9e4b008fec3",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1620,
        640
      ],
      "parameters": {
        "width": 340,
        "height": 340,
        "content": "## IF ONLY IN GITHUB\nCreate new workflow in n8n"
      }
    },
    {
      "id": "c1909c33-d3f0-4d24-b4d7-fdf1e8074398",
      "name": "If n8n before GitHub",
      "type": "n8n-nodes-base.if",
      "position": [
        1740,
        400
      ]
    },
    {
      "id": "fd1022a0-4f67-4603-bf94-68415776c587",
      "name": "Decode to json",
      "type": "n8n-nodes-base.set",
      "position": [
        1020,
        400
      ]
    },
    {
      "id": "102aadd9-ace3-4fc6-a9a9-ca546362373e",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        580,
        400
      ]
    },
    {
      "id": "0ddf93a8-4db3-4826-a658-8fb4aedb31ce",
      "name": "Set GitHub Details",
      "type": "n8n-nodes-base.set",
      "position": [
        -40,
        280
      ]
    }
  ],
  "connections": {
    "n8n": {
      "main": [
        [
          {
            "node": "n8n vs GitHub",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "GitHub",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GitHub": {
      "main": [
        [
          {
            "node": "Decode to json",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "To base": {
      "main": [
        [
          {
            "node": "Edit for Update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Json file": {
      "main": [
        [
          {
            "node": "To base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "To base64": {
      "main": [
        [
          {
            "node": "Edit for Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Json file1": {
      "main": [
        [
          {
            "node": "To base",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Json file1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - InputA": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - InputB": {
      "main": [
        [
          {
            "node": "Update workflow in n8n",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n vs GitHub": {
      "main": [
        [
          {
            "node": "Json file",
            "type": "main",
            "index": 0
          }
        ],
        [],
        [
          {
            "node": "If n8n before GitHub",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create new workflow in n8n",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decode to json": {
      "main": [
        [
          {
            "node": "n8n vs GitHub",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Edit for Update": {
      "main": [
        [
          {
            "node": "Update file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit for Upload": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set GitHub Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set GitHub Details": {
      "main": [
        [
          {
            "node": "n8n",
            "type": "main",
            "index": 0
          },
          {
            "node": "List files from repo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If n8n before GitHub": {
      "main": [
        [
          {
            "node": "Code - InputB",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Code - InputA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List files from repo": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}