# n8n Integration

#### Overview

[n8n](https://n8n.io/) is an open-source workflow automation platform that lets you connect any app or service using visual, no-code workflows. By adding an HTTP Request node to any n8n workflow, you can send alerts directly to ITOC360 and trigger your on-call escalation policies in real time.

#### Provider Configuration & Mapping

ITOC360 uses the `severity` field from the incoming payload to determine alert priority.

Priority Mapping:

| Payload Value | ITOC360 Priority |
| ------------- | ---------------- |
| `low`         | LOW              |
| `medium`      | MEDIUM           |
| `high`        | HIGH             |
| `critical`    | CRITICAL         |

#### Required Payload Format

Your HTTP Request node must send a JSON body in the following structure:

```json
{
  "event_type": "alert",
  "title":      "High CPU Usage on prod-01",
  "message":    "CPU usage exceeded 90% threshold",
  "severity":   "critical",
  "host":       "prod-01",
  "source":     "my-workflow-name",
  "timestamp":  "2026-04-06T10:00:00Z"
}
```

To resolve an existing alert, send the same payload with `event_type` set to `resolve`. The `host`, `title`, and `source` values must match the original alert exactly so ITOC360 can correlate and close it.

```json
{
  "event_type": "resolve",
  "title":      "High CPU Usage on prod-01",
  "message":    "CPU usage back to normal",
  "severity":   "critical",
  "host":       "prod-01",
  "source":     "my-workflow-name",
  "timestamp":  "2026-04-06T10:05:00Z"
}
```

#### Setup Instructions

**Step 1: Get Your Webhook URL**

1. Log in to your ITOC360 platform.
2. Go to **Sources → Add Source**.
3. Select **n8n** as your provider.
4. Save the configuration and copy the generated **Webhook URL** and **token**.

**Step 2: Create a New Workflow**

1. Log in to your n8n instance.
2. Go to **Workflows** and click **Add Workflow → Start from scratch**.
3. Click **Add first step** and search for **Manual Trigger**. Select it as your starting node.
4. Click the **+** button to the right of the Manual Trigger node, search for **HTTP Request**, and select it.

You should now have a two-node workflow like this:

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2FFS6fczZBLwrN4BZM0Ls3%2Fimage.png?alt=media&#x26;token=4529ce48-1d51-4c54-95f5-7ad9ce27d44f" alt=""><figcaption></figcaption></figure>

**Step 3: Configure the HTTP Request Node**

Click on the **HTTP Request** node to open its settings panel.

1. **Method:** `POST`
2. **URL:** Paste the Webhook URL you copied in Step 1.
3. **Authentication:** `None`
4. **Send Headers:** Toggle **on**.
5. Click **Add Header** and fill in:
   * **Name:** `x-itoc360-token`
   * **Value:** Paste your token from Step 1.
6. **Send Body:** Toggle **on**.
7. **Body Content Type:** `JSON`
8. **Specify Body:** `Using JSON`

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2F51mGSJq8Et3jOdZPUHJ2%2Fimage.png?alt=media&#x26;token=d76511b5-78e0-4d9b-9dae-22f1cb043377" alt=""><figcaption></figcaption></figure>

**Step 4: Add the Payload**

Scroll down to the **JSON** field and paste the following:

```json
{
  "event_type": "alert",
  "title":      "High CPU Usage on prod-01",
  "message":    "CPU usage exceeded 90% threshold",
  "severity":   "critical",
  "host":       "prod-01",
  "source":     "my-workflow-name",
  "timestamp":  "2026-04-06T10:00:00Z"
}
```

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2FLu97wiOXH9HCkBgxah2W%2FEkran%20Resmi%202026-04-06%2012.34.32.png?alt=media&#x26;token=eab41e03-dc97-408a-9680-95567f2ef86d" alt=""><figcaption></figcaption></figure>

Replace the field values with your own dynamic expressions or static test values.

**Step 5: Test the Workflow**

1. Click **Test workflow** in the top right corner.
2. Both nodes should turn green, confirming a successful delivery.

Once testing is complete, replace the Manual Trigger with the actual trigger that fits your use case — such as a Schedule, Webhook, or any app event node — and publish your workflow.
