backup: Workflow Errors - Daily Summary (Ollama) [2026-09-09]
This commit is contained in:
1 parent
470abc6094
commit
a33be4cea6
1 file changed
+130
-118
@@ -2,11 +2,11 @@
|
||||
"id": "p3CAqrb7AwECOBxM",
|
||||
"name": "Workflow Errors - Daily Summary (Ollama)",
|
||||
"active": true,
|
||||
"activeVersionId": "0cf28178-91f9-4712-9a0e-97eb8fef583c",
|
||||
"activeVersionId": "3b1ef346-1b8a-41ff-b663-8cca7b7ebe1b",
|
||||
"createdAt": "2026-09-05T13:23:00.159Z",
|
||||
"updatedAt": "2026-09-05T13:58:14.877Z",
|
||||
"updatedAt": "2026-09-08T16:21:46.209Z",
|
||||
"isArchived": false,
|
||||
"versionId": "0cf28178-91f9-4712-9a0e-97eb8fef583c",
|
||||
"versionId": "3b1ef346-1b8a-41ff-b663-8cca7b7ebe1b",
|
||||
"triggerCount": 1,
|
||||
"nodes": [
|
||||
{
|
||||
@@ -29,27 +29,6 @@
|
||||
],
|
||||
"id": "994dcd0a-fb6a-4393-80c5-cf20053c5fc9"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "executeQuery",
|
||||
"query": "SELECT id, occurred_at, workflow_id, workflow_name, execution_id, error_node, error_message, note\nFROM workflow_errors\nWHERE occurred_at >= NOW() - INTERVAL '6 hours'\nORDER BY workflow_name, occurred_at DESC;",
|
||||
"options": {}
|
||||
},
|
||||
"name": "Get Last 24h Errors",
|
||||
"type": "n8n-nodes-base.postgres",
|
||||
"typeVersion": 2.5,
|
||||
"position": [
|
||||
-3072,
|
||||
1072
|
||||
],
|
||||
"id": "b8460765-5d8f-4a21-9261-945482b8deb2",
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "NoPrLWbqySMMmIaI",
|
||||
"name": "Postgres n8n-quickbooks"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "const rows = $input.all().map(i => i.json);\n\nif (rows.length === 0) {\n return [{ json: { hasErrors: false, count: 0, workflowCount: 0 } }];\n}\n\n// Group errors by workflow_name\nconst byWorkflow = {};\nfor (const r of rows) {\n const wf = r.workflow_name || 'Unknown workflow';\n if (!byWorkflow[wf]) byWorkflow[wf] = [];\n byWorkflow[wf].push(r);\n}\n\nconst lines = [];\nfor (const [wf, errs] of Object.entries(byWorkflow)) {\n lines.push(`### ${wf} (${errs.length} error${errs.length > 1 ? 's' : ''})`);\n for (const e of errs) {\n lines.push(`- [${e.occurred_at}] node \"${e.error_node}\": ${e.error_message}`);\n }\n}\nconst errorBlock = lines.join('\\n');\n\nconst prompt = `You are reviewing n8n workflow execution errors from the last 24 hours for a finance automation stack. Below is the raw error log, grouped by workflow.\n\n${errorBlock}\n\nWrite a concise daily summary for a finance ops lead. For each workflow that had errors:\n1. Name the workflow and how many times it failed.\n2. Explain in plain language what's likely going wrong (group repeated/identical errors together, don't list each occurrence separately).\n3. Suggest one concrete next action to investigate or fix it.\n\nIf a workflow's errors look like an isolated, likely-transient blip (e.g., a single one-off failure), say so briefly instead of over-analyzing it. Keep the whole summary under 300 words. Use plain text with a short heading per workflow, no markdown tables.`;\n\nreturn [{ json: {\n hasErrors: true,\n count: rows.length,\n workflowCount: Object.keys(byWorkflow).length,\n prompt\n} }];"
|
||||
@@ -150,25 +129,6 @@
|
||||
],
|
||||
"id": "2ce8e18c-ea55-480e-b2c7-5ea9121284bd"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"fromEmail": "zombiepaper15@gmail.com",
|
||||
"toEmail": "mike@skyrunner.tv",
|
||||
"subject": "={{ 'Workflow Errors - Daily Summary (' + $json.count + ' errors across ' + $json.workflowCount + ' workflows)' }}",
|
||||
"html": "={{ $json.summary.replace(/\\n/g, \"<br>\") }}",
|
||||
"options": {}
|
||||
},
|
||||
"name": "Send Email",
|
||||
"type": "n8n-nodes-base.emailSend",
|
||||
"typeVersion": 2.1,
|
||||
"position": [
|
||||
-2032,
|
||||
944
|
||||
],
|
||||
"id": "a70fe46a-e607-40d8-ade2-69272eb29271",
|
||||
"webhookId": "829625b2-911e-456d-b7c2-6e7a45925142",
|
||||
"disabled": true
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"method": "POST",
|
||||
@@ -185,7 +145,53 @@
|
||||
1120
|
||||
],
|
||||
"id": "e32f01a4-e902-41ea-b530-73cf725564bf",
|
||||
"name": "Send Gotify Backup"
|
||||
"name": "Send Gotify Backup",
|
||||
"disabled": true
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"sendTo": "mnolan@masttro.com",
|
||||
"subject": "=Summary of Moneybot workflow errors (last 3 hours)",
|
||||
"emailType": "text",
|
||||
"message": "={{ $json.summary }}",
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"typeVersion": 2.2,
|
||||
"position": [
|
||||
-2032,
|
||||
928
|
||||
],
|
||||
"id": "43950bb1-852d-462a-b1c7-abf7fc9a8935",
|
||||
"name": "Send a message",
|
||||
"webhookId": "4fe8a736-1b06-413c-ab11-77bbf7041dab",
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "zmn8SCywiyJyEzyQ",
|
||||
"name": "Gmail account linktothedata"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "executeQuery",
|
||||
"query": "SELECT id, occurred_at, workflow_id, workflow_name, execution_id, error_node, error_message, note\nFROM workflow_errors\nWHERE occurred_at >= NOW() - INTERVAL '3 hours'\nORDER BY workflow_name, occurred_at DESC;",
|
||||
"options": {}
|
||||
},
|
||||
"name": "Get Last N Errors",
|
||||
"type": "n8n-nodes-base.postgres",
|
||||
"typeVersion": 2.5,
|
||||
"position": [
|
||||
-3072,
|
||||
1072
|
||||
],
|
||||
"id": "b8460765-5d8f-4a21-9261-945482b8deb2",
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "NoPrLWbqySMMmIaI",
|
||||
"name": "Postgres n8n-quickbooks"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
@@ -193,18 +199,7 @@
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Last 24h Errors",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Last 24h Errors": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Build Prompt",
|
||||
"node": "Get Last N Errors",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
@@ -255,12 +250,23 @@
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Email",
|
||||
"node": "Send Gotify Backup",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Send Gotify Backup",
|
||||
"node": "Send a message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Last N Errors": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Build Prompt",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
@@ -302,7 +308,7 @@
|
||||
}
|
||||
],
|
||||
"activeVersion": {
|
||||
"versionId": "0cf28178-91f9-4712-9a0e-97eb8fef583c",
|
||||
"versionId": "3b1ef346-1b8a-41ff-b663-8cca7b7ebe1b",
|
||||
"workflowId": "p3CAqrb7AwECOBxM",
|
||||
"nodes": [
|
||||
{
|
||||
@@ -325,27 +331,6 @@
|
||||
],
|
||||
"id": "994dcd0a-fb6a-4393-80c5-cf20053c5fc9"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "executeQuery",
|
||||
"query": "SELECT id, occurred_at, workflow_id, workflow_name, execution_id, error_node, error_message, note\nFROM workflow_errors\nWHERE occurred_at >= NOW() - INTERVAL '6 hours'\nORDER BY workflow_name, occurred_at DESC;",
|
||||
"options": {}
|
||||
},
|
||||
"name": "Get Last 24h Errors",
|
||||
"type": "n8n-nodes-base.postgres",
|
||||
"typeVersion": 2.5,
|
||||
"position": [
|
||||
-3072,
|
||||
1072
|
||||
],
|
||||
"id": "b8460765-5d8f-4a21-9261-945482b8deb2",
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "NoPrLWbqySMMmIaI",
|
||||
"name": "Postgres n8n-quickbooks"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "const rows = $input.all().map(i => i.json);\n\nif (rows.length === 0) {\n return [{ json: { hasErrors: false, count: 0, workflowCount: 0 } }];\n}\n\n// Group errors by workflow_name\nconst byWorkflow = {};\nfor (const r of rows) {\n const wf = r.workflow_name || 'Unknown workflow';\n if (!byWorkflow[wf]) byWorkflow[wf] = [];\n byWorkflow[wf].push(r);\n}\n\nconst lines = [];\nfor (const [wf, errs] of Object.entries(byWorkflow)) {\n lines.push(`### ${wf} (${errs.length} error${errs.length > 1 ? 's' : ''})`);\n for (const e of errs) {\n lines.push(`- [${e.occurred_at}] node \"${e.error_node}\": ${e.error_message}`);\n }\n}\nconst errorBlock = lines.join('\\n');\n\nconst prompt = `You are reviewing n8n workflow execution errors from the last 24 hours for a finance automation stack. Below is the raw error log, grouped by workflow.\n\n${errorBlock}\n\nWrite a concise daily summary for a finance ops lead. For each workflow that had errors:\n1. Name the workflow and how many times it failed.\n2. Explain in plain language what's likely going wrong (group repeated/identical errors together, don't list each occurrence separately).\n3. Suggest one concrete next action to investigate or fix it.\n\nIf a workflow's errors look like an isolated, likely-transient blip (e.g., a single one-off failure), say so briefly instead of over-analyzing it. Keep the whole summary under 300 words. Use plain text with a short heading per workflow, no markdown tables.`;\n\nreturn [{ json: {\n hasErrors: true,\n count: rows.length,\n workflowCount: Object.keys(byWorkflow).length,\n prompt\n} }];"
|
||||
@@ -446,25 +431,6 @@
|
||||
],
|
||||
"id": "2ce8e18c-ea55-480e-b2c7-5ea9121284bd"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"fromEmail": "zombiepaper15@gmail.com",
|
||||
"toEmail": "mike@skyrunner.tv",
|
||||
"subject": "={{ 'Workflow Errors - Daily Summary (' + $json.count + ' errors across ' + $json.workflowCount + ' workflows)' }}",
|
||||
"html": "={{ $json.summary.replace(/\\n/g, \"<br>\") }}",
|
||||
"options": {}
|
||||
},
|
||||
"name": "Send Email",
|
||||
"type": "n8n-nodes-base.emailSend",
|
||||
"typeVersion": 2.1,
|
||||
"position": [
|
||||
-2032,
|
||||
944
|
||||
],
|
||||
"id": "a70fe46a-e607-40d8-ade2-69272eb29271",
|
||||
"webhookId": "829625b2-911e-456d-b7c2-6e7a45925142",
|
||||
"disabled": true
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"method": "POST",
|
||||
@@ -481,7 +447,53 @@
|
||||
1120
|
||||
],
|
||||
"id": "e32f01a4-e902-41ea-b530-73cf725564bf",
|
||||
"name": "Send Gotify Backup"
|
||||
"name": "Send Gotify Backup",
|
||||
"disabled": true
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"sendTo": "mnolan@masttro.com",
|
||||
"subject": "=Summary of Moneybot workflow errors (last 3 hours)",
|
||||
"emailType": "text",
|
||||
"message": "={{ $json.summary }}",
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"typeVersion": 2.2,
|
||||
"position": [
|
||||
-2032,
|
||||
928
|
||||
],
|
||||
"id": "43950bb1-852d-462a-b1c7-abf7fc9a8935",
|
||||
"name": "Send a message",
|
||||
"webhookId": "4fe8a736-1b06-413c-ab11-77bbf7041dab",
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "zmn8SCywiyJyEzyQ",
|
||||
"name": "Gmail account linktothedata"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "executeQuery",
|
||||
"query": "SELECT id, occurred_at, workflow_id, workflow_name, execution_id, error_node, error_message, note\nFROM workflow_errors\nWHERE occurred_at >= NOW() - INTERVAL '3 hours'\nORDER BY workflow_name, occurred_at DESC;",
|
||||
"options": {}
|
||||
},
|
||||
"name": "Get Last N Errors",
|
||||
"type": "n8n-nodes-base.postgres",
|
||||
"typeVersion": 2.5,
|
||||
"position": [
|
||||
-3072,
|
||||
1072
|
||||
],
|
||||
"id": "b8460765-5d8f-4a21-9261-945482b8deb2",
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "NoPrLWbqySMMmIaI",
|
||||
"name": "Postgres n8n-quickbooks"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
@@ -489,18 +501,7 @@
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Last 24h Errors",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Last 24h Errors": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Build Prompt",
|
||||
"node": "Get Last N Errors",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
@@ -551,12 +552,23 @@
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Email",
|
||||
"node": "Send Gotify Backup",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Send Gotify Backup",
|
||||
"node": "Send a message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Last N Errors": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Build Prompt",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
@@ -566,10 +578,10 @@
|
||||
},
|
||||
"nodeGroups": [],
|
||||
"authors": "Michael Nolan",
|
||||
"name": "Version 0cf28178",
|
||||
"name": "Version 3b1ef346",
|
||||
"description": "",
|
||||
"autosaved": false,
|
||||
"createdAt": "2026-09-05T13:58:14.879Z",
|
||||
"updatedAt": "2026-09-05T13:58:15.975Z"
|
||||
"autosaved": true,
|
||||
"createdAt": "2026-09-08T16:21:46.211Z",
|
||||
"updatedAt": "2026-09-08T16:21:53.043Z"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user