{
  "name": "ServiceNow incident notifications to Slack workflow",
  "nodes": [
    {
      "id": "93963e3d-bd30-4a0f-ba56-7896cd19d2ae",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -660,
        160
      ]
    },
    {
      "id": "c459e403-01b8-43dd-8065-1f8dcb77bcc0",
      "name": "Run Every 5 Minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -660,
        -40
      ]
    },
    {
      "id": "7cabd06a-7898-4789-9671-78f0b6fcac2a",
      "name": "Get 5 Minute Ago Timestamp",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        -320,
        40
      ]
    },
    {
      "id": "5f21f279-3608-41bf-8986-47832aa0f1f2",
      "name": "Get Incidents from ServiceNow",
      "type": "n8n-nodes-base.serviceNow",
      "position": [
        -100,
        40
      ]
    },
    {
      "id": "19fc7c77-e2b0-495d-bb7b-7bc7a7d87805",
      "name": "Check if New Incidents",
      "type": "n8n-nodes-base.if",
      "position": [
        160,
        -40
      ]
    },
    {
      "id": "53e120d8-3022-46c0-8524-2c14f30d2c1a",
      "name": "Post Error Message if Error with ServiceNow",
      "type": "n8n-nodes-base.slack",
      "position": [
        480,
        760
      ]
    },
    {
      "id": "0784e71c-208d-4442-b355-3f1f076d9846",
      "name": "Sort Incidents in Ascending Order",
      "type": "n8n-nodes-base.sort",
      "position": [
        511,
        -271
      ]
    },
    {
      "id": "8435a455-0ea3-4443-8370-ec2e4c392e2f",
      "name": "Post Incident Details to Slack Channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        731,
        -271
      ]
    },
    {
      "id": "aa526b18-d259-4304-9faa-4375bee83c50",
      "name": "No Incidents, Do Nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        500,
        200
      ]
    },
    {
      "id": "2798711d-1788-4126-a576-cdef6c495bd7",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -720
      ],
      "parameters": {
        "width": 543.0448479049971,
        "height": 635.2493225262418,
        "content": "![Slack](https://uploads.n8n.io/templates/slack.png)\n## Sorting and Posting Incident Details to Slack\n\nThis section begins with the `Sort Incidents in Ascending Order` node, which organizes the retrie"
      }
    },
    {
      "id": "499f5f1e-617b-429d-9760-dc264870e269",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -416.5936589599954
      ],
      "parameters": {
        "width": 792.7994376824845,
        "height": 651.0105345024904,
        "content": "![Servicenow](https://uploads.n8n.io/templates/servicenow.png)\n## Fetching and Checking New Incidents\n\nThis section begins with the `Get 5 Minute Ago Timestamp` node, which calculates a timestamp exac"
      }
    },
    {
      "id": "c6f1dd80-ed5b-4e29-add1-a38a46338150",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        380
      ],
      "parameters": {
        "width": 540.6200460624971,
        "height": 560.0562505318285,
        "content": "![Slack](https://uploads.n8n.io/templates/slack.png)\n## Error Notification to Slack\n\nThis section handles error reporting using the `Post Error Message if Error with ServiceNow` node. If the workflow "
      }
    },
    {
      "id": "1ea0684a-9d7e-4f47-a7b0-9cb22bb6b934",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        -420
      ],
      "parameters": {
        "width": 382.98284329874696,
        "height": 746.70974187249,
        "content": "![n8n](https://uploads.n8n.io/templates/n8n.png)\n## Run Every 5 Minutes\n\nThe `Schedule Trigger` node is configured to automatically execute the workflow every 5 minutes. This setup ensures consistent "
      }
    },
    {
      "id": "1a3e7b4c-60ce-449c-9f6a-2a1bc42b748d",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -80
      ],
      "parameters": {
        "width": 540.5949630612389,
        "height": 442.9500589573929,
        "content": "![n8n](https://uploads.n8n.io/templates/n8n.png)\n## No New Incidents Found, Do Nothing\n\nIf a ServiceNow system ID is not found in the ServiceNow node output, it will route to this node which effective"
      }
    }
  ],
  "connections": {
    "Run Every 5 Minutes": {
      "main": [
        [
          {
            "node": "Get 5 Minute Ago Timestamp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if New Incidents": {
      "main": [
        [
          {
            "node": "Sort Incidents in Ascending Order",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Incidents, Do Nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get 5 Minute Ago Timestamp": {
      "main": [
        [
          {
            "node": "Get Incidents from ServiceNow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Incidents from ServiceNow": {
      "main": [
        [
          {
            "node": "Check if New Incidents",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Post Error Message if Error with ServiceNow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort Incidents in Ascending Order": {
      "main": [
        [
          {
            "node": "Post Incident Details to Slack Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Get 5 Minute Ago Timestamp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}