FLOWLOGIC
module /data-shaping-and-validation

unit U44 of 5

The quarantine branch

set aside, reconcile, alert on a spike

A record that fails validation has to go somewhere. Throwing kills the run and takes the healthy records with it. Silently dropping it means the client is missing data nobody can account for. The durable answer is a quarantine branch: the record is set aside with the reason it failed, the rest of the batch continues, and someone can look at what accumulated.

Wire it as a Router on the validation result. Valid records take the main path. Invalid ones go to a store — a table, a sheet, a dedicated queue — carrying three things: the raw payload exactly as it arrived, the specific problems found, and a timestamp. The raw payload matters most: without it you cannot replay the record once the mapping is fixed, and "we know 40 leads failed but not what they contained" is a conversation with a client you do not want to have.

Where it breaks: quarantining without reconciling. A branch that quietly fills a table nobody reads is only marginally better than dropping the record. Compare processed plus quarantined against received on every run, and alert when the quarantine rate crosses a threshold — a sudden spike almost always means the source changed its payload shape, not that the customers got worse.

worked example

The quarantine branch — enough context to replay the record once the mapping is fixed.

{
  "quarantinedAt": "2026-08-11T14:05:11Z",
  "source": "acme-portal",
  "problems": ["email", "dealSize type"],
  "raw": {
    "full_name": "Dana Reyes",
    "company": "Acme Ltd",
    "dealSize": "12 units",
    "utm": { "source": "linkedin" }
  },
  "reconciliation": {
    "received": 812,
    "processed": 796,
    "quarantined": 16,
    "note": "processed + quarantined MUST equal received"
  }
}

field checklist

common failure — A quarantine table nobody read

A pipeline routed invalid leads to a quarantine table and reported success every night. The source portal changed a field name, so 30% of leads began failing validation, and because nothing reconciled counts or alerted on the rate, six weeks of leads sat unnoticed. Compare processed plus quarantined against received on every run, and alert when the quarantine rate crosses a threshold.

check your understanding

A record fails validation and is routed to quarantine. Select everything that must be stored with it.

  • select every one that applies — partial answers are marked wrong

next unit opens once this is passed

sandbox validation

The check above confirms you followed the unit. Marking the module COMPLETED takes more: build the automation in your own engine and submit the exported flow and its run evidence, signed, to your unique validation URL. See the module page for that spec.