FSMA 204 Traceability in a Lakehouse: Turn a 24-Hour FDA Request Into a Query

A food safety traceability request can expose weaknesses that stay hidden during normal operations. Here is how to model Critical Tracking Events, Key Data Elements and lot genealogy so the full history of a lot is one query away.

7 CTEs mapped 5-entity data model TLC genealogy Bronze, Silver, Gold on Databricks 24-hour export
Seaflux Insights 15 min read For food supply chain CTOs and data architects
trace --lot TLC-0417-A --direction both Illustrative lot journey
HRVFarmHarvesting
PCKPackerInitial packing
TRFManufacturerTransformation
SHP3PL / DCShipping
RCVRetailerReceiving

Every hop is an event. Every event points back to the system that recorded it.

Key takeaways
FSMA 204 makes traceability a data architecture problem: the records exist, but they are scattered across ERP, WMS, MES and 3PL systems.
Model events and relationships, not application tables: five entities cover product, lot, location, event and lot genealogy.
Keep parent and child TLC links from recorded transformation events so forward and backward traces are reliable.
A medallion lakehouse plus a predefined, validated query turns the 24-hour FDA request into a repeatable process.

A manufacturer may have lot numbers in its ERP, receiving records in its WMS, shipment details in a third-party logistics portal and transformation records in a production system. Each application holds part of the story, and reconstructing the complete movement of a food lot can still take hours of manual coordination.

FSMA 204 traceability turns this into a data architecture problem. The FDA Food Traceability Rule requires covered businesses that manufacture, process, pack or hold foods on the Food Traceability List to keep specific records for defined activities across the food supply chain, and to produce them quickly when the FDA asks.

For food supply chain CTOs and data architects, the engineering question is simple: can your organization retrieve the history of a lot without collecting spreadsheets from five different systems?

This guide shows how to build an FSMA 204 traceability data model in a lakehouse that connects Critical Tracking Events (CTEs), Key Data Elements (KDEs), Traceability Lot Codes (TLCs) and ERP, WMS, MES and 3PL data, so that a 24-hour FDA traceability request becomes a predefined query instead of a project. The approach also supports wider food recall readiness, because the same records that answer the FDA answer your own quality team.

If the history of a lot depends on who is in the office that day, the organization does not have traceability. It has a search party.
01 · REGULATION

What FSMA 204 Traceability Requires From Your Data

Before designing tables, understand the FSMA 204 data requirements your model has to satisfy.

7 Critical Tracking Event categories defined by the FDA
24 hrs to provide records after an FDA request, unless a longer time is agreed
Jul 20, 2028 current compliance date for the Food Traceability Rule
2 yrs minimum retention period for required traceability records

The Food Traceability List (FTL) identifies the foods covered by the additional traceability requirements. It includes categories such as certain fresh fruits and vegetables, seafood, cheeses, shell eggs and nut butters, and it also reaches foods that contain listed ingredients under defined conditions. The rule does not apply automatically to every food product a company handles, and some exemptions apply.

The Seven Critical Tracking Events

For covered activities, the FDA defines seven Critical Tracking Event categories. The Key Data Elements depend on the event being performed, as the FDA CTE and KDE overview sets out event by event.

Harvesting

Recorded for raw agricultural commodities not obtained from a fishing vessel.

Cooling before initial packing

Recorded when a raw agricultural commodity is cooled before it is packed.

Initial packing TLC assigned

Recorded when a raw agricultural commodity, other than food from a fishing vessel, is packed for the first time.

First land-based receiving TLC assigned

Recorded for food obtained from fishing vessels.

Shipping

Recorded when food leaves a location.

Receiving

Recorded when food arrives at a location.

Transformation TLC assigned

Recorded when food is manufactured, processed, commingled, repacked or relabeled.

Events marked TLC assigned are where a Traceability Lot Code is generally created. Shipping and receiving pass the existing code along.

Compliance Timeline

November 2022

FDA publishes the Food Traceability Final Rule, implementing Section 204(d) of FSMA.

March 2025

FDA announces its intent to extend the compliance date by 30 months.

November 2025

Congress directs the FDA not to enforce the rule before July 20, 2028.

January 20, 2026

The original compliance date passes without enforcement.

July 20, 2028

Current compliance date. Records must be ready to produce on request.

24-Hour Records vs Electronic Sortable Spreadsheet

Two different obligations are often confused. Your export design needs to handle both.

Every FDA request
Records within 24 hours

Required records must be provided within 24 hours of a request, or within another reasonable time the agency agrees to. Format is not prescribed.

Public health situations
Electronic sortable spreadsheet

When the FDA needs records to prevent or mitigate a foodborne illness outbreak, assist in a recall or address another public health threat, records must also come as an electronic sortable spreadsheet, subject to limited exemptions.

Covered businesses must also maintain a written traceability plan and keep the required records for two years. Your data model should therefore separate mandatory KDEs from extra operational fields. Companies often retain additional data for inventory, quality or commercial reporting, and that is useful, but it should never be confused with what the regulation requires.

02 · DATA MODEL

How to Design an FSMA 204 Food Traceability Data Model

A useful food traceability data model organizes information around events and relationships rather than treating each source application as an isolated reporting dataset. A practical design uses five core entities.

FSMA 204 food traceability data model with product, traceability lot, location, event and lot relationship entities describes involves occurs at parent / child created by ENTITYProductproduct_iddescription, categoryftl_indicator ENTITYTraceability Lottlc, tlc_sourceproduct_idassignment_event ENTITYLocationlocation_id, nameaddresslocation_type RELATIONSHIPLot Relationshipparent_tlc, child_tlctransformation_eventquantity ENTITYEvent (CTE)event_id, cte_typetimestamp, locationsource_system
The five-entity model. Lot identity stays separate from the events that involve it.
Entity
Purpose
Example fields
Product
Identifies the food and its FTL status
Product ID, description, category, FTL indicator
Traceability lot
Identifies a traceability lot
TLC, TLC source, product ID, assignment event
Location
Identifies supply chain participants and facilities
Location ID, name, address, location type
Event
Records a CTE and when it occurred
Event ID, CTE type, timestamp, location, source
Lot relationship
Connects input and output lots
Parent TLC, child TLC, transformation event, quantity

This structure separates the identity of a lot from the events that involve it. Every event carries a stable identifier and a reference to the source system it came from, so an investigator can trace any record back to the original ERP transaction, warehouse receipt or carrier document.

If you are deciding where this model should live, our guide on data lake vs data warehouse explains why a lakehouse suits workloads that need both raw source history and governed, query-ready tables.

03 · CTEs AND KDEs

Mapping Critical Tracking Events (CTEs) and Key Data Elements (KDEs)

Critical Tracking Events form the backbone of the traceability model. Each event should share a common set of metadata fields and carry a type-specific KDE structure. A common event envelope can look like this:

traceability_event Common envelope
event_id
Stable identifier for the event
event_type
One of the seven CTE categories
event_timestamp
When the event occurred
location_id
Where the event occurred
source_system
ERP, WMS, MES, TMS or 3PL that recorded it
source_record_id
The original transaction or document reference
product_id
The food involved
traceability_lot_code
The TLC the event applies to
event_status
Validation state of the record
ingestion_timestamp
When the lakehouse received it
record_version
Version number for corrections

Event-specific data then sits in structured detail tables or validated payloads. For example:

Shipping
Shipping event
TLC and product description
Quantity and unit of measure
Ship-from and ship-to locations
Shipping date
Reference documents where applicable
Receiving
Receiving event
TLC and product description
Quantity received and unit of measure
Receiving location
Date of receipt
Relevant reference documents
Transformation
Transformation event
Input lot identifiers
Output lot identifiers
Product descriptions
Quantities and units
Transformation location and date
Important

These examples are not a complete list. Map the required KDEs for every event your facilities perform against the applicable FDA requirements.

A KDE mapping table keeps that relationship explicit and auditable:

Event type
KDE definition
Source field
Validation rule
Shipping
Shipping location
ERP / TMS
Valid location reference
Shipping
TLC
ERP / WMS
Must reference an existing lot
Receiving
Receiving location
WMS
Must match facility master
Receiving
Date received
WMS
Valid event timestamp
Transformation
Input lot
MES / ERP
Existing source lot
Transformation
Output lot
MES / ERP
Valid assigned output lot

This mapping layer matters because source applications rarely use the same field names or formats. The integration layer has to establish whether these values refer to the same traceability identity before any KDE can be trusted.

Warehouse (WMS)batch_ref
ERPproduction_lot
3PL portalconsignment_lot
Canonical identity traceability_lot_code Original values kept beside it
04 · GENEALOGY

Building Traceability Lot Code (TLC) Genealogy Across the Food Supply Chain

A Traceability Lot Code identifies a traceability lot at the applicable point in the food supply chain. Under the rule, TLCs are generally assigned at initial packing, first land-based receiving and transformation, and they are passed along, not reassigned, when food is simply shipped or received. A TLC is not an inventory batch field that can be overwritten whenever product moves between facilities.

A common lot traceability data model mistake is storing only the latest lot identifier against the current inventory record. That makes it very hard to reconstruct how input lots became finished products. Consider a food manufacturer receiving two ingredient lots:

Two input lots combine in a transformation event to create finished lot C, which is then shipped as distribution lot C Input Lot Arole: input Input Lot Brole: input Transformationevent_id, qty, uom Finished Lot Cnew TLC assigned Shipping EventTLC passed along Distribution Lot Csame TLC
The transformation event preserves both input lots and the resulting output lot.

The lakehouse should therefore maintain a lot genealogy table with fields such as:

Parent TLC and child TLC: the input and output lots linked by the event.
Transformation event ID: the event that created the relationship.
Input or output role: how each lot participated.
Quantity and unit of measure: how much of each input was used.
Effective event timestamp: when the relationship took effect.
Source record reference: the original MES or ERP transaction.

Forward and Backward Traceability

Forward trace
Where did this input go?

Finds which finished lots, and which customers, received product containing a particular input lot.

input lot → finished lots → customers
Backward trace
What went into this product?

Finds the source lots and facilities behind a finished product.

finished lot → input lots → suppliers

Because transformations can be nested several levels deep, the traversal should run as a recursive query or an iterative job over the genealogy table.

Watch out

Relationships should come from recorded transformation and lot-linking events, never from matching product descriptions or timestamps after the fact.

05 · INTEGRATION

Integrating ERP, WMS, MES and 3PL Data for FSMA 204 Compliance

A lakehouse cannot produce reliable traceability if ingestion loses identifiers or changes their meaning. FSMA 204 data integration has to account for each source system:

ERP
Enterprise resource planning

Product masters, production batches, purchase orders, supplier information and manufacturing transactions.

WMS
Warehouse management

Receiving records, storage locations, inventory movements, picking and shipping transactions.

MES
Production systems

Ingredient consumption, transformation details, output lot assignments and production records.

3PL
3PL and TMS systems

Transportation events, carrier references, shipment quantities and delivery information.

In the ingestion layer, preserve the original source record and assign a common event identifier. Never discard the original lot value when you map it to a canonical TLC reference. The same principle applies to shipping documents: if your logistics data already flows through digital documents, our article on electronic bill of lading integration covers how to connect those records to ERP, TMS and WMS.

Using GS1 Standards and EPCIS for Trading Partner Data

FSMA 204 compliance is not only about capturing your own data. Trading partners must share KDEs with each other, so the formats you accept and send matter.

Many food companies use GS1 standards for this exchange. GS1 US has published recommendations showing how EPCIS event data can supply information for FSMA 204 CTEs and KDEs, and how the X12 EDI 856 Advance Ship Notice can carry the data needed for the shipping CTE. Identifiers such as GTINs for products and GLNs for locations also map cleanly to the Product and Location entities in the model above.

GTIN → Product GLN → Location EPCIS 2.0 → Event EDI 856 ASN → Shipping CTE

In a lakehouse, EPCIS events and EDI messages are simply additional Bronze sources. Land them unchanged, then map them to the same canonical event and KDE tables as your internal systems.

06 · ARCHITECTURE

Food Traceability Lakehouse Architecture on Databricks

A medallion architecture gives the food traceability system architecture a clear structure, from raw source records to an FDA-ready export.

SRC Source systemsERP, WMS, MES, 3PL and TMS, plus EPCIS events and EDI messages from partners ↓
BRZ BronzePreserve source records and ingestion metadata exactly as received ↓
SLV SilverStandardize identifiers, validate KDEs and resolve lot relationships ↓
GLD GoldPublish traceability events, lot genealogy and export-ready datasets ↓
QRY Traceability queryParameterized forward and backward traces by lot, product, date and location ↓
FDA FDA exportValidated, logged electronic sortable spreadsheet ✓
Data flows top to bottom. Each layer depends on the one above it.

For Databricks food traceability, this design maps onto platform features you would likely use anyway:

Storage
Delta Lake tables

ACID tables for events, KDEs and genealogy, with table history that shows what changed and when.

Corrections
Change Data Feed

Captures row-level corrections from source systems so updates are traceable rather than silent.

Quality
Declarative pipelines

Delta Live Tables (now Lakeflow Declarative Pipelines) with data quality expectations that flag missing or invalid KDEs during ingestion.

Governance
Unity Catalog

Access control, column masking and data lineage from the Gold export back to each Bronze source.

Retrieval
Databricks SQL

Parameterized queries that power the traceability export.

The key design decision is to retain both the source representation and the validated business representation. If a source record is corrected, the organization should be able to see what changed and when the correction entered the traceability system. For a broader view of where a lakehouse fits against other approaches, see our comparison of data lakehouse vs data mesh.

Databricks readiness
Can your lakehouse trace one lot end to end today?

Get a review of your ingestion pipelines, lot genealogy model and traceability export readiness.

Check Your Readiness
07 · 24-HOUR EXPORT

Automating the 24-Hour FDA Traceability Data Export

The 24-hour requirement should shape the data model from day one. If the export depends on manually joining ERP, WMS and 3PL spreadsheets, the retrieval problem has not been solved. An automated export should accept parameters such as:

Requested traceability lot codes Food or product identifiers Relevant date range Locations or facilities Applicable event categories

The query then retrieves the associated events and lot relationships. A simplified SQL pattern:

traceability_export.sql
SELECT e.event_id, e.event_type, e.event_timestamp, e.location_id, e.traceability_lot_code, e.source_system, k.kde_name, k.kde_value FROM traceability_events e LEFT JOIN traceability_kdes k ON e.event_id = k.event_id WHERE e.traceability_lot_code IN ( SELECT traceability_lot_code FROM requested_lots ) AND e.event_timestamp BETWEEN :start_date AND :end_date ORDER BY e.event_timestamp, e.event_id;

This is an architectural example, not a complete FDA export specification. A production implementation must include the applicable KDEs, lot genealogy, requested locations and any other information needed to understand the records.

Use the FDA template

The FDA has published a downloadable electronic sortable spreadsheet template with a tab for each CTE. Using it is not mandatory, but shaping your Gold export tables to match its columns makes the final output predictable and easy to review.

Before delivery, the export service should validate the output:

Resolve every requested lot Confirm none are missing
Flag missing or invalid KDEs List them rather than hiding them
Include lot relationships Upstream and downstream genealogy
Check references Event timestamps and location references
Generate the spreadsheet When required, reviewed before it is sent
Log the run Who generated it, when, and which query version
Automation prepares and checks the export. A compliance lead reviews it before it goes to the FDA.

The export should be reproducible. Running the same request twice against unchanged data should return the same result, and if records have changed, the table history should explain the difference.

08 · GOVERNANCE

Governance and Data Quality for Food Traceability Recordkeeping

A traceability platform is only as useful as its records. Good food traceability recordkeeping builds validation into ingestion and transformation rather than checking at the end. Validation rules should detect:

Missing lot codesEvents without a TLC where one is required.
Unknown locationsReferences that do not match the facility master.
Inconsistent unitsQuantities that cannot be reconciled.
Invalid event sequencesFor example, receiving recorded before shipping.
Broken genealogyTransformation events that reference an input TLC that does not exist.

Data quality checks should create actionable exceptions with clear ownership. A missing KDE should go to the team responsible for the originating process, not just appear as a failed metric on a dashboard. Automated DataOps practices and self-healing data pipelines can help data teams catch and route these issues faster, while people stay in charge of the corrections.

Access controls matter too. Traceability records can contain supplier details, commercial information and sensitive operational data, so apply role-based access, encryption and retention policies while making sure authorized staff can still retrieve records quickly.

Your traceability plan, source mappings, validation rules and export procedures are part of the operating model, not temporary project documents. Keep them under version control

Treating them this way is the same principle behind building compliance infrastructure that runs continuously instead of in audit-time bursts.

09 · READINESS

A Practical FSMA 204 Readiness Plan Before July 2028

The July 20, 2028 compliance date gives covered businesses time, but postponing the data work only creates implementation pressure later.

Scope your foods

List the FTL products and FTL ingredients your organization handles.

Map your CTEs

Identify which Critical Tracking Events each facility performs.

Map your KDEs

Document where each required KDE lives today and who owns it.

Follow the TLC

Trace lot codes through receiving, transformation and shipping, including partner handoffs.

Build the model

Land sources in Bronze, validate in Silver and publish genealogy and exports in Gold.

Run a mock recall

Select a lot, follow its inputs and movements, and generate the export without collecting records by hand.

If the data foundations are still being decided, a clear data strategy helps settle ownership, platforms and priorities before the build starts.

10 · SEAFLUX

How Seaflux Helps Build FSMA 204 Traceability on Databricks

Seaflux is a Databricks consulting partner and data engineering services company that helps food manufacturers, distributors and logistics and supply chain businesses turn scattered operational data into governed, query-ready platforms. For FSMA 204 traceability, our team works across the full path from source systems to the FDA export:

Lakehouse architecture design

Our Databricks lakehouse consulting team designs the medallion layers, Delta Lake tables and the event, KDE and lot genealogy model described in this guide.

Data integration services

We build ETL and ELT pipelines that connect ERP, WMS, MES, 3PL, EDI and EPCIS sources without losing original lot identifiers.

Data quality and DataOps

Automated validation, exception routing and pipeline monitoring keep KDEs complete and traceable.

Unity Catalog governance

Access control, column masking and end-to-end data lineage so every exported record can be traced to its source.

Traceability reporting

Parameterized export services and data analytics and visualization dashboards that give quality and compliance teams lot-level visibility.

B·S·GMedallion in production

We have delivered this kind of platform before. In our Databricks Lakehouse for AI Supply Chain and Demand Forecasting project, we unified SAP, warehouse, POS and supplier data in a Bronze, Silver and Gold lakehouse on Delta Lake, with Unity Catalog handling access control and lineage.

Our SupplyPulse AI solution builds on the same foundations to give supply chain teams better visibility and support faster decisions.

11 · NEXT STEPS

Make the Next Traceability Request a Query, Not a Project

FSMA 204 traceability depends on how well events, lot relationships and source records are modeled. Start with the FTL foods you handle, map the CTEs and KDEs each facility generates, follow the TLC across every handoff and test retrieval with a realistic mock recall.

Databricks Readiness Review
If the FDA requested the history of one traceability lot today, could your team retrieve its complete upstream and downstream journey from a single query?

Our team will review your ingestion pipelines, lot genealogy model and traceability export process, and show you where the gaps are before the 2028 deadline.

Ingestion pipelines Lot genealogy model 24-hour export readiness

Frequently Asked Questions (FAQ): Get the Answers You Need

Hardik Dangodara

Hardik Dangodara

Business Development Manager

Claim Your No-Cost Consultation!

Let's Connect