n8n

How to Automate Opsgenie Alert Routing?

Turn device outage events into clear alerts without manual work. Designed for IT teams and service providers, it opens or closes incidents in Opsgenie based on the status sent from your monitoring tool. The result is faster action and fewer noisy messages.

A webhook receives a POST payload from your source system. A Switch step checks the trigger value and only continues for agent offline events. A Set step maps key fields like alert id, computer name, and description. An IF check looks at the resolved flag. If the issue is not resolved, an HTTP request creates a new alert in Opsgenie with useful context. If it is resolved, another HTTP request closes the matching alert using the alias id. Non matching events are parked by a NoOp step to avoid clutter.

You need an Opsgenie account and an API key, plus any app that can send a JSON webhook. Expect to cut alert handling time and keep one source of truth for incident status. Common uses include agent offline notifications and auto closing when the device comes back online. Follow the steps below to connect the webhook, map fields, and test both create and close paths.

What are the key features?

  • Webhook trigger accepts POST JSON from any monitoring or RMM tool.
  • Switch node filters events by trigger value to process only agent offline cases.
  • Set node maps and cleans fields like alert id, device name, and description.
  • IF node checks the resolved flag to decide create or close action.
  • HTTP request creates a detailed Opsgenie alert with message and context.
  • HTTP request closes the alert in Opsgenie using the alias id and a note.
  • NoOp path safely ignores out of scope events and keeps logs clean.

What are the benefits?

  • Reduce manual triage from 10 minutes to 1 minute per alert
  • Automate up to 90 percent of agent offline alert actions
  • Improve data accuracy by removing copy and paste steps
  • Connect webhook sources to Opsgenie without custom code
  • Filter out non relevant events to cut alert noise by 50 percent

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Opsgenie and Webhook.site. See the Tools Required section above for links to create accounts with these services.
  3. In Opsgenie, create an API key in the Opsgenie dashboard under API key settings. Copy the key and keep it safe.
  4. In n8n, open the Credentials page and create a new HTTP Header Auth credential. Name it Opsgenie. Add a header named Authorization with the value GenieKey YOUR_API_KEY.
  5. Open the Create Alert node in n8n. In the credential field, select your Opsgenie credential. Confirm the request method is POST and the URL is https://api.opsgenie.com/v2/alerts.
  6. Open the Close Alert node. Use the same Opsgenie credential. Keep the POST method and confirm the URL uses the alias id from the webhook data.
  7. Open the Webhook node. Note the path and method POST. Copy the production URL and share it with your source system. If testing, send a JSON POST from Webhook.site to this URL.
  8. Check the Switch node rule. Ensure it matches your source trigger value for agent offline events. Update the expected text if your source uses a different value.
  9. Review the Set node fields. If your payload uses different JSON keys for id, computer name, description, or customer name, update the expressions to match your structure.
  10. Send a test payload with resolved set to false. Confirm a new alert appears in Opsgenie with the device name and message. Then send another payload with the same alias id and resolved set to true to verify the alert closes.
  11. If you see a 401 error, check the Opsgenie API key and Authorization header format. If you see a 404 on close, make sure the alias id in your payload matches an existing alert alias.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Opsgenie

Sign up

Free plan: $0 / mo (up to 5 users); includes API access; API request limit: # of users x 1000

Webhook.site

Sign up

Free tier: $0, public API available; free URLs expire after 7 days and accept up to 100 requests

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.