{ "name": "Output Completion Check", "description": "Check distinct completed-record IDs, including empty and malformed output. Run a fictional local demo without an account; optionally send a count-only receipt to Keptick.", "active": false, "nodes": [ { "id": "intro-note", "name": "Read first", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -560, -340 ], "parameters": { "content": "## Output Completion Check\nConfigure the minimum and ID field, then replace the fictional records or connect a real completed-output node. Keep Always Output Data enabled on the producer so an empty batch reaches the check. The report counts distinct nonempty IDs, invalid IDs and duplicates; it does not prove business correctness. This adaptation includes only the independent local validator.\n\nOriginal workflow made by Keptick, with AI assistance. No affiliation with n8n. See README for source and license.", "width": 570, "height": 245 } }, { "id": "trigger", "name": "Run the demo", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ -540, 40 ], "parameters": {} }, { "id": "config", "name": "Configure check", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ -320, 40 ], "parameters": { "assignments": { "assignments": [ { "id": "minimum", "name": "minimumItems", "value": 1, "type": "number" }, { "id": "id-field", "name": "recordIdField", "value": "recordId", "type": "string" } ] }, "options": {} } }, { "id": "samples", "name": "Completed records", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ -70, 40 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "// Replace these fictional records, or connect your real output here.\nconst records=[{recordId:'DEMO-001'},{recordId:'DEMO-002'},{recordId:'DEMO-003'}];\nreturn records.map(json=>({json}));" }, "alwaysOutputData": true }, { "id": "guard", "name": "Check completed outputs", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 180, 40 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "function checkOutputs({records,minimumItems,recordIdField}) {\n const minimum=Number(minimumItems);\n if(!Number.isSafeInteger(minimum)||minimum<0||minimum>1000000000)throw new Error('minimumItems must be a non-negative integer, at most 1000000000.');\n const field=String(recordIdField||'').trim();\n if(!field)throw new Error('Set recordIdField to the field identifying a completed output.');\n if(!Array.isArray(records)||records.some(record=>!record||typeof record!=='object'||Array.isArray(record)))throw new Error('records must be an array of objects.');\n const rows=records.filter(record=>Object.keys(record).length>0);\n const keys=new Set();let invalidItems=0;\n for(const row of rows){\n const value=row[field];\n const valid=(typeof value==='string'&&value.trim().length>0)||(typeof value==='number'&&Number.isFinite(value));\n if(!valid){invalidItems++;continue;}\n keys.add(String(value).trim());\n }\n const items=keys.size;\n const duplicateItems=rows.length-invalidItems-items;\n return {checkPassed:items>=minimum&&invalidItems===0,checkStatus:invalidItems?'invalid_output':itemsitem.json),minimumItems:config.minimumItems,recordIdField:config.recordIdField})}];\n" } }, { "id": "preview", "name": "Inspect local result", "type": "n8n-nodes-base.noOp", "typeVersion": 1, "position": [ 720, 180 ], "parameters": {} }, { "id": "adopt-note", "name": "Use with a real workflow", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -320, 300 ], "parameters": { "content": "## Output Completion Check\nConfigure the minimum and ID field, then replace the fictional records or connect a real completed-output node. Keep Always Output Data enabled on the producer so an empty batch reaches the check. The report counts distinct nonempty IDs, invalid IDs and duplicates; it does not prove business correctness. This adaptation includes only the independent local validator.\n\nOriginal workflow made by Keptick, with AI assistance. No affiliation with n8n. See README for source and license.", "width": 760, "height": 315 } }, { "id": "monitor-note", "name": "Optional Keptick monitor", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 350, -380 ], "parameters": { "content": "## Output Completion Check\nConfigure the minimum and ID field, then replace the fictional records or connect a real completed-output node. Keep Always Output Data enabled on the producer so an empty batch reaches the check. The report counts distinct nonempty IDs, invalid IDs and duplicates; it does not prove business correctness. This adaptation includes only the independent local validator.\n\nOriginal workflow made by Keptick, with AI assistance. No affiliation with n8n. See README for source and license.", "width": 800, "height": 285 } } ], "connections": { "Run the demo": { "main": [ [ { "node": "Configure check", "type": "main", "index": 0 } ] ] }, "Configure check": { "main": [ [ { "node": "Completed records", "type": "main", "index": 0 } ] ] }, "Completed records": { "main": [ [ { "node": "Check completed outputs", "type": "main", "index": 0 } ] ] }, "Check completed outputs": { "main": [ [ { "node": "Inspect local result", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "tags": [] }