{
  "name": "Auto-heal failing workflows with Azure OpenAI, n8n API, and Slack alerts",
  "nodes": [
    {
      "id": "793dfa7b-0834-4390-9928-fa0c49fae284",
      "name": "Azure OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        -368,
        1472
      ]
    },
    {
      "id": "7b31c623-aa39-440a-b6af-3415be6be14d",
      "name": "On Workflow Error",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -992,
        1248
      ]
    },
    {
      "id": "7b79e4ff-71bb-4564-83eb-839efb915f3c",
      "name": "Filter: Ignore Self",
      "type": "n8n-nodes-base.filter",
      "position": [
        -752,
        1248
      ]
    },
    {
      "id": "fd852042-fee2-4fcc-aebe-a9b28976b15d",
      "name": "Get Workflow JSON",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -528,
        1248
      ]
    },
    {
      "id": "51495c09-3b5e-4558-b592-27e5b422683d",
      "name": "Diagnose Error",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -304,
        1248
      ]
    },
    {
      "id": "09a3eac9-e134-4b98-95f3-afb086371ede",
      "name": "Decision Schema",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -160,
        1456
      ]
    },
    {
      "id": "906b3411-7672-480b-a17e-0b2d3842e5ea",
      "name": "Determine Action",
      "type": "n8n-nodes-base.switch",
      "position": [
        80,
        1232
      ]
    },
    {
      "id": "5cb32bf9-95ab-41ed-9cc4-8a1c86d1ea96",
      "name": "Cool Down",
      "type": "n8n-nodes-base.wait",
      "position": [
        320,
        1216
      ]
    },
    {
      "id": "5e74b4be-630d-4df0-b700-8ddfaea758d8",
      "name": "Generate Patch JSON",
      "type": "n8n-nodes-base.code",
      "position": [
        976,
        1392
      ]
    },
    {
      "id": "95c7ba49-dbd9-43c3-aa7f-33b9c55ff011",
      "name": "Retry Execution",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        544,
        1216
      ]
    },
    {
      "id": "9367f82e-8469-4970-8af4-53a8c87e42c7",
      "name": "Update Workflow",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1200,
        1392
      ]
    },
    {
      "id": "6eab371c-f9de-4ef8-8f90-efa4c2151592",
      "name": "Notify Success",
      "type": "n8n-nodes-base.slack",
      "position": [
        1440,
        1392
      ]
    },
    {
      "id": "2a6ccfb9-e39e-4cf0-9c54-6ad6542fcf27",
      "name": "Notify Manual Fix",
      "type": "n8n-nodes-base.slack",
      "position": [
        336,
        1472
      ]
    },
    {
      "id": "b93bd359-1f04-463e-94b2-23cd4afa8e2d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        1104
      ],
      "parameters": {
        "width": 1040,
        "height": 528,
        "content": "The error trigger responds with failure in any workflow, then AI analyzes the failure context against the workflow's structure. It determines if the error is a temporary timeout (Retry) or a logic err"
      }
    },
    {
      "id": "51ca98b8-4cca-4421-a411-50f95bfe0d5a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        1072
      ],
      "parameters": {
        "width": 752,
        "height": 336,
        "content": "The Switch node directs traffic based on the AI's verdict. If a retry is needed, the Wait node pauses execution to allow the external service time to recover. And it automatically retries the workflow"
      }
    },
    {
      "id": "507f3d24-1b03-42e6-9eae-4763355a17c2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        1264
      ],
      "parameters": {
        "width": 816,
        "height": 336,
        "content": "The JavaScript node injects the AI's corrected value into the workflow JSON. The n8n API then updates the workflow live and notifies Slack of the successful repair."
      }
    },
    {
      "id": "453800c4-bf94-40fd-9427-ca8f6110927f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        1424
      ],
      "parameters": {
        "width": 272,
        "height": 352,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nIf the AI cannot determine a fix or the error is marked as \"MANUAL,\" the system skips auto-correction and sends a detailed diagnostic report to Slack for human review."
      }
    },
    {
      "id": "87339878-8d67-407f-a3fa-a4b23731ee51",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        688
      ],
      "parameters": {
        "width": 528,
        "height": 496,
        "content": "## Workflow Overview\n\n### How it Works:\n\nThis workflow acts as a global error handler for your n8n instance. When a node fails in any connected workflow, the Error Trigger captures the event. It filte"
      }
    }
  ],
  "connections": {
    "Cool Down": {
      "main": [
        [
          {
            "node": "Retry Execution",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Diagnose Error": {
      "main": [
        [
          {
            "node": "Determine Action",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decision Schema": {
      "ai_outputParser": [
        [
          {
            "node": "Diagnose Error",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Update Workflow": {
      "main": [
        [
          {
            "node": "Notify Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Determine Action": {
      "main": [
        [
          {
            "node": "Cool Down",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Patch JSON",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify Manual Fix",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Workflow JSON": {
      "main": [
        [
          {
            "node": "Diagnose Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On Workflow Error": {
      "main": [
        [
          {
            "node": "Filter: Ignore Self",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter: Ignore Self": {
      "main": [
        [
          {
            "node": "Get Workflow JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Patch JSON": {
      "main": [
        [
          {
            "node": "Update Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Diagnose Error",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}