معماری چندکسبوکاری، تجاری و تجارت الکترونیک · فصل ۴ — IA، Configurator، Lead، Audit و Research · 244
Lead Forms and CRM Handoff
Build a lead-to-CRM handoff contract with explicit field/property mapping, provenance, validation, consent context, idempotency or deduplication key, submission state, retry behavior and reconciliation evidence; keep the website and CRM schemas decoupled enough to detect drift instead of hiding it. میتواند «Lead Forms و CRM Handoff» را برای یک workflow محدود با state/contract/approval و verification مناسب طراحی کند.
Lesson summary
Build a lead-to-CRM handoff contract with explicit field/property mapping, provenance, validation, consent context, idempotency or deduplication key, submission state, retry behavior and reconciliation evidence; keep the website and CRM schemas decoupled enough to detect drift instead of hiding it.
میتواند «Lead Forms و CRM Handoff» را برای یک workflow محدود با state/contract/approval و verification مناسب طراحی کند.
This lesson produces
میتواند «Lead Forms و CRM Handoff» را برای یک workflow محدود با state/contract/approval و verification مناسب طراحی کند.
Who it is for
Foundation
Use a field map, one worked scenario and explicit state vocabulary before independent construction.
Repair
Identify the failed evidence dimension, use the smallest mutated fixture and rerun only the affected gate.
Experienced
Compress definitions; require trade-off defense, counterexample analysis and changed-context transfer.
Prerequisites
1) The problem this lesson solves
A “form submitted successfully” message does not prove the intended lead reached the CRM correctly. A property can be renamed, a type can drift, consent context can disappear, or a retry can create a duplicate.
2) Lesson boundary
The owned artifact is Lead-to-CRM Handoff Contract v1. This lesson does not own the preceding plan configurator or the following website audit, and it performs no live CRM mutation.
3) Fact: a property is more than a label
HubSpot CRM property metadata includes fields such as name, label, type, fieldType, options and formField. An integration should use the governed internal property contract rather than display labels as stable keys.
4) Fact: form lifecycle has multiple states
HubSpot documentation separates callbacks before submission from onFormSubmitted after persistence and also documents server-side submission errors. A click or pre-submit event is not the same as persisted submission evidence.
5) Inference: form persistence is still not CRM reconciliation
Even after a form submission persists, you still need evidence that fields mapped to the intended CRM properties, normalization was valid and the intended record was created or updated.
6) Design: preserve submission identity
submission_id remains traceable from first handoff through retries and reconciliation. A retry must not erase the identity or outcome ambiguity of the earlier attempt.
7) Do not reconstruct source intent from CRM labels
Capture source_page_id and source_intent at the web edge. Do not later infer original intent from lifecycle stage, campaign labels or CRM presentation fields.
8) Make field-to-property mapping explicit
Each web field maps to a specific current CRM property with type and allowed options. Rename or schema drift should stop the handoff instead of silently dropping data.
9) Validation and normalization are different
type_validation asks whether payload data matches the destination contract. normalization_result records what the actual transformation produced. Keep the rule and the result separately auditable.
10) Carry consent context with the handoff
Consent cannot be inferred from submission success or the existence of a CRM record. Preserve the context supplied with that specific submission as separate evidence.
11) A timeout can hide a successful write
The CRM may create a record before the client sees a timeout. Blindly retrying CREATE can duplicate the lead; dedupe/idempotency plus lookup/reconciliation is required.
12) Core Evidence Contract
The artifact has 20 dimensions, 15 critical. The compact table below shows the baseline while JSON/CSV retains the complete mapping contract.
| Submission | Source intent | Mapping | Validation | Consent | Dedupe / retry | Operation | CRM response | Reconciliation |
|---|---|---|---|---|---|---|---|---|
| SUB-244-001 | compare-business-plan | mapped | PASS | present | retry 0 | UPDATE | CRM-RESP-001 | SYNCED |
| SUB-244-002 | request-enterprise-demo | stale property | FAIL | present | retry 0 | REJECT | validation fail | HOLD_MAPPING_DRIFT |
| SUB-244-003 | request-enterprise-demo | mapped | PASS | present | retry 1; prior write ambiguous | UPSERT_OR_RECONCILE | timeout | DEDUPE_RECONCILIATION_REQUIRED |
13) Browser success is not the CRM response
crm_response_ref is downstream evidence. A success message or browser callback is only a lifecycle signal and cannot fabricate record correctness.
14) SYNCED is an evidence-backed state
The handoff reaches SYNCED only when mapping, validation, consent, dedupe, operation, response and reconciliation evidence are sufficient. Otherwise preserve RETRY, MANUAL_REVIEW, HOLD or BLOCKED states.
15) Lab and transfer
The lab has eight fixtures and 48 assertions. In transfer, a new property becomes required, an enumeration gains allowed values and a retry arrives after a hidden successful write. Recompute mapping and dedupe from changed evidence instead of copying the baseline.
Assessment
There is no answer key in this lesson pack; answer it yourself and mark honestly. "Needs review" sends the lesson to your review queue.
COM-003-S1 retrieval
What does COM-003 own, and why is a browser/form success event insufficient to prove CRM handoff correctness?
COM-003-S2 application
Build Lead-to-CRM Handoff Contract v1 for the baseline synthetic submission.
COM-003-S3 diagnosis
A CRM property internal name changes and a request timeout may have followed a successful write. Which states block blind retry and what evidence repairs them?
COM-003-S4 transfer
A lifecycle-stage property becomes required, an enumeration changes, and a retry arrives after hidden success. Recompute mapping, validation, dedupe and reconciliation from current evidence.
Assessment rubric
Blocking dimensions: submission/source identity, current field-property map, type validation, normalization result, consent context, dedupe key, operation, CRM response, retry history, reconciliation state, owner and evidence. A browser success event cannot compensate for missing downstream reconciliation evidence.
References & freshness
Case studies
A plan form maps stable internal fields to current CRM properties and reconciles to one existing contact.
The website keeps sending an old CRM internal property name after the CRM property was renamed.
A lifecycle-stage property becomes required, enum options change, and a retry arrives after a hidden successful write.
Lesson visuals
Validated payload flows through mapping, normalization and consent, dedupe, CRM operation and response, then reconciliation to synced or typed non-success states.
Lab files
python run_checks.py را اجرا کنید. هشت fixture مصنوعی drift نگاشت property، type/required validation، consent، retry مبهم و dedupe، response downstream و transfer را تست میکنند. شبکه، API key یا دادهٔ مشتری لازم نیست.