{
  "name": "Automatically document and backup N8N workflows",
  "nodes": [
    {
      "id": "d702f13e-8e93-4142-87c7-49fbb6031e19",
      "name": "Set fields",
      "type": "n8n-nodes-base.set",
      "position": [
        800,
        480
      ]
    },
    {
      "id": "4527dc91-bad5-4214-b210-ea8f89504fbf",
      "name": "Get notion page with workflow id",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        960,
        480
      ]
    },
    {
      "id": "ced49644-b18f-4984-8dfd-199d88e3ded7",
      "name": "Map fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1120,
        480
      ]
    },
    {
      "id": "86edfe55-9a88-49ed-82de-df0c44a65d53",
      "name": "Add to Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        1960,
        460
      ]
    },
    {
      "id": "9d547270-37dd-41ee-98b7-13001c954ffa",
      "name": "Update in Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        1960,
        640
      ]
    },
    {
      "id": "f612d12c-d3cf-4186-9ed1-c75ed53132cb",
      "name": "Notify internal-infra of push",
      "type": "n8n-nodes-base.slack",
      "position": [
        2160,
        460
      ]
    },
    {
      "id": "aef5c65e-323b-463b-8e1e-f09cc064c44b",
      "name": "Notify internal-infra of update",
      "type": "n8n-nodes-base.slack",
      "position": [
        2160,
        640
      ]
    },
    {
      "id": "f200a66c-b902-4b90-8499-93ae7d12a552",
      "name": "Notify on workflow setup error",
      "type": "n8n-nodes-base.slack",
      "position": [
        1060,
        1020
      ]
    },
    {
      "id": "f10268c7-706f-4651-9bee-99b13cdc1ed1",
      "name": "Summarize what the Workflow does",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1360,
        480
      ]
    },
    {
      "id": "21fa612f-98c5-4fe6-a048-2e2891bc6893",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        380
      ],
      "parameters": {
        "width": 480,
        "height": 300,
        "content": "## Extract key fields"
      }
    },
    {
      "id": "6b6f931b-298f-4ac6-a256-be051912e667",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        380
      ],
      "parameters": {
        "width": 1080,
        "height": 440,
        "content": "## Generate documentation in Notion\n"
      }
    },
    {
      "id": "7caa1e4a-9705-4abd-9b91-73abe7ef41d0",
      "name": "Upload changes to repo",
      "type": "n8n-nodes-base.github",
      "position": [
        1380,
        980
      ]
    },
    {
      "id": "50993b0c-81fa-4042-9fb9-0d53d1266743",
      "name": "Create new file in repo",
      "type": "n8n-nodes-base.github",
      "position": [
        1720,
        980
      ]
    },
    {
      "id": "e640de5f-2cc8-4fd9-817b-147a3fd67ed3",
      "name": "Notify on create file in repo fail",
      "type": "n8n-nodes-base.slack",
      "position": [
        2160,
        980
      ]
    },
    {
      "id": "623c4dd7-ebce-4b15-ab2a-b9222eab66f3",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        840
      ],
      "parameters": {
        "width": 480,
        "height": 360,
        "content": "## Check workflow setup OK "
      }
    },
    {
      "id": "bc47d8ab-3265-4148-ba2c-23e0a77156b6",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        840
      ],
      "parameters": {
        "width": 1080,
        "height": 360,
        "content": "## Upload / backup workflow to GitHub repo"
      }
    },
    {
      "id": "6cf569ad-38cd-4f8d-b65b-7c7fe36b1315",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        380
      ],
      "parameters": {
        "width": 660,
        "height": 300,
        "content": "## Check weekly for changes on active internal-infra workflows"
      }
    },
    {
      "id": "b890dacf-2ac2-4802-b96a-5097119d35ee",
      "name": "Is this a new workflow (to Notion) ?",
      "type": "n8n-nodes-base.if",
      "position": [
        1720,
        480
      ]
    },
    {
      "id": "2c3549c1-99c1-4255-a02d-2f454e6ced5e",
      "name": "Every Monday at 1am",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        120,
        480
      ]
    },
    {
      "id": "8d1fdf8c-3a80-4972-b721-ca9477be891b",
      "name": "Check if updated in last 7 days",
      "type": "n8n-nodes-base.if",
      "position": [
        560,
        480
      ]
    },
    {
      "id": "3380272e-5631-44aa-b7da-5e23e0966978",
      "name": "Get active workflows with internal-infra tag",
      "type": "n8n-nodes-base.n8n",
      "position": [
        340,
        480
      ]
    },
    {
      "id": "0049cf1e-91e9-4ee0-abd7-5e0bfab18b7f",
      "name": "Check that error workflow has been configured",
      "type": "n8n-nodes-base.if",
      "position": [
        820,
        900
      ]
    }
  ],
  "connections": {
    "Map fields": {
      "main": [
        [
          {
            "node": "Check that error workflow has been configured",
            "type": "main",
            "index": 0
          },
          {
            "node": "Summarize what the Workflow does",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fields": {
      "main": [
        [
          {
            "node": "Get notion page with workflow id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Notion": {
      "main": [
        [
          {
            "node": "Notify internal-infra of push",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update in Notion": {
      "main": [
        [
          {
            "node": "Notify internal-infra of update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every Monday at 1am": {
      "main": [
        [
          {
            "node": "Get active workflows with internal-infra tag",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload changes to repo": {
      "main": [
        [],
        [
          {
            "node": "Create new file in repo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create new file in repo": {
      "main": [
        [],
        [
          {
            "node": "Notify on create file in repo fail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify on workflow setup error": {
      "main": [
        []
      ]
    },
    "Check if updated in last 7 days": {
      "main": [
        [
          {
            "node": "Set fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get notion page with workflow id": {
      "main": [
        [
          {
            "node": "Map fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize what the Workflow does": {
      "main": [
        [
          {
            "node": "Is this a new workflow (to Notion) ?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is this a new workflow (to Notion) ?": {
      "main": [
        [
          {
            "node": "Add to Notion",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update in Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get active workflows with internal-infra tag": {
      "main": [
        [
          {
            "node": "Check if updated in last 7 days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check that error workflow has been configured": {
      "main": [
        [
          {
            "node": "Upload changes to repo",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify on workflow setup error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}