Skip to main content

Investigate Mattermost incident reports with an AI SRE assistant using OpenRouter

Workflow preview

Workflow preview
100%
Investigate Mattermost incident reports with an AI SRE assistant using OpenRouter preview
Open on n8n.io

1. Workflow Overview

Overview AI powered SRE sub workflow that investigates user reported incidents coming from a Mattermost channel and posts a structured diagnostic report back into the same thread. The result is a f...

Best for

  • DevOps automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenrouter, @n8n/n8n-nodes-langchain.mcpclienttool, @n8n/n8n-nodes-langchain.vectorstoreqdrant, @n8n/n8n-nodes-langchain.embeddingsgooglegemini, n8n-nodes-base.mattermost

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Sergei Byvshev.

Original n8n.io source

1.1 Workflow description

Title
Investigate Mattermost incident reports with an AI SRE assistant using OpenRouter
Workflow name
Investigate Mattermost incident reports with an AI SRE assistant using OpenRouter

Overview

AI-powered SRE sub-workflow that investigates user-reported incidents coming from a Mattermost channel and posts a structured diagnostic report back into the same thread. The result is a four-section incident report:

  • What happened — a concise summary of the symptoms
  • Event timeline — what was happening in the 10+ minutes before the incident
  • Root cause — up to two probable causes
  • Troubleshooting tips — step-by-step remediation for each root cause

Requirements

  • OpenRouter/OpenAI/Anthropic API key
  • Google Gemini API key — for embeddings
  • Mattermost API credentials — to post the reply back to the channel
  • Qdrant instance
  • Remote MCP servers (see MCP section)
  • A sub-workflow that analyses attachments
  • A parent workflow that triggers this one via "Execute Workflow" with a properly shaped payload

How it works

  1. The workflow is triggered by another workflow (When Executed by Another Workflow)
  2. ReadIncidentContext logs the incoming classification for debugging and forwards the payload downstream
  3. Call 'attachmentsAnalyzer invokes a vision sub-workflow with the file_ids
  4. SetVars defines the configuration used by the AI Agent prompt
  5. AI Agent runs the investigation
  6. Post a message` sends the agent's final output back to the originating channel

How to use

  • Prepare the knowledge base — upload your infrastructure description, service map, naming conventions and runbooks into a Qdrant collection
  • Deploy the MCP servers and put their URLs into the corresponding tool
  • Configure credentials
  • Adjust the configuration in SetVars
  • Plug in the attachments sub-workflow — replace the workflow reference in Call 'attachmentsAnalyzer' with your own vision-analysis workflow that maps file_ids[]
  • Tune the system prompt in the AI Agent — add project-specific naming conventions, ownership info, escalation rules and any quirks of your infrastructure

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 2 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 4 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 5 - Grafana

Type / Role
@n8n/n8n-nodes-langchain.mcpClientTool - mcpClientTool
Config choices
Version 1.2

Block 6 - DigitalOcean

Type / Role
@n8n/n8n-nodes-langchain.mcpClientTool - mcpClientTool
Config choices
Version 1.2

Block 7 - K8S

Type / Role
@n8n/n8n-nodes-langchain.mcpClientTool - mcpClientTool
Config choices
Version 1.2

Block 8 - Qdrant Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreQdrant - vectorStoreQdrant
Config choices
Version 1.3

Block 9 - Embeddings Google Gemini

Type / Role
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini - embeddingsGoogleGemini
Config choices
Version 1

Block 10 - Github

Type / Role
@n8n/n8n-nodes-langchain.mcpClientTool - mcpClientTool
Config choices
Version 1.2

Block 11 - Post a message

Type / Role
n8n-nodes-base.mattermost - mattermost
Config choices
Version 1

Block 12 - ReadIncidentContext

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - SetVars

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Mattermost

Type / Role
@n8n/n8n-nodes-langchain.mcpClientTool - mcpClientTool
Config choices
Version 1.2

Block 15 - Set: empty attachments

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 17 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Call 'attachmentsAnalyzer'

Type / Role
n8n-nodes-base.executeWorkflow - executeWorkflow
Config choices
Version 1.3

3. Summary Table

Workflow Investigate Mattermost incident reports with an AI SRE assistant using OpenRouter
Complexity advanced
Nodes 22
Categories DevOps, AI RAG
Author Sergei Byvshev
Published 11 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15611/15611.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Investigate Mattermost incident reports with an AI SRE assistant using OpenRouter do?

Overview AI powered SRE sub workflow that investigates user reported incidents coming from a Mattermost channel and posts a structured diagnostic report back into the same thread. The result is a f...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps, AI RAG use case.