{"record":{"id":"07890105bbeb12f4","repo":"Zie619/n8n-workflows","slug":"submission-id-is-missing","errorCode":null,"errorMessage":"Submission ID is missing","messagePattern":"Submission ID is missing","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"workflows/Code/0926_Code_Webhook_Create_Webhook.json","lineNumber":1605,"sourceCode":"        6340,\n        3400\n      ],\n      \"parameters\": {\n        \"jsCode\": \"const input = $input.all()[0].json;\\nconst quantityRequested= input[\\\"Quantity Requested\\\"];\\n\\nif (quantityRequested <= 0) throw new Error(`Invalid quantity Requested: ${quantityRequested}. Must be greater than 0`);\\n\\nreturn { json: input };\"\n      },\n      \"typeVersion\": 2,\n      \"notes\": \"This code node performs automated tasks as part of the workflow.\"\n    },\n    {\n      \"id\": \"6d88db70-6b4f-47c5-8093-ab339762edbe\",\n      \"name\": \"Verify Requested Quantity\",\n      \"type\": \"n8n-nodes-base.code\",\n      \"position\": [\n        6560,\n        3400\n      ],\n      \"parameters\": {\n        \"jsCode\": \"const input = $input.all()[0].json;\\nconst quantityRequested = input[\\\"Quantity Requested\\\"];\\nif (!input[\\\"Product ID\\\"]) throw new Error(\\\"Product ID is missing\\\");\\nif (quantityRequested <= 0) throw new Error(`Invalid quantity requested: ${quantityRequested}`);\\nif (!input[\\\"Submission ID\\\"]) throw new Error(\\\"Submission ID is missing\\\");\\nreturn { json: input };\"\n      },\n      \"typeVersion\": 2,\n      \"notes\": \"This code node performs automated tasks as part of the workflow.\"\n    },\n    {\n      \"id\": \"bd2313cc-e3c9-4405-a1ed-8f64969e5bca\",\n      \"name\": \"Check Available Stock for Issue\",\n      \"type\": \"n8n-nodes-base.googleSheets\",\n      \"position\": [\n        7000,\n        3240\n      ],\n      \"parameters\": {\n        \"options\": {},\n        \"filtersUI\": {\n          \"values\": [\n            {\n              \"lookupValue\": \"={{ $json[\\\"Product ID\\\"] }}\",","sourceCodeStart":1587,"sourceCodeEnd":1623,"githubUrl":"https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/0926_Code_Webhook_Create_Webhook.json#L1587-L1623","documentation":"Thrown by 'Verify Requested Quantity' when the payload lacks `Submission ID`. Submission ID is the correlation key used to retrieve the issue request row from Google Sheets ('Retrieve Issue Request Details') and to update it after approval; without it the rest of the flow cannot match records.","triggerScenarios":"Form or API client omitted Submission ID; key named differently (submission_id, SubmissionID); the field present but empty string (empty string is falsy so it throws); payload lost the field in a Set/Function node upstream.","commonSituations":"Submission ID generated downstream instead of supplied by the requester; form edits removing the hidden ID field; manual testing without copying the full payload.","solutions":["Ensure the request form/webhook client always sends Submission ID (hidden field, UUID) and with the exact key.","If the system should generate it, generate before this node and skip this check for new submissions.","Include Object.keys(input) in the error message to catch key-name mismatches fast.","Validate presence and format (non-empty, expected pattern) at the webhook entry."],"exampleFix":"// before\nif (!input[\"Submission ID\"]) throw new Error(\"Submission ID is missing\");\n\n// after\nconst submissionId = input[\"Submission ID\"] ?? input[\"submission_id\"];\nif (typeof submissionId !== 'string' || submissionId.trim() === '') {\n  throw new Error(`Submission ID is missing (fields received: ${Object.keys(input).join(', ')})`);\n}","handlingStrategy":"validation","validationCode":"const submissionId = input['Submission ID'] ?? input['submission_id'];\nif (typeof submissionId !== 'string' || submissionId.trim() === '') {\n  throw new Error(`Submission ID is missing (fields: ${Object.keys(input).join(', ')})`);\n}","typeGuard":"const isNonEmptyString = (v) => typeof v === 'string' && v.trim().length > 0;","tryCatchPattern":null,"preventionTips":["Embed Submission ID in every submission and approval link","Accept common key aliases and normalize once","Validate correlation keys at the webhook entry","Check for empty string, not just falsy, and report received fields"],"tags":["n8n","webhook","required-field","correlation-key","validation"],"backgroundTag":null,"analyzedSha":"94007c1445d9258a7da116646b79473e7c7c3282","analyzedAt":"2026-08-15T04:10:37.591Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}