{
  "name": "Analyze GitLab CI job failures with GPT-5.3 and send reports to Slack",
  "nodes": [
    {
      "id": "cf4db35c-a98b-444e-a765-3e43204206c7",
      "name": "Is job failed?",
      "type": "n8n-nodes-base.if",
      "position": [
        96,
        0
      ]
    },
    {
      "id": "bf700581-5681-49ae-84d1-5e18894ba71e",
      "name": "Get Job Events",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -112,
        0
      ]
    },
    {
      "id": "3796ec77-82aa-4360-84ff-97ab2e24149f",
      "name": "Extract event data",
      "type": "n8n-nodes-base.code",
      "position": [
        576,
        -128
      ]
    },
    {
      "id": "a14e2e13-7a00-4434-a266-0cf7ba12b7d0",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        384,
        272
      ]
    },
    {
      "id": "09f5ff62-4d6b-46b2-8731-a264747ec92f",
      "name": "GetJobLogs",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        736,
        -320
      ]
    },
    {
      "id": "f32b5199-245f-4643-8d4f-5da5aed72c83",
      "name": "GetCIFile",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        864,
        64
      ]
    },
    {
      "id": "81b7537e-89e4-4540-be63-f7730d1d8e41",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1136,
        -144
      ]
    },
    {
      "id": "54f8d4ac-d84b-4eff-8b35-4fe418ab5173",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1616,
        -128
      ]
    },
    {
      "id": "681813df-17a9-40d8-ba76-afc0cd8a12a4",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1488,
        80
      ]
    },
    {
      "id": "85c671a7-a531-411c-a957-b145d7c6d191",
      "name": "GetLastLogLines",
      "type": "n8n-nodes-base.code",
      "position": [
        896,
        -320
      ]
    },
    {
      "id": "283ccf3d-9369-42e6-97a6-8dcdb307b91c",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1808,
        320
      ]
    },
    {
      "id": "6f2657bd-7d73-4120-bc08-1f01b452cd1f",
      "name": "Gitlab MCP",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        1520,
        320
      ]
    },
    {
      "id": "6b7a434d-be8e-41a8-b7dc-0e13eb2269ef",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        2080,
        -128
      ]
    },
    {
      "id": "212cd5f6-c612-44b9-907b-83fe750b2fdc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        -368
      ],
      "parameters": {
        "width": 928,
        "height": 560,
        "content": "# Collect data\n* Job logs\n* Pipeline file"
      }
    },
    {
      "id": "f82eca31-ed2b-4c2e-b926-dd57b8460acb",
      "name": "FormatData",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        -128
      ]
    },
    {
      "id": "431c2aec-c6ed-44a8-84c8-70b9e5f094fc",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        -208
      ],
      "parameters": {
        "width": 432,
        "height": 400,
        "content": "# Output Chain\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nPost generated report to Slack"
      }
    },
    {
      "id": "9ac578ff-749c-416a-a887-15d82bb84940",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        -208
      ],
      "parameters": {
        "width": 592,
        "height": 400,
        "content": "# Error analysis"
      }
    },
    {
      "id": "63e5c267-5ff5-4de1-8791-4c2168fb4e57",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        208
      ],
      "parameters": {
        "width": 592,
        "height": 416,
        "content": "# MCP servers\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAdd correct URLs for remote MCPs\nUse following mcp:\n* [gitlab-mcp](https://github.com/zereight/gitlab-mcp)\n* [grafana-mcp](https://github.com/grafana/mcp-grafana)"
      }
    },
    {
      "id": "fca3da23-d17b-4aa4-94b2-44fc256ca758",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -736
      ],
      "parameters": {
        "width": 608,
        "height": 608,
        "content": "# Overview\nThis workflow helps automatically analyze the causes of build failures in Gitlab CI and propose solutions without involving DevOps engineers.\n## How it work\n1. Checks whether a job crashed."
      }
    },
    {
      "id": "b2460b44-19ef-4281-9699-889af3107091",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        -96
      ],
      "parameters": {
        "width": 448,
        "height": 288,
        "content": "# Input Chain\n\n\n\n\n\n\n\n\n\n\n\n\n\nReceving pipeline event from Gitlab"
      }
    },
    {
      "id": "3dc3b6fe-eba2-4b91-908e-4f86ef753f60",
      "name": "MCP Grafana",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        1664,
        320
      ]
    },
    {
      "id": "f9524ed0-d8ba-4982-a97d-934653899328",
      "name": "SetVars",
      "type": "n8n-nodes-base.set",
      "position": [
        400,
        -128
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "FormatData",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SetVars": {
      "main": [
        [
          {
            "node": "Extract event data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetCIFile": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "FormatData": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetJobLogs": {
      "main": [
        [
          {
            "node": "GetLastLogLines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gitlab MCP": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "MCP Grafana": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Job Events": {
      "main": [
        [
          {
            "node": "Is job failed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is job failed?": {
      "main": [
        [
          {
            "node": "SetVars",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetLastLogLines": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract event data": {
      "main": [
        [
          {
            "node": "GetJobLogs",
            "type": "main",
            "index": 0
          },
          {
            "node": "GetCIFile",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}