This workflow corresponds to n8n.io template #11733 — we link there as the canonical source.
This workflow follows the Gmail → Google Drive recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "",
"meta": {
"templateCredsSetupCompleted": false
},
"name": "AI Incident Report Generator",
"tags": [],
"nodes": [
{
"id": "95e5f8d6-52e2-4e2e-b901-fb2ba0fae809",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
1488,
432
],
"parameters": {
"path": "incident-report",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2.1
},
{
"id": "4dc8477d-0bba-4646-8385-f126c24836fd",
"name": "Convert to PDF",
"type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
"position": [
3200,
320
],
"parameters": {
"html_content": "=<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <style>\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');\n \n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n \n body {\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n padding: 40px 20px;\n color: #1a202c;\n line-height: 1.6;\n }\n \n .container {\n max-width: 900px;\n margin: 0 auto;\n background: white;\n border-radius: 24px;\n overflow: hidden;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n }\n \n .header {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n padding: 50px 40px;\n color: white;\n position: relative;\n overflow: hidden;\n }\n \n .header::before {\n content: '';\n position: absolute;\n top: -50%;\n right: -10%;\n width: 400px;\n height: 400px;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 50%;\n }\n \n .header-content {\n position: relative;\n z-index: 1;\n }\n \n .header h1 {\n font-size: 42px;\n font-weight: 700;\n margin-bottom: 12px;\n letter-spacing: -0.5px;\n }\n \n .header-subtitle {\n font-size: 16px;\n opacity: 0.9;\n font-weight: 500;\n }\n \n .severity-badge {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 10px 20px;\n border-radius: 100px;\n font-weight: 700;\n text-transform: uppercase;\n font-size: 13px;\n letter-spacing: 1px;\n margin-top: 20px;\n animation: pulse 2s infinite;\n }\n \n @keyframes pulse {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.05); }\n }\n \n .severity-high { \n background: #fee;\n color: #dc2626;\n border: 2px solid #dc2626;\n }\n \n .severity-medium { \n background: #fffbeb;\n color: #d97706;\n border: 2px solid #f59e0b;\n }\n \n .severity-low { \n background: #ecfdf5;\n color: #059669;\n border: 2px solid #10b981;\n }\n \n .content {\n padding: 40px;\n }\n \n .alert-banner {\n background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);\n border-left: 5px solid #f59e0b;\n padding: 20px 25px;\n border-radius: 12px;\n margin-bottom: 35px;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n }\n \n .alert-banner strong {\n color: #92400e;\n font-size: 15px;\n display: block;\n margin-bottom: 5px;\n }\n \n .alert-banner p {\n color: #78350f;\n margin: 0;\n font-size: 14px;\n }\n \n .info-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));\n gap: 20px;\n margin-bottom: 35px;\n }\n \n .info-card {\n background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n padding: 20px;\n border-radius: 16px;\n border: 1px solid #e2e8f0;\n transition: transform 0.2s, box-shadow 0.2s;\n }\n \n .info-card:hover {\n transform: translateY(-2px);\n box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);\n }\n \n .info-label {\n font-size: 12px;\n text-transform: uppercase;\n letter-spacing: 1px;\n color: #64748b;\n font-weight: 600;\n margin-bottom: 8px;\n }\n \n .info-value {\n font-size: 16px;\n color: #0f172a;\n font-weight: 600;\n word-break: break-word;\n }\n \n .section {\n margin: 35px 0;\n padding: 30px;\n background: #ffffff;\n border-radius: 16px;\n border: 2px solid #f1f5f9;\n transition: border-color 0.3s;\n }\n \n .section:hover {\n border-color: #cbd5e1;\n }\n \n .section-title {\n font-size: 22px;\n font-weight: 700;\n color: #1e293b;\n margin-bottom: 18px;\n display: flex;\n align-items: center;\n gap: 12px;\n }\n \n .section-title::before {\n content: '';\n width: 4px;\n height: 28px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border-radius: 4px;\n }\n \n .section p {\n color: #475569;\n font-size: 15px;\n line-height: 1.8;\n margin: 0;\n }\n \n .actions-container {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));\n gap: 25px;\n margin: 35px 0;\n }\n \n .actions-box {\n background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);\n border: 2px solid #0ea5e9;\n border-radius: 16px;\n padding: 25px;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n }\n \n .actions-box.long-term {\n background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);\n border-color: #10b981;\n }\n \n .actions-title {\n font-size: 18px;\n font-weight: 700;\n color: #0c4a6e;\n margin-bottom: 15px;\n display: flex;\n align-items: center;\n gap: 10px;\n }\n \n .actions-box.long-term .actions-title {\n color: #064e3b;\n }\n \n .actions-title::before {\n content: '\u26a1';\n font-size: 24px;\n }\n \n .actions-box.long-term .actions-title::before {\n content: '\ud83c\udfaf';\n }\n \n .actions-list {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n \n .actions-list li {\n padding: 12px 0 12px 32px;\n color: #334155;\n font-size: 14px;\n line-height: 1.6;\n position: relative;\n border-bottom: 1px solid rgba(0, 0, 0, 0.05);\n }\n \n .actions-list li:last-child {\n border-bottom: none;\n }\n \n .actions-list li::before {\n content: '\u2192';\n position: absolute;\n left: 0;\n color: #0ea5e9;\n font-weight: 700;\n font-size: 18px;\n }\n \n .actions-box.long-term .actions-list li::before {\n color: #10b981;\n }\n \n .footer {\n margin-top: 40px;\n padding: 30px 40px;\n background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n border-top: 2px solid #e2e8f0;\n text-align: center;\n }\n \n .footer-text {\n color: #64748b;\n font-size: 13px;\n margin-bottom: 8px;\n }\n \n .footer-badge {\n display: inline-block;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n padding: 8px 16px;\n border-radius: 100px;\n font-size: 12px;\n font-weight: 600;\n margin-top: 10px;\n }\n \n @media print {\n body {\n background: white;\n padding: 0;\n }\n .container {\n box-shadow: none;\n }\n }\n </style>\n</head>\n<body>\n <div class=\"container\">\n <div class=\"header\">\n <div class=\"header-content\">\n <h1>\ud83d\udea8 Incident Report</h1>\n <p class=\"header-subtitle\">Automated System Analysis & Response Protocol</p>\n <div class=\"severity-badge severity-{{ $json.severity }}\">\n \u26a0\ufe0f {{ $json.severity }} Severity\n </div>\n </div>\n </div>\n\n <div class=\"content\">\n <div class=\"alert-banner\">\n <strong>\u23f0 Incident Detected</strong>\n <p>This report was automatically generated at {{ $json.report_generated_at }}</p>\n </div>\n\n <div class=\"info-grid\">\n <div class=\"info-card\">\n <div class=\"info-label\">\ud83d\udccb Incident ID</div>\n <div class=\"info-value\">{{ $json.incident_id }}</div>\n </div>\n \n <div class=\"info-card\">\n <div class=\"info-label\">\ud83d\udc64 Reported By</div>\n <div class=\"info-value\">{{ $json.reported_by }}</div>\n </div>\n \n <div class=\"info-card\">\n <div class=\"info-label\">\ud83d\udcc5 Timestamp</div>\n <div class=\"info-value\">{{ $json.timestamp }}</div>\n </div>\n \n <div class=\"info-card\">\n <div class=\"info-label\">\ud83d\udda5\ufe0f Affected Systems</div>\n <div class=\"info-value\">{{ $json.affected_systems }}</div>\n </div>\n </div>\n\n <div class=\"section\">\n <h2 class=\"section-title\">Incident Title</h2>\n <p><strong>{{ $json.title }}</strong></p>\n </div>\n\n <div class=\"section\">\n <h2 class=\"section-title\">Description</h2>\n <p>{{ $json.description }}</p>\n </div>\n\n <div class=\"section\">\n <h2 class=\"section-title\">Initial Impact</h2>\n <p>{{ $json.initial_impact }}</p>\n </div>\n\n <div class=\"section\">\n <h2 class=\"section-title\">Root Cause Analysis</h2>\n <p>{{ $json.root_cause }}</p>\n </div>\n\n <div class=\"section\">\n <h2 class=\"section-title\">Impact Assessment</h2>\n <p>{{ $json.impact_assessment }}</p>\n </div>\n\n <div class=\"actions-container\">\n <div class=\"actions-box\">\n <h3 class=\"actions-title\">Immediate Actions</h3>\n <ul class=\"actions-list\">\n {{ $json.immediate_actions.map(action => '<li>' + action + '</li>').join('') }}\n </ul>\n </div>\n\n <div class=\"actions-box long-term\">\n <h3 class=\"actions-title\">Long-term Actions</h3>\n <ul class=\"actions-list\">\n {{ $json.long_term_actions.map(action => '<li>' + action + '</li>').join('') }}\n </ul>\n </div>\n </div>\n </div>\n\n <div class=\"footer\">\n <p class=\"footer-text\">Generated on {{ $json.report_generated_at }}</p>\n <div class=\"footer-badge\">\ud83d\udd12 Internal Operations Team \u2022 Confidential</div>\n </div>\n </div>\n</body>\n</html>\n",
"output_format": "file",
"output_filename": "data"
},
"credentials": {
"htmlcsstopdfApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "33479a52-d8b5-423e-848f-069c9838b8b4",
"name": "Normalize Data",
"type": "n8n-nodes-base.set",
"position": [
1744,
432
],
"parameters": {
"options": {
"ignoreConversionErrors": true
},
"assignments": {
"assignments": [
{
"id": "b7da0a8d-7a73-4d43-b362-59d306256c7d",
"name": "incident_id",
"type": "string",
"value": "={{ $json.body.incident_id }}"
},
{
"id": "05959192-fd6c-4027-bb18-7603e93c1c8e",
"name": "title",
"type": "string",
"value": "={{ $json.body.title }}"
},
{
"id": "f66aada4-d9a8-4b92-8e0b-7991094f9ae9",
"name": "description",
"type": "string",
"value": "={{ $json.body.description }}"
},
{
"id": "05ab36a5-df38-4bb9-93bb-637ded12c74e",
"name": "severity",
"type": "string",
"value": "={{ $json.body.severity.toLowerCase()}}"
},
{
"id": "3d2e598f-eb48-415c-8456-266e18f0a1b0",
"name": "reported_by",
"type": "string",
"value": "={{ $json.body.reported_by }}"
},
{
"id": "38b20757-c693-4a81-8c23-6e97a1c4c250",
"name": "timestamp",
"type": "string",
"value": "={{ $json.body.timestamp }}"
},
{
"id": "a0c29ffa-8316-40b1-8f91-e36995cb1908",
"name": "affected_systems",
"type": "array",
"value": "={{ $json.body.affected_systems.join(', ') }}"
},
{
"id": "41454f8f-2c62-4418-a419-86bfb3628b3b",
"name": "initial_impact",
"type": "string",
"value": "={{ $json.body.initial_impact }}"
},
{
"id": "7c8a2147-e72c-4b0e-afb6-9bdf1c31a70f",
"name": "report_generated_at",
"type": "string",
"value": "={{ $now.toFormat('yyyy-MM-dd HH:mm:ss') }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "2e2754dc-ab7c-4cf0-b5da-60b4fcd9381b",
"name": "Root Cause + Impact Analysis",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
2064,
432
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4",
"cachedResultName": "GPT-4"
},
"options": {
"temperature": 0.7
},
"responses": {
"values": [
{
"role": "system",
"content": "=You are an expert incident analyst. Analyze the following incident and provide:\n1. Root Cause Analysis (likely causes)\n2. Impact Assessment (business and technical impact)\n3. Recommended Actions (immediate and long-term)\n\nFormat your response as JSON with these exact keys:\n{\n \"root_cause\": \"detailed analysis\",\n \"impact_assessment\": \"business and technical impact\",\n \"immediate_actions\": [\"action 1\", \"action 2\"],\n \"long_term_actions\": [\"action 1\", \"action 2\"]\n}"
},
{
"content": "=Incident ID: {{ $json.incident_id }}\nTitle: {{ $json.title }}\nDescription: {{ $json.description }}\nSeverity: {{ $json.severity }}\nAffected Systems: {{ $json.affected_systems }}\nInitial Impact: {{ $json.initial_impact }}"
}
]
},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "fce8aeae-dd7b-4c60-93ca-2e79d70201a6",
"name": "Parse AI Response",
"type": "n8n-nodes-base.code",
"position": [
2384,
432
],
"parameters": {
"jsCode": "// Get the OpenAI response\nconst openAIOutput = $input.first().json;\n\n// The actual AI response is nested in: output[0].content[0].text\nconst aiResponseText = openAIOutput.output[0].content[0].text;\n\n// Parse the JSON string\nconst aiAnalysis = JSON.parse(aiResponseText);\n\n// Get the original incident data from the previous nodes\n// This assumes the webhook data is still in the item\nconst originalData = $('Normalize Data').first().json;\n\n// Combine everything together\nreturn [{\n json: {\n ...originalData, // All the original incident data\n root_cause: aiAnalysis.root_cause,\n impact_assessment: aiAnalysis.impact_assessment,\n immediate_actions: aiAnalysis.immediate_actions,\n long_term_actions: aiAnalysis.long_term_actions\n }\n}];"
},
"typeVersion": 2
},
{
"id": "24a3ac3b-9293-42bc-99b7-e5902e38c009",
"name": "Check Severity",
"type": "n8n-nodes-base.if",
"position": [
2624,
432
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "23419f40-f589-45a0-9367-31aa0df9fe5a",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.severity }}",
"rightValue": "high"
}
]
}
},
"typeVersion": 2.3
},
{
"id": "3216f044-4cf7-4b43-8d56-2f004eabf7df",
"name": "Alerts",
"type": "n8n-nodes-base.slack",
"position": [
2816,
320
],
"parameters": {
"text": "=\ud83d\udea8 *HIGH SEVERITY INCIDENT REPORTED*\n\n*Incident ID*: {{ $json.incident_id }}\n*Title*: {{ $json.title }}\n*Reported By*: {{ $json.reported_by }}\n*Time*: {{ $json.timestamp }}\n\n*Initial Impact*: {{ $json.initial_impact }}\n*Affected Systems*: {{ $json.affected_systems }}\n\n*Root Cause*: {{ $json.root_cause }}\n\n*Immediate Actions Required*:\n- {{ $json.immediate_actions[0] }}\n- {{ $json.immediate_actions[1] }}\n\nFull report will be generated and sent to ops team shortly.",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "list",
"value": "YOUR_CHANNEL_ID",
"cachedResultName": "YOUR_CHANNEL_NAME"
},
"otherOptions": {}
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.4
},
{
"id": "83b5badf-9680-4939-8fd2-65a9a6783e62",
"name": "Data Recovery",
"type": "n8n-nodes-base.code",
"position": [
2992,
320
],
"parameters": {
"jsCode": "// Get the original incident data from the Check Severity node\nconst incidentData = $('Check Severity').first().json;\n\n// Return the incident data (ignore Slack's response)\nreturn [{\n json: incidentData\n}];"
},
"typeVersion": 2
},
{
"id": "65c40d32-8eef-4f6d-a25a-ad132a390047",
"name": "Upload file",
"type": "n8n-nodes-base.googleDrive",
"position": [
3392,
432
],
"parameters": {
"name": "=Incident_{{ $('Data Recovery').item.json.incident_id }}_{{ $('Data Recovery').item.json.severity }}_{{ $now.format('YYYY-MM-DD_HHmmss') }}.pdf",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "root",
"cachedResultName": "YOUR_FOLDER_NAME"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "ffe18b38-ab44-4e30-8e91-ed2d22b7ac96",
"name": "Send Email",
"type": "n8n-nodes-base.gmail",
"position": [
3392,
272
],
"parameters": {
"sendTo": "=ops-team@yourcompany.com",
"message": "=<!DOCTYPE html>\n<html>\n<head>\n <style>\n body {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;\n line-height: 1.6;\n color: #333;\n max-width: 600px;\n margin: 0 auto;\n padding: 20px;\n }\n .email-container {\n background: #ffffff;\n border-radius: 8px;\n overflow: hidden;\n }\n .header {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n padding: 30px;\n text-align: center;\n color: white;\n }\n .header h1 {\n margin: 0;\n font-size: 28px;\n font-weight: 700;\n }\n .severity-badge {\n display: inline-block;\n padding: 8px 16px;\n border-radius: 20px;\n font-weight: 700;\n text-transform: uppercase;\n font-size: 12px;\n margin-top: 15px;\n letter-spacing: 1px;\n }\n .severity-high {\n background: #fee;\n color: #dc2626;\n border: 2px solid #dc2626;\n }\n .severity-medium {\n background: #fffbeb;\n color: #d97706;\n border: 2px solid #f59e0b;\n }\n .severity-low {\n background: #ecfdf5;\n color: #059669;\n border: 2px solid #10b981;\n }\n .content {\n padding: 30px;\n background: #f9fafb;\n }\n .info-table {\n width: 100%;\n border-collapse: collapse;\n background: white;\n border-radius: 8px;\n overflow: hidden;\n margin: 20px 0;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n }\n .info-table tr {\n border-bottom: 1px solid #e5e7eb;\n }\n .info-table tr:last-child {\n border-bottom: none;\n }\n .info-table td {\n padding: 15px;\n font-size: 14px;\n }\n .info-table td:first-child {\n background: #f3f4f6;\n font-weight: 600;\n color: #4b5563;\n width: 180px;\n }\n .info-table td:last-child {\n color: #1f2937;\n }\n .section {\n background: white;\n padding: 20px;\n border-radius: 8px;\n margin: 20px 0;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n }\n .section h3 {\n margin: 0 0 12px 0;\n color: #1e293b;\n font-size: 16px;\n border-bottom: 2px solid #667eea;\n padding-bottom: 8px;\n }\n .section p {\n margin: 0;\n color: #475569;\n font-size: 14px;\n line-height: 1.6;\n }\n .actions-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 15px;\n margin: 20px 0;\n }\n .action-box {\n background: white;\n padding: 18px;\n border-radius: 8px;\n border-left: 4px solid #0ea5e9;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n }\n .action-box.long-term {\n border-left-color: #10b981;\n }\n .action-box h4 {\n margin: 0 0 10px 0;\n color: #0c4a6e;\n font-size: 14px;\n font-weight: 700;\n }\n .action-box.long-term h4 {\n color: #064e3b;\n }\n .action-box ul {\n margin: 0;\n padding-left: 20px;\n font-size: 13px;\n color: #334155;\n }\n .action-box li {\n margin: 6px 0;\n line-height: 1.5;\n }\n .cta-button {\n display: inline-block;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n padding: 14px 32px;\n text-decoration: none;\n border-radius: 6px;\n font-weight: 600;\n font-size: 15px;\n margin: 20px 0;\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n }\n .footer {\n padding: 20px 30px;\n text-align: center;\n background: #f3f4f6;\n color: #6b7280;\n font-size: 12px;\n border-top: 2px solid #e5e7eb;\n }\n .footer p {\n margin: 5px 0;\n }\n @media only screen and (max-width: 600px) {\n .actions-grid {\n grid-template-columns: 1fr;\n }\n }\n </style>\n</head>\n<body>\n <div class=\"email-container\">\n <div class=\"header\">\n <h1>\ud83d\udea8 Incident Report Generated</h1>\n <div class=\"severity-badge severity-{{ $('Data Recovery').item.json.severity }}\">\n {{ $('Data Recovery').item.json.severity }} Severity\n </div>\n </div>\n\n <div class=\"content\">\n <p style=\"margin: 0 0 20px 0; color: #1f2937; font-size: 15px;\">\n A new incident report has been generated and requires your immediate attention. \n Please review the details below and the attached PDF report.\n </p>\n\n <table class=\"info-table\">\n <tr>\n <td>\ud83d\udccb Incident ID</td>\n <td><strong>{{ $('Data Recovery').item.json.incident_id }}</strong></td>\n </tr>\n <tr>\n <td>\ud83d\udd34 Severity Level</td>\n <td><strong style=\"color: {{ $('Data Recovery').item.json.severity === 'high' ? '#dc2626' : ($('Data Recovery').item.json.severity === 'medium' ? '#d97706' : '#059669') }}; text-transform: uppercase;\">{{ $('Data Recovery').item.json.severity }}</strong></td>\n </tr>\n <tr>\n <td>\ud83d\udcdd Title</td>\n <td>{{ $('Data Recovery').item.json.title }}</td>\n </tr>\n <tr>\n <td>\ud83d\udc64 Reported By</td>\n <td>{{ $('Data Recovery').item.json.reported_by }}</td>\n </tr>\n <tr>\n <td>\ud83d\udcc5 Timestamp</td>\n <td>{{ $('Data Recovery').item.json.timestamp }}</td>\n </tr>\n <tr>\n <td>\ud83d\udda5\ufe0f Affected Systems</td>\n <td>{{ $('Data Recovery').item.json.affected_systems }}</td>\n </tr>\n </table>\n\n <div class=\"section\">\n <h3>\ud83d\udca5 Initial Impact</h3>\n <p>{{ $('Data Recovery').item.json.initial_impact }}</p>\n </div>\n\n <div class=\"section\">\n <h3>\ud83d\udd0d Root Cause Analysis</h3>\n <p>{{ $('Data Recovery').item.json.root_cause }}</p>\n </div>\n\n <div class=\"actions-grid\">\n <div class=\"action-box\">\n <h4>\u26a1 Immediate Actions ({{$('Data Recovery').item.json.immediate_actions.length }})</h4>\n <ul>\n {{ $('Data Recovery').item.json.immediate_actions.slice(0, 3).map(action => '<li>' + action.substring(0, 80) + (action.length > 80 ? '...' : '') + '</li>').join('') }}\n </ul>\n </div>\n\n <div class=\"action-box long-term\">\n <h4>\ud83c\udfaf Long-term Actions ({{$('Data Recovery').item.json.long_term_actions.length }})</h4>\n <ul>\n {{ $('Data Recovery').item.json.long_term_actions.slice(0, 3).map(action => '<li>' + action.substring(0, 80) + (action.length > 80 ? '...' : '') + '</li>').join('') }}\n </ul>\n </div>\n </div>\n\n <div style=\"text-align: center; margin: 30px 0;\">\n <p style=\"color: #6b7280; font-size: 14px; margin-bottom: 15px;\">\n \ud83d\udcce Full detailed report attached as PDF\n </p>\n </div>\n </div>\n\n <div class=\"footer\">\n <p><strong>Automated Incident Management System</strong></p>\n <p>Report generated on {{ $('Data Recovery').item.json.report_generated_at }}</p>\n <p style=\"margin-top: 10px;\">Internal Operations Team \u2022 Confidential</p>\n <p style=\"color: #9ca3af; font-size: 11px; margin-top: 15px;\">\n This is an automated message. Please do not reply to this email.\n </p>\n </div>\n </div>\n</body>\n</html>",
"options": {
"attachmentsUi": {
"attachmentsBinary": [
{}
]
}
},
"subject": "=[{{ $('Data Recovery').item.json.severity.toUpperCase() }}] Incident Report: {{ $('Data Recovery').item.json.title }} - {{$('Data Recovery').item.json.incident_id }}"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "5bbb2c29-5ac2-4046-9ed9-e14053559e35",
"name": "Stop and Error",
"type": "n8n-nodes-base.stopAndError",
"position": [
2832,
496
],
"parameters": {
"errorMessage": "Severity is not HIGH!"
},
"typeVersion": 1
},
{
"id": "917c8d9f-d045-43f0-a46b-5f0c8593d799",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
800,
-352
],
"parameters": {
"width": 592,
"height": 928,
"content": "### How It Works\nThis workflow automates incident report generation and crisis response management for operations teams. When an incident is reported via webhook, the system normalizes and validates the incoming data including incident ID, title, description, severity level, affected systems, and initial impact assessment. The structured data is sent to OpenAI GPT-4 for intelligent analysis, which performs root cause analysis, assesses business and technical impact, and generates actionable recommendations split into immediate and long-term actions. The AI response is parsed and merged with the original incident details to create a comprehensive report dataset. For high-severity incidents, the workflow automatically triggers a Slack alert to notify the operations team immediately with critical details and preliminary recommendations. All incidents proceed to document generation where a beautifully formatted HTML report is created with severity badges, color-coded risk indicators, structured sections, and actionable items. This HTML is converted to a professional PDF that's simultaneously emailed to the operations team with an executive summary and uploaded to Google Drive for permanent record-keeping and compliance documentation.\n\n### Setup Steps\n1. Connect required credentials: OpenAI API, HTML-to-PDF service, Gmail, Google Drive, and Slack.\n2. Configure the Slack channel where high-severity incident alerts should be posted.\n3. Update the email recipient address in the \"Send Email\" node (currently ops-team@yourcompany.com).\n4. Customize the Google Drive folder where incident reports should be stored.\n5. Adjust the severity threshold in the \"Check Severity\" node if you want alerts for medium-severity incidents too.\n6. Copy the webhook URL and integrate it into your monitoring system or incident reporting tool.\n7. Test with sample incidents of varying severity levels to verify routing and notifications.\n\n### Customization\n- Modify the AI system prompt to include industry-specific analysis frameworks or compliance requirements.\n- Adjust the severity color scheme and badges in the HTML template to match your brand guidelines.\n- Add additional notification channels (PagerDuty, Microsoft Teams) for critical incidents.\n- Customize the email template styling and branding to align with your organization's visual identity.\n- Expand the AI analysis to include cost impact calculations or SLA breach assessments."
},
"typeVersion": 1
},
{
"id": "65b24331-5821-462b-92d8-0981adffdc68",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1424,
320
],
"parameters": {
"color": 7,
"width": 512,
"height": 256,
"content": "## Input & Data Normalization\nReceives incident details via webhook and structures data for AI analysis."
},
"typeVersion": 1
},
{
"id": "eea4c7f1-e6ec-4189-bc00-b3277107c6cc",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1984,
336
],
"parameters": {
"color": 7,
"width": 560,
"height": 256,
"content": "## AI Analysis & Risk Assessment\nUses OpenAI to analyze root cause, assess impact, and generate actionable recommendations."
},
"typeVersion": 1
},
{
"id": "7746b04d-d752-446f-a8de-9b574bd9962b",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
2592,
208
],
"parameters": {
"color": 7,
"width": 528,
"height": 432,
"content": "## Severity Routing & Alerts\nRoutes high-severity incidents to immediate Slack notifications, others proceed to reporting."
},
"typeVersion": 1
},
{
"id": "cbcac8e5-56f8-4f0e-8bba-fdecf53dfc81",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
3152,
176
],
"parameters": {
"color": 7,
"width": 464,
"height": 416,
"content": "## Report Generation & Distribution\nCreates formatted PDF report and delivers via email and Google Drive storage."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "",
"connections": {
"Alerts": {
"main": [
[
{
"node": "Data Recovery",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "Normalize Data",
"type": "main",
"index": 0
}
]
]
},
"Send Email": {
"main": [
[]
]
},
"Upload file": {
"main": [
[]
]
},
"Data Recovery": {
"main": [
[
{
"node": "Convert to PDF",
"type": "main",
"index": 0
}
]
]
},
"Check Severity": {
"main": [
[
{
"node": "Alerts",
"type": "main",
"index": 0
}
],
[
{
"node": "Stop and Error",
"type": "main",
"index": 0
}
]
]
},
"Convert to PDF": {
"main": [
[
{
"node": "Upload file",
"type": "main",
"index": 0
},
{
"node": "Send Email",
"type": "main",
"index": 0
}
]
]
},
"Normalize Data": {
"main": [
[
{
"node": "Root Cause + Impact Analysis",
"type": "main",
"index": 0
}
]
]
},
"Parse AI Response": {
"main": [
[
{
"node": "Check Severity",
"type": "main",
"index": 0
}
]
]
},
"Root Cause + Impact Analysis": {
"main": [
[
{
"node": "Parse AI Response",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2googleDriveOAuth2ApihtmlcsstopdfApiopenAiApislackApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Automate incident reporting from detection to delivery with AI-driven analysis and professional documentation.
Source: https://n8n.io/workflows/11733/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Transform your webinar registrations from basic form submissions into a verified, personalized, and premium attendee experience.
Creating client proposals manually is slow, repetitive, and often inconsistent. This AI-powered workflow transforms proposal creation from a manual task into a fully automated, professional process.
Transform customer feedback into actionable insights automatically with AI analysis, professional PDF reports, personalized emails, and real-time team notifications. Overview Features Demo Prerequisit
This system meticulously guides each lead through a fully automated journey, from initial contact to a personalized follow-up and CRM integration.
Creating job offer letters manually is time-consuming, error-prone, and difficult to scale. This AI-powered workflow automates the entire job offer letter process — from validating candidate emails to