Files
n8n-masttro/workflows/tJSgL4iy63ys2NCA_Error_Trigger___log_to_Postgres.json

414 lines
12 KiB
JSON

{
"id": "tJSgL4iy63ys2NCA",
"name": "Error Trigger - log to Postgres",
"active": true,
"activeVersionId": "58a5a900-59fe-406e-918f-080a1e22934e",
"createdAt": "2026-05-08T19:32:41.874Z",
"updatedAt": "2026-11-04T15:49:20.347Z",
"isArchived": false,
"versionId": "58a5a900-59fe-406e-918f-080a1e22934e",
"triggerCount": 0,
"nodes": [
{
"id": "9d22a889-4ad7-41e8-91a1-caa7db9ebde2",
"name": "Error Trigger",
"type": "n8n-nodes-base.errorTrigger",
"typeVersion": 1,
"position": [
-480,
-128
],
"parameters": {}
},
{
"id": "636ca5b2-809e-4a44-b306-aa4306ada105",
"name": "Build Error Payload",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-272,
-128
],
"parameters": {
"jsCode": "const error = $input.first().json;\n\nreturn [{\n json: {\n occurred_at: new Date().toISOString(),\n workflow_id: error.workflow?.id ?? null,\n workflow_name: error.workflow?.name ?? null,\n execution_id: error.execution?.id ?? null,\n error_node: error.execution?.lastNodeExecuted ?? null,\n error_message: error.execution?.error?.message ?? null,\n stack_trace: error.execution?.error?.stack ?? null,\n note: null\n }\n}];"
}
},
{
"id": "82b4dc2b-b723-4f4e-9221-bbad9c9fec56",
"name": "Log to Postgres",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.5,
"position": [
-80,
-128
],
"parameters": {
"schema": {
"__rl": true,
"mode": "list",
"value": "public"
},
"table": {
"__rl": true,
"value": "workflow_errors",
"mode": "list",
"cachedResultName": "workflow_errors"
},
"columns": {
"mappingMode": "autoMapInputData",
"value": {
"id": 0
},
"matchingColumns": [
"id"
],
"schema": [
{
"id": "id",
"displayName": "id",
"required": false,
"defaultMatch": true,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "occurred_at",
"displayName": "occurred_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": true
},
{
"id": "workflow_id",
"displayName": "workflow_id",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "workflow_name",
"displayName": "workflow_name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "execution_id",
"displayName": "execution_id",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "error_node",
"displayName": "error_node",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "error_message",
"displayName": "error_message",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "stack_trace",
"displayName": "stack_trace",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "note",
"displayName": "note",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "created_at",
"displayName": "created_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"credentials": {
"postgres": {
"id": "NoPrLWbqySMMmIaI",
"name": "Postgres n8n-quickbooks"
}
}
}
],
"connections": {
"Error Trigger": {
"main": [
[
{
"node": "Build Error Payload",
"type": "main",
"index": 0
}
]
]
},
"Build Error Payload": {
"main": [
[
{
"node": "Log to Postgres",
"type": "main",
"index": 0
}
]
]
}
},
"nodeGroups": [],
"settings": {
"binaryMode": "separate",
"callerPolicy": "workflowsFromSameOwner",
"errorWorkflow": "ZhbHEYkXedKQCJg3",
"timeSavedMode": "fixed",
"availableInMCP": false,
"executionOrder": "v1"
},
"staticData": null,
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true
},
"tags": [],
"shared": [
{
"role": "workflow:owner",
"workflowId": "tJSgL4iy63ys2NCA",
"projectId": "X4TTvIwW8wN0Iirz",
"createdAt": "2026-05-08T19:32:41.874Z",
"updatedAt": "2026-05-08T19:32:41.874Z"
}
],
"activeVersion": {
"versionId": "58a5a900-59fe-406e-918f-080a1e22934e",
"workflowId": "tJSgL4iy63ys2NCA",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.errorTrigger",
"typeVersion": 1,
"position": [
-480,
-128
],
"id": "9d22a889-4ad7-41e8-91a1-caa7db9ebde2",
"name": "Error Trigger"
},
{
"parameters": {
"jsCode": "const error = $input.first().json;\n\nreturn [{\n json: {\n occurred_at: new Date().toISOString(),\n workflow_id: error.workflow?.id ?? null,\n workflow_name: error.workflow?.name ?? null,\n execution_id: error.execution?.id ?? null,\n error_node: error.execution?.lastNodeExecuted ?? null,\n error_message: error.execution?.error?.message ?? null,\n stack_trace: error.execution?.error?.stack ?? null,\n note: null\n }\n}];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-272,
-128
],
"id": "636ca5b2-809e-4a44-b306-aa4306ada105",
"name": "Build Error Payload"
},
{
"parameters": {
"schema": {
"__rl": true,
"mode": "list",
"value": "public"
},
"table": {
"__rl": true,
"value": "workflow_errors",
"mode": "list",
"cachedResultName": "workflow_errors"
},
"columns": {
"mappingMode": "autoMapInputData",
"value": {
"id": 0
},
"matchingColumns": [
"id"
],
"schema": [
{
"id": "id",
"displayName": "id",
"required": false,
"defaultMatch": true,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "occurred_at",
"displayName": "occurred_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": true
},
{
"id": "workflow_id",
"displayName": "workflow_id",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "workflow_name",
"displayName": "workflow_name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "execution_id",
"displayName": "execution_id",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "error_node",
"displayName": "error_node",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "error_message",
"displayName": "error_message",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "stack_trace",
"displayName": "stack_trace",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "note",
"displayName": "note",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "created_at",
"displayName": "created_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.5,
"position": [
-80,
-128
],
"id": "82b4dc2b-b723-4f4e-9221-bbad9c9fec56",
"name": "Log to Postgres",
"credentials": {
"postgres": {
"id": "NoPrLWbqySMMmIaI",
"name": "Postgres n8n-quickbooks"
}
}
}
],
"connections": {
"Error Trigger": {
"main": [
[
{
"node": "Build Error Payload",
"type": "main",
"index": 0
}
]
]
},
"Build Error Payload": {
"main": [
[
{
"node": "Log to Postgres",
"type": "main",
"index": 0
}
]
]
}
},
"nodeGroups": [],
"authors": "Michael Nolan",
"name": "Version 58a5a900",
"description": "",
"autosaved": true,
"createdAt": "2026-09-16T14:40:25.463Z",
"updatedAt": "2026-09-16T14:40:31.792Z"
}
}