What this workflow does
This workflow connects PagerDuty, Jira, and Mattermost to update incident statuses and notify teams automatically. It solves the problem of manual updates that take time and can cause errors. When an incident is resolved, this workflow marks it closed in PagerDuty and Jira, and sends messages to chat channels to keep everyone informed.
You get faster updates, fewer mistakes, and better team communication without doing the work by hand.
Who should use this workflow
This is for anyone handling many PagerDuty incidents linked to Jira tickets and using Mattermost for team chat. It helps DevOps engineers or support teams who want to stop typing updates manually. If you have API keys for PagerDuty, Jira Cloud, and Mattermost, this workflow is ready to use.
Tools and services used
- PagerDuty API: Updates incident status to resolved.
- Jira Cloud API: Changes issue status to Done (ID 31 normally).
- Mattermost API: Sends messages to original and on-call team channels.
- n8n Webhook: Receives POST data when incident closes.
How this workflow works: Inputs → Process → Outputs
Inputs
- A webhook POST request with incident details from PagerDuty or the incident system.
- JSON payload including PagerDuty incident ID, Jira issue key, and Mattermost channel ID.
Processing Steps
- Webhook node captures the POST data with the incident information.
- PagerDuty node updates the incident status to resolved using the incident ID from the webhook.
- Jira node updates the corresponding Jira issue status to Done using the issue key from the webhook.
- Mattermost node sends a confirmation message to the channel where the webhook originated.
- A second Mattermost node sends a celebratory message to a fixed on-call team channel.
Outputs
- PagerDuty incident marked as resolved.
- Jira issue status changed to Done.
- Notification message posted to original Mattermost channel.
- Celebration message posted to on-call team Mattermost channel.
Beginner step-by-step: How to build this workflow in n8n for production
Step 1: Import the workflow file
Inside your n8n editor, click on the menu and choose Import from File. Select the downloaded workflow file from this page.
Step 2: Set up credentials and update IDs
- Add PagerDuty API Key in the credentials settings.
- Add Jira Cloud API Key with permissions to update issues.
- Add Mattermost API Key for sending messages.
- Check the Webhook node path matches your setup.
- Update any static channel IDs in the Mattermost nodes if needed.
Step 3: Test the workflow
Send a test POST request to the webhook URL with a sample incident close payload matching PagerDuty’s format.
Check if the incident status updates in PagerDuty and Jira, and the Mattermost messages appear.
Step 4: Activate workflow for production
After successful testing, turn on the workflow toggle in n8n to make it live.
Monitor new runs in the executions panel to catch any issues.
If self hosting n8n, refer to self-host n8n for extra control.
Customization ideas
- Change Jira status ID from 31 to suit your project workflow.
- Edit Mattermost message texts for tone or extra info like timestamps.
- Duplicate Mattermost nodes to notify multiple channels if needed.
- Secure the Webhook node with authentication or IP restrictions.
Common issues and solutions
- Webhook not triggering: Check URL spelling and set HTTP method to POST.
- PagerDuty update failed: Verify API key and incident ID extraction.
- Jira update error: Make sure the issue key is correct and API user has proper permissions.
- Mattermost message missing: Confirm channel IDs and API token validity.
Summary of results
✓ Incident resolution updates happen automatically.
✓ PagerDuty and Jira statuses stay in sync.
✓ Teams get instant notifications in Mattermost.
→ Saves time per incident and reduces manual errors.
→ Keeps everyone informed without extra work.
Useful code for expressions
Use these expressions inside n8n nodes to get data from webhook JSON:
{{$json["body"]["context"]["pagerduty_incident"]}
{{$node["Webhook"].json["body"]["context"]["jira_key"]}
{{$node["Webhook"].json["body"]["channel_id"]}
{{$node["PagerDuty"].json["summary"]}
Replace node names if different in your setup.
