Ingest
Receive data from events or scheduled retrieval.
D2 tách riêng kiến trúc, implementation evidence và evidence boundary để người đọc phân biệt rõ system design đã chứng minh với production outcome chưa được xác minh.
Xem methodology về evidenceSelected project 03
Webhook-Driven Integration, Normalization & Data Reliability Architecture
A reusable integration layer for moving business data reliably across APIs, operational systems and analytics infrastructure — with normalization, validation, deduplication, governance and routing as first-class concerns.
01 · System problem
CRM, accounting, commerce, marketing databases and warehouses expose different schemas, identifiers and transport patterns. A durable integration layer must convert those differences into a controlled internal model before downstream systems can trust the data.
Receive data from events or scheduled retrieval.
Map heterogeneous fields into a canonical business shape.
Validate, protect, deduplicate and preserve lineage.
Route trustworthy records to operational and analytical destinations.
02 · Source → canonical model → destinations
The workflow routes five source types into a shared processing pipeline, then fans validated records out to operational, analytical and governance destinations.
Source systems
Canonical integration layer
Destinations
Operational systems
QuickBooks · Salesforce · HubSpot
Analytics & storage
PostgreSQL Analytics DB · Snowflake Data Warehouse
Audit & lineage
Supabase Audit Log · Google Sheets Audit Backup · Supabase Data Lineage
03 · Ingestion
The source includes both a POST webhook entry point and a scheduled polling trigger. Enterprise integration rarely has one universal ingestion model: some systems push events, while others must be queried on a schedule.
A POST webhook provides an event-driven entry point for source events that can be pushed into the integration layer.
A schedule trigger supports pull-based collection where the upstream platform does not emit the required event or where periodic reconciliation is preferred.
04 · Canonical data pipeline
The workflow enriches source data with ingestion metadata, validates required identity fields, then maps heterogeneous platform fields into a shared record shape before deduplication and downstream routing.
Adds ingestion timestamp, workflow execution ID, source and record identifier.
Checks recordId and dataSource and records validation errors with a validation timestamp.
Maps id, source, email, name, createdAt, updatedAt, status and source metadata into one shape.
Uses a source + id compound key inside the workflow to remove duplicate records in the current processing set.
The current crypto nodes apply SHA-256 hashing to email fields. This is hashing, not reversible encryption.
Runs anomaly analysis and quality scoring separately from deterministic schema validation.
05 · Destination layer
Validated records can route back into business applications or into analytics/storage systems. Audit and lineage sinks sit alongside those destinations rather than being mixed into the business payload itself.
06 · Reliability
Invalid records branch to a Slack validation-failure alert instead of being silently accepted.
Error handling calculates up to 3 retries with a 1,000 ms base exponential-backoff policy.
The error path sends execution context and retry state to Slack.
Destination activity is prepared for Supabase audit logging, Google Sheets backup and lineage tracking.
Prototype boundary: the source computes retry count, delay, shouldRetry and nextRetryAt, but does not wire those values back into a wait/re-execution loop. The page therefore treats exponential backoff as a retry-policy prototype, not a proven automatic retry mechanism.
07 · Governance
The source includes data-lineage records, audit sinks, PII hashing controls, a scheduled key-rotation hook and a GDPR deletion-request workflow. Where the source stops short of full implementation, the boundary is stated explicitly.
Email fields pass through SHA-256 crypto nodes. Despite their node labels, the implemented operation is hashing rather than reversible encryption.
A lineage record tracks source system, destination system, transformation names, quality score, record count, execution ID and validation status into Supabase.
A 30-day schedule calls a rotate_keys HTTP endpoint. The endpoint itself is a placeholder, so this demonstrates rotation orchestration rather than a completed key-management implementation.
A header-authenticated webhook prepares deletion scope across PostgreSQL, Snowflake, Supabase and Google Sheets. The source comments explicitly state that actual deletion would be handled by subsequent nodes, which are not present in this workflow.
08 · Data quality
The workflow separates deterministic schema validation from anomaly-oriented quality analysis. That distinction matters: structural validity and business-data quality are different controls.
Required record identity and source fields are checked in code. Invalid records retain validation errors and can branch to a Slack alert.
A GPT-4o anomaly-analysis branch produces structured anomaly fields. A separate scoring step derives data-quality, completeness and consistency signals, with a quality threshold of 70 used for routing.
These are workflow heuristics and model-assisted checks from the prototype — not benchmarked quality guarantees.
09 · Engineering mindset
10 · Business applications
These are example use cases for the architecture, not claims of customer deployments.
11 · Production roadmap
Final takeaway
“The workflow is designed around a reusable integration layer rather than tightly coupling every application to every other application.”
The architecture demonstrates how I think about integration as a governed data system: transport is only the beginning; normalization, validation, quality, privacy, lineage and recovery determine whether downstream systems can trust the result.
Back to automation portfolioD2 Automation Systems
D2 map quy trình, source of truth, deterministic rule, failure path và evidence boundary trước khi đề xuất scope Automation.