Sample automation failure diagnostic
Executive summary
The sample workflow correctly rejects a lead with no email, returns a visible correction route, and produces matching results in the companion JavaScript and the JavaScript embedded in its n8n Code node for the tested fixture.
The most important production-readiness issue is response semantics: the workflow is configured to return HTTP 200 even when its body says ok: false. A sender or monitor relying only on HTTP status could record invalid input as accepted. Before attaching a CRM or outbound action, the path would also need explicit input ranges, duplicate protection, and verification in the intended n8n runtime.
Bounded scope
Synthetic webhook body → normalize and validate → score and route → JSON response
Reviewed: the workflow JSON, companion JavaScript, behavioral tests, parity tests, and one local test run using synthetic fixtures. Excluded: n8n import or execution, credentials, live traffic, external writes, load or security testing, repair implementation, and business-performance claims.
Acceptance test and observed result
Given the synthetic input below, the implementation must return ok: false, route to needs-correction, include an actionable email error, and match the embedded Code-node result.
{
"name": "No Email"
}
Observed synthetic result:
{
"ok": false,
"route": "needs-correction",
"errors": ["a valid email is required"]
}
Local test summary: 4 passed, 0 failed. This proves only the tested JavaScript behavior; it does not emulate n8n or demonstrate a production webhook.
Ranked findings
| Priority | Finding | Recommended control |
|---|---|---|
| High | Rejected input is configured to receive HTTP 200. | Agree and test a 4xx response or a documented body-aware caller contract. |
| High before writes | No idempotency or duplicate control exists. | Define a stable event key and test the same accepted event twice. |
| Medium | Numeric fields are coerced but not range-validated. | Reject or normalize values outside agreed integer ranges. |
| Medium | The routing threshold boundary is not directly tested. | Add fixtures immediately below and at the threshold. |
| Release blocker | Behavior in the target n8n runtime is unverified. | Import and execute valid and invalid fixtures in the intended n8n version. |
The HTTP-status finding is directly observable in the artifact. The others are risks inferred through source review, not claims that a production incident occurred.
Smallest credible repair
Starting at USD 250: agree the invalid-input contract; add appropriate status behavior and numeric range validation; test valid input, invalid email, and the routing boundary; then deliver the updated artifact, test evidence, known gaps, and handoff notes. Final scope and price are confirmed in writing first.
Apply this format to one failing path
The fixed diagnostic is USD 125, credited in full toward an agreed USD 250+ repair on the same path.
Do not send credentials or customer data. No production action is performed during the diagnostic.