{ "kind": "open-flow-workflow", "version": 1, "name": "n8n Silent Workflow Check", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_2d5ae80eb7564f4e": { "name": "Every morning", "kind": "cron", "cronTimes": [ { "type": "cron", "expression": "0 8 * * *", "timezone": "UTC" } ] }, "n_6f0231d971ed5d00": { "inputs": { "limit": { "kind": "value", "value": 250 } }, "name": "Read workflow page", "kind": "task", "task": { "inputs": [ { "description": "Filter workflows by active state.", "jsonSchema": { "type": "boolean", "description": "Filter workflows by active state." }, "nullable": true, "handle": "active", "value": null }, { "description": "Filter workflows by a comma-separated set of tag names.", "jsonSchema": { "type": "array", "items": { "type": "string", "minLength": 1, "description": "A tag name to filter by." }, "minItems": 1, "description": "Filter workflows by a comma-separated set of tag names." }, "nullable": true, "handle": "tags", "value": null }, { "description": "Filter workflows by name.", "jsonSchema": { "type": "string", "minLength": 1, "description": "Filter workflows by name." }, "nullable": true, "handle": "name", "value": null }, { "description": "An n8n resource identifier.", "jsonSchema": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "nullable": true, "handle": "projectId", "value": null }, { "description": "Avoid retrieving pinned data.", "jsonSchema": { "type": "boolean", "description": "Avoid retrieving pinned data." }, "nullable": true, "handle": "excludePinnedData", "value": null }, { "description": "The maximum number of items to return.", "jsonSchema": { "type": "integer", "minimum": 1, "maximum": 250, "description": "The maximum number of items to return." }, "nullable": true, "handle": "limit", "value": null }, { "description": "The cursor returned by a previous n8n list response.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The cursor returned by a previous n8n list response." }, "nullable": true, "handle": "cursor", "value": null } ], "outputs": [ { "description": "Workflows returned for the requested page.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "The n8n workflow identifier." }, "name": { "type": "string", "minLength": 1, "description": "The workflow name." }, "active": { "type": "boolean", "description": "Whether the workflow is active." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "isArchived": { "type": "boolean", "description": "Whether the workflow is archived." }, "versionId": { "type": "string", "minLength": 1, "description": "The current workflow version identifier." }, "triggerCount": { "type": "integer", "description": "The number of active trigger nodes in the workflow." }, "nodes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "An n8n workflow node." }, "description": "Workflow nodes returned by n8n." }, "connections": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow connections keyed by node name." }, "settings": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow settings returned by n8n." }, "tags": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "name": { "type": "string", "minLength": 1, "description": "The tag name." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." } }, "required": [ "name" ], "additionalProperties": false, "description": "An n8n tag." }, "description": "Tags attached to the workflow." } }, "required": [ "id", "name", "nodes", "connections", "settings" ], "additionalProperties": true, "description": "An n8n workflow object returned by the public API." }, "description": "Workflows returned for the requested page." }, "nullable": false, "handle": "data" }, { "description": "The cursor for the next page when present.", "jsonSchema": { "type": [ "string", "null" ], "description": "The cursor for the next page when present." }, "nullable": true, "handle": "nextCursor" } ], "name": "Read workflow page", "executor": { "kind": "connector", "action": "n8n.list_workflows" } } }, "n_d031d2b73456afc3": { "inputs": { "limit": { "kind": "value", "value": 250 } }, "name": "Read execution page", "kind": "task", "task": { "inputs": [ { "description": "Whether to include detailed execution data.", "jsonSchema": { "type": "boolean", "description": "Whether to include detailed execution data." }, "nullable": true, "handle": "includeData", "value": null }, { "description": "Whether to redact execution data in the response.", "jsonSchema": { "type": "boolean", "description": "Whether to redact execution data in the response." }, "nullable": true, "handle": "redactExecutionData", "value": null }, { "description": "An n8n execution status.", "jsonSchema": { "type": "string", "enum": [ "canceled", "crashed", "error", "new", "running", "success", "unknown", "waiting" ], "description": "An n8n execution status." }, "nullable": true, "handle": "status", "value": null }, { "description": "An n8n resource identifier.", "jsonSchema": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "nullable": true, "handle": "workflowId", "value": null }, { "description": "An n8n resource identifier.", "jsonSchema": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "nullable": true, "handle": "projectId", "value": null }, { "description": "The maximum number of items to return.", "jsonSchema": { "type": "integer", "minimum": 1, "maximum": 250, "description": "The maximum number of items to return." }, "nullable": true, "handle": "limit", "value": null }, { "description": "The cursor returned by a previous n8n list response.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The cursor returned by a previous n8n list response." }, "nullable": true, "handle": "cursor", "value": null } ], "outputs": [ { "description": "Executions returned for the requested page.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "description": "The n8n execution identifier." }, "data": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Detailed execution data included when requested." }, "finished": { "type": "boolean", "description": "Whether the execution has finished." }, "mode": { "type": "string", "enum": [ "cli", "error", "integrated", "internal", "manual", "retry", "trigger", "webhook", "evaluation", "chat" ], "description": "An n8n execution mode." }, "retryOf": { "type": [ "integer", "null" ], "description": "The original execution ID when this execution is a retry." }, "retrySuccessId": { "type": [ "integer", "null" ], "description": "The successful retry execution ID when returned by n8n." }, "startedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "stoppedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "workflowId": { "anyOf": [ { "type": "integer", "description": "A numeric workflow ID." }, { "type": "string", "description": "A string workflow ID." } ], "description": "The workflow ID associated with the execution." }, "waitTill": { "type": [ "string", "null" ], "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "customData": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Custom execution data returned by n8n." }, "status": { "type": "string", "enum": [ "canceled", "crashed", "error", "new", "running", "success", "unknown", "waiting" ], "description": "An n8n execution status." } }, "required": [ "id" ], "additionalProperties": true, "description": "An n8n execution object returned by the public API." }, "description": "Executions returned for the requested page." }, "nullable": false, "handle": "data" }, { "description": "The cursor for the next page when present.", "jsonSchema": { "type": [ "string", "null" ], "description": "The cursor for the next page when present." }, "nullable": true, "handle": "nextCursor" } ], "name": "Read execution page", "executor": { "kind": "connector", "action": "n8n.list_executions" } } }, "n_6990ea8f4a3898f1": { "inputs": { "workflows": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6f0231d971ed5d00", "output": "data" } ] }, "executions": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d031d2b73456afc3", "output": "data" } ] }, "staleHours": { "kind": "value", "value": 26 }, "now": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2d5ae80eb7564f4e", "output": "scheduledAt" } ] }, "workflowCursor": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6f0231d971ed5d00", "output": "nextCursor" } ] }, "executionCursor": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d031d2b73456afc3", "output": "nextCursor" } ] } }, "name": "Find silent workflows", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "The n8n workflow identifier." }, "name": { "type": "string", "minLength": 1, "description": "The workflow name." }, "active": { "type": "boolean", "description": "Whether the workflow is active." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "isArchived": { "type": "boolean", "description": "Whether the workflow is archived." }, "versionId": { "type": "string", "minLength": 1, "description": "The current workflow version identifier." }, "triggerCount": { "type": "integer", "description": "The number of active trigger nodes in the workflow." }, "nodes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true, "description": "An n8n workflow node." }, "description": "Workflow nodes returned by n8n." }, "connections": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow connections keyed by node name." }, "settings": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Workflow settings returned by n8n." }, "tags": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "An n8n resource identifier." }, "name": { "type": "string", "minLength": 1, "description": "The tag name." }, "createdAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "updatedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." } }, "required": [ "name" ], "additionalProperties": false, "description": "An n8n tag." }, "description": "Tags attached to the workflow." } }, "required": [ "id", "name", "nodes", "connections", "settings" ], "additionalProperties": true, "description": "An n8n workflow object returned by the public API." }, "description": "Workflows returned for the requested page." }, "nullable": false, "handle": "workflows" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "description": "The n8n execution identifier." }, "data": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Detailed execution data included when requested." }, "finished": { "type": "boolean", "description": "Whether the execution has finished." }, "mode": { "type": "string", "enum": [ "cli", "error", "integrated", "internal", "manual", "retry", "trigger", "webhook", "evaluation", "chat" ], "description": "An n8n execution mode." }, "retryOf": { "type": [ "integer", "null" ], "description": "The original execution ID when this execution is a retry." }, "retrySuccessId": { "type": [ "integer", "null" ], "description": "The successful retry execution ID when returned by n8n." }, "startedAt": { "type": "string", "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "stoppedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "workflowId": { "anyOf": [ { "type": "integer", "description": "A numeric workflow ID." }, { "type": "string", "description": "A string workflow ID." } ], "description": "The workflow ID associated with the execution." }, "waitTill": { "type": [ "string", "null" ], "format": "date-time", "description": "An ISO 8601 timestamp returned by n8n." }, "customData": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Custom execution data returned by n8n." }, "status": { "type": "string", "enum": [ "canceled", "crashed", "error", "new", "running", "success", "unknown", "waiting" ], "description": "An n8n execution status." } }, "required": [ "id" ], "additionalProperties": true, "description": "An n8n execution object returned by the public API." }, "description": "Executions returned for the requested page." }, "nullable": false, "handle": "executions" }, { "jsonSchema": { "type": "number" }, "nullable": false, "handle": "staleHours" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "now" }, { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "workflowCursor" }, { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "executionCursor" } ], "outputs": [ { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "silent" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "activeChecked" }, { "jsonSchema": { "type": "array", "items": { "type": "object" } }, "nullable": false, "handle": "findings" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "workflowPageLimited" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "executionPageLimited" } ], "name": "Find silent workflows", "moduleId": "n_4b6d05e94e3d20aa", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_08f7fc09f2e77fed": { "name": "Workflow silence report", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "silent" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "activeChecked" }, { "jsonSchema": { "type": "array", "items": { "type": "object" } }, "nullable": false, "handle": "findings" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "workflowPageLimited" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "executionPageLimited" } ], "outputMappings": { "silent": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6990ea8f4a3898f1", "output": "silent" } ] }, "activeChecked": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6990ea8f4a3898f1", "output": "activeChecked" } ] }, "findings": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6990ea8f4a3898f1", "output": "findings" } ] }, "workflowPageLimited": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6990ea8f4a3898f1", "output": "workflowPageLimited" } ] }, "executionPageLimited": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6990ea8f4a3898f1", "output": "executionPageLimited" } ] } } } }, "edges": [ { "source": "n_2d5ae80eb7564f4e", "target": "n_6f0231d971ed5d00" }, { "source": "n_6f0231d971ed5d00", "target": "n_d031d2b73456afc3" }, { "source": "n_d031d2b73456afc3", "target": "n_6990ea8f4a3898f1" }, { "source": "n_6990ea8f4a3898f1", "target": "n_08f7fc09f2e77fed" } ] } }, "modules": { "n_4b6d05e94e3d20aa": { "name": "Find silent workflows", "imports": [], "source": "export default function findSilent({workflows, executions, staleHours, now, workflowCursor, executionCursor}) {\n if (!Array.isArray(workflows) || !Array.isArray(executions)) throw new Error('Workflow and execution pages must be arrays');\n if (!Number.isFinite(staleHours) || staleHours <= 0) throw new Error('staleHours must be a positive number');\n const timestamp = new Date(now).getTime();\n if (!Number.isFinite(timestamp)) throw new Error('now must be a valid timestamp');\n const active = workflows.filter(workflow => workflow.active && !workflow.isArchived);\n const latest = new Map();\n for (const execution of executions) {\n const id = String(execution.workflowId);\n const started = new Date(execution.startedAt || execution.createdAt).getTime();\n if (!Number.isFinite(started)) continue;\n if (!latest.has(id) || started > latest.get(id)) latest.set(id, started);\n }\n const threshold = timestamp - staleHours * 3600000;\n const findings = [];\n for (const workflow of active) {\n const last = latest.get(String(workflow.id));\n if (last === undefined) findings.push({ workflow: workflow.name, workflowId: workflow.id, lastRun: null, hoursSilent: null, note: 'no execution in the window' });\n else if (last < threshold) findings.push({ workflow: workflow.name, workflowId: workflow.id, lastRun: new Date(last).toISOString(), hoursSilent: Math.round((timestamp - last) / 3600000), note: 'active but stalled' });\n }\n return { silent: findings.length, activeChecked: active.length, findings, workflowPageLimited: Boolean(workflowCursor), executionPageLimited: Boolean(executionCursor) };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }