"Integration complete" is the most expensive sentence in a form-to-CRM project, because no test is attached to it. Two failures cause most of the damage after handover:
- Duplicates — the same lead is written twice (double submit, retry, or a webhook delivered twice).
- Silent loss — the CRM returns 5xx for a few seconds and the lead disappears while the visitor sees an error page.
Both pass every live demo, because a demo submits once and the CRM is healthy. So before accepting, run three scenarios in a test environment and record four columns: input, expected, actual, verdict. I ran this against a mock CRM with synthetic data (OBS-001, OBS-002) on 2026-11-21; every number below came from that run log.
Scenario 01 — one submit, one record
POST /ingest
Content-Type: application/json
{"request_id":"OBS-001","name":"Demo Alpha","email":"ops-a@example.com","type":"quote_request"}
Expected: 201 created, exactly one record, backlog 0.
Actual: 201 created, REC-0001, 1 record, 0 queued, 13 ms round trip. PASS
Scenario 02 — the same submit twice
Resend the identical body. The answer you want is not an error, and not a second record.
POST /ingest (same body as 01)
→ 200 duplicate_skipped, record_id REC-0001
Expected: 200, same record id, total 1 record, dedupe key request_id.
Actual: 200 duplicate_skipped, REC-0001, total 1 record. PASS
The dedupe key must be a business key that survives a retry: request_id, or a hash of (form id, submitted date, email). Not the CRM record id — it does not exist on the first attempt — and not a timestamp, which changes on every retry.
Scenario 03 — the CRM returns 503
POST /ingest {"request_id":"OBS-002", ...}
→ 503 unavailable (records 0, backlog 1)
clear the fault, then retry once with the same request_id
→ 201 created, REC-0002 (records 1, backlog 0)
Expected: on 503 nothing is written to the CRM, the lead goes to a queue, and one manual retry with the same key produces exactly one record.
Actual: 503 before the write, 0 records / 1 queued; then 201 created REC-0002. Final state: 2 records, 0 queued, 0 duplicates. PASS
The code that has to exist
Three independent mechanisms. If any is missing, one of the checks above fails.
@app.post("/ingest")
def ingest(payload: dict):
key = payload["request_id"]
row = db.one("SELECT crm_id FROM crm_records WHERE request_id = %s", (key,))
if row:
return {"status": "duplicate_skipped", "record_id": row["crm_id"]}, 200
try:
crm_id = crm.create(payload) # write before acknowledging
except CRMUnavailable:
db.execute("INSERT INTO retry_queue(request_id, payload) "
"VALUES (%s, %s) ON CONFLICT DO NOTHING", (key, payload))
return {"status": "unavailable"}, 503
db.execute("INSERT INTO crm_records(request_id, crm_id) VALUES (%s, %s)",
(key, crm_id))
return {"status": "created", "record_id": crm_id}, 201
CREATE TABLE crm_records (
request_id text PRIMARY KEY, -- the dedupe key, enforced by the database
crm_id text NOT NULL,
created_at timestamptz NOT NULL DEFAULT now()
);
The application-level SELECT is the fast path; the primary key is the last line of defence when two identical requests arrive within milliseconds of each other. If the delivered schema has no unique constraint on the business key, ask for it in writing — an index added later means duplicates were possible until then.
The acceptance table
| # | Input | Expected | Actual | Verdict |
|---|---|---|---|---|
| 01 |
OBS-001, one POST |
201, 1 record, 0 queued | 201 created REC-0001, 1 record, 0 queued, 13 ms |
PASS |
| 02 | identical body again | 200, same id, total 1 | 200 duplicate_skipped REC-0001, total 1 |
PASS |
| 03 |
OBS-002 with 503 injected |
503, 0 records, 1 queued | 503 unavailable, 0 records, 1 queued |
PASS |
| 03b | same key, one manual retry | 201, 1 record, 0 queued | 201 created REC-0002, total 2, 0 queued |
PASS |
A row is PASS only when the actual column was copied from a log, not from memory. I attach the run log lines and the run id to the table, and the same id is printed on the screen recording — the table cannot be edited afterwards without the recording disagreeing.
What these three checks do not cover
Write the excluded scope into the same acceptance document:
- a write that succeeded but whose response was lost on the way back (client saw a timeout, CRM has the record);
- two identical requests arriving concurrently;
- automatic retry (backoff worker) — this run verified one manual retry only.
If the build must survive those cases, they become separate rows with their own criteria and their own evidence.
Before you sign
- Ask for the test environment and run the three scenarios yourself; do not accept a screen share.
- Write
HTTP status + record count + backlog countfor each row before running it. - Mark a row FAIL on any difference, even when it looks harmless.
- Keep one run id on the log, the table and the recording.
- Put the excluded scope in the same document as the PASS rows.
If you need the table and the checks without building anything, the template (PDF, sheet, three-row acceptance table) is here: https://proof.intelliliving.kr?utm_source=devto&utm_medium=organic&utm_campaign=b2b_obsidian&utm_content=dv_01
If your team needs the test environment actually built and verified rather than the template, reply with your form tool and CRM and I will scope the three scenarios for your stack.
Top comments (0)