Observed
Every upstream HTTP 200 response was routed as accepted, even when the JSON response body returned needs_input or failed.
Example repair packet · DEMO-001
The CAD 99 pilot includes diagnosis, a controlled patch when appropriate, validation evidence, rollback notes, and a staging checklist.
01 / Issue
Every upstream HTTP 200 response was routed as accepted, even when the JSON response body returned needs_input or failed.
The patched logic must follow the result inside the response body, catch missing lead identifiers, stop safely on unknown statuses, and preserve the incoming event ID for the client’s staging replay checks.
02 / Diagnosis
The workflow treated the HTTP-level success response as an accepted lead without reading the business result in body.status. A second mapping expected only lead_id, so payloads using leadId lost the identifier before the response step.
before: accepted = response.statusCode === 200
after: outcome = normalizeStatus(response.body?.status)
leadId = input.leadId ?? input.lead_id ?? null
03 / Safe patch
leadId and lead_id into one internal field before any branch.accepted, needs_input, and failed.04 / Validation
| Fixture | Input variation | Expected route | Observed |
|---|---|---|---|
| F-01 | lead_id + accepted | accepted | PASS · ISOLATED LOGIC |
| F-02 | leadId + accepted | accepted | PASS · ISOLATED LOGIC |
| F-03 | HTTP 200 + needs_input | needs_input | PASS · ISOLATED LOGIC |
| F-04 | HTTP 200 + failed | failed | PASS · ISOLATED LOGIC |
| F-05 | missing lead ID | validation_error | PASS · ISOLATED LOGIC |
| F-06 | unknown body status | failed_closed | PASS · ISOLATED LOGIC |
05 / Rollback plan
Import the patched JSON into a staging project, reconnect client-owned credentials, replay F-01 through F-06, and confirm downstream writes use the normalized lead ID. Offline passes are not a substitute for this n8n execution check.
Deactivate the patched workflow, reactivate the untouched original export, and replay only after the client verifies the event ID is absent from the destination log. No automatic deduplication is included.