{"record":{"id":"7a024721b0b5fb95","repo":"Zie619/n8n-workflows","slug":"product-id-is-missing","errorCode":null,"errorMessage":"Product ID is missing","messagePattern":"Product 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 issue-request webhook payload has no `Product ID`. Product ID is the join key for the stock lookup in Google Sheets ('Check Available Stock for Issue'), so the workflow cannot proceed without it.","triggerScenarios":"Form submitted with Product ID blank or omitted; field named differently (e.g. 'product_id' or 'Product'); payload truncated by size limits or transformation between webhook and this node.","commonSituations":"Optional product selector in the form; renaming form fields without updating downstream n8n references; copy-paste errors in manual API calls.","solutions":["Make Product ID required in the submission form and match the exact key 'Product ID'.","Log Object.keys(input) in the error to expose the real field names when mismatches occur.","Validate at the webhook entry and return a 400-style response to the submitter immediately.","If IDs arrive in different cases, normalize keys once (e.g. map product_id -> 'Product ID') in a single normalization node."],"exampleFix":"// before\nif (!input[\"Product ID\"]) throw new Error(\"Product ID is missing\");\n\n// after\nconst productId = input[\"Product ID\"] ?? input[\"product_id\"];\nif (typeof productId !== 'string' || productId.trim() === '') {\n  throw new Error(`Product ID is missing (available fields: ${Object.keys(input).join(', ')})`);\n}","handlingStrategy":"validation","validationCode":"const productId = input['Product ID'] ?? input['product_id'];\nif (typeof productId !== 'string' || productId.trim() === '') {\n  throw new Error(`Product ID is missing (fields: ${Object.keys(input).join(', ')})`);\n}","typeGuard":"const isNonEmptyString = (v) => typeof v === 'string' && v.trim().length > 0;","tryCatchPattern":null,"preventionTips":["Make Product ID required in the form with the exact key","List received fields in the error to surface key mismatches","Normalize key aliases in one node early in the flow","Validate required keys at the webhook entry"],"tags":["n8n","webhook","required-field","inventory","validation"],"backgroundTag":null,"analyzedSha":"94007c1445d9258a7da116646b79473e7c7c3282","analyzedAt":"2026-08-15T04:10:37.591Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}