n8n

How to Automate PagerDuty Factory Incident Response?

Keep factory machines safe with real time alerts. Sensor readings flow from your message queue into a central database, and high heat creates an on call incident. Built for operations teams that watch uptime and safety.

n8n listens to AMQP messages from the berlin_factory_01 queue. A function converts Celsius to Fahrenheit, then a Set node prepares clean fields for storage. Machine data is written to CrateDB. When temperature is 50 C or higher, a PagerDuty incident is created and its id and link are saved to CrateDB, otherwise the normal path does nothing.

You will need RabbitMQ or another AMQP server, a CrateDB database, and a PagerDuty service. Expect faster response to heat risk, less unplanned downtime, and clean logs for audits and reports. Useful for ovens, presses, kilns, or any heat sensitive gear on the floor.

What are the key features?

  • AMQP trigger reads sensor messages from the berlin_factory_01 queue
  • Function converts temperature from Celsius to Fahrenheit for reporting
  • Set node maps machine name, uptime, temperature and timestamp into clean fields
  • CrateDB insert stores machine readings in the machine_data table
  • If node flags temperatures at or above 50 C to guard against overheating
  • PagerDuty node creates an incident and includes the machine name in the title
  • Set node extracts incident id, link and time, keeping only these fields
  • CrateDB insert writes incident details into the incident_data table
  • NoOp node cleanly ends the normal path with no side effects

What are the benefits?

  • Cut alert response time from hours to minutes by paging on high heat automatically
  • Reduce manual checks by 100 percent with continuous sensor monitoring
  • Improve data quality by writing the same fields to CrateDB every time
  • Handle more events as production grows by consuming queue messages at scale
  • Connect RabbitMQ, PagerDuty and CrateDB into one clear flow

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 PagerDuty, CrateDB and RabbitMQ. See the Tools Required section above for links to create accounts with these services.
  3. Prepare your systems: in RabbitMQ create or confirm the berlin_factory_01 queue, and in CrateDB create tables machine_data and incident_data with the listed columns.
  4. Open the AMQP Trigger node named Data from factory sensors. In the Credential to connect with menu click Create new credential, enter your RabbitMQ host, port, username, password and virtual host, then save.
  5. In the same AMQP node set the queue to berlin_factory_01 and confirm it consumes messages in JSON format that include body.temperature_celsius, body.machine_id.name, body.machine_uptime and body.time_stamp.
  6. Create CrateDB credentials: double click each CrateDB node, choose Credential to connect with, click Create new credential, then enter host, port, database, user and password. Save and test the connection.
  7. Configure Ingest machine data: set the table to machine_data and map fields to temperature_fahrenheit, temperature_celsius, machine_name, machine_uptime and time_stamp from the Set sensor data output.
  8. Set up PagerDuty: create a REST API key in your PagerDuty account, then in the Create an incident node choose Credential to connect with, click Create new credential, paste the API key and save.
  9. In the Create an incident node select the correct service and severity. Keep the dynamic title that includes the machine name so on call staff know which asset is affected.
  10. Open the Data enrichment node and confirm the Celsius to Fahrenheit formula is correct for your needs. Adjust only if your input field names differ.
  11. Run a test: publish one message below 50 C and one at or above 50 C to RabbitMQ. Check CrateDB for a new row in machine_data for both messages and a row in incident_data plus a new PagerDuty incident for the high reading.
  12. Troubleshoot common issues: if no data arrives, verify the queue name and AMQP credentials. If CrateDB insert fails, confirm table names and column types. If the Fahrenheit field is empty, check the Set node for spelling and ensure temperature_fahrenheit matches the column name. If PagerDuty errors, confirm the API key and service permissions.

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.

CrateDB

Sign up

Free plan: $0 / mo, single node with 2 vCPU, 2 GB RAM, 8 GB storage

PagerDuty

Sign up

Free: $0 / mo (up to 5 users); API calls included

RabbitMQ

Sign up

Self-hosted Open Source (MPL 2.0): $0

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.