Declarative Rules
Merchandisers define targeting rules directly on metaobjects using simple attribute conditions. Rules are parsed once, cached, and sorted by specificity before evaluation.

This project was built to solve a scaling problem in large sports retail catalogs: rich product content — badges, key features, interactive stories, size guides — had to be assigned to thousands of products based on catalog attributes like brand, gender, sport, and department. Manual assignment and one-off metafield edits could not keep pace with catalog churn or merchandising changes.
By combining declarative rules stored on Shopify metaobjects, attribute-based product matching, and automated metafield updates, the platform enables merchandising teams to define content once and have it applied consistently across the entire catalog — without touching individual products.
The platform combines a rules evaluation pipeline, background job orchestration, and Shopify-aware bulk write strategies to deliver a scalable and reliable solution. The architecture was designed to support new content types and catalog attributes through configuration, while maintaining operational simplicity at runtime.
Merchandisers define targeting rules directly on metaobjects using simple attribute conditions. Rules are parsed once, cached, and sorted by specificity before evaluation.
Product and metaobject changes trigger background jobs, keeping webhook responses fast and avoiding platform timeouts on large catalogs.
Products are scanned in batches and metafield changes are aggregated before write, respecting Shopify API limits and minimizing round-trips.
A dedicated flag-clearing strategy prevents update loops when the engine writes back to products, ensuring idempotent, retry-safe processing.
The core challenge was reconciling two opposing forces: merchandisers needed expressive, declarative control over product content, while the system had to evaluate and apply those rules reliably across a high-volume catalog without overwhelming Shopify APIs or creating feedback loops.
To solve this, the platform uses a layered pipeline — rules loading, product evaluation, change computation, and bulk metafield application — orchestrated through background jobs on a middleware layer between Shopify and the storefront. Rules live on metaobjects as merchant-editable conditions; the engine reads product attributes from a synced data model, determines which content blocks qualify, and writes only the deltas needed. Configuration maps catalog attributes and content types to the correct metafield targets, so extending the system to new content blocks does not require rearchitecting the core engine.
Specificity ordering resolves conflicts when multiple rules compete for single-reference content slots, while list-based content types accumulate all qualifying matches. Cleared or invalid rules actively remove previously linked content, so merchandising changes propagate cleanly rather than leaving stale assignments behind.
The platform relies on event-driven workflows for processing product attribute changes and metaobject rule updates.
When a product's attributes change, a targeted background run evaluates only that product against the current rule set. When a metaobject's rules change, the cache is invalidated and a type-scoped run re-evaluates all affected products. Full-catalog reconciliation is available for initial syncs and recovery scenarios. To maintain reliability, all processing is idempotent — the engine computes diffs against current metafield state and skips no-op writes, allowing events to be safely retried without creating duplicate references or inconsistent assignments.
A dual write strategy separates real-time single-product updates from bulk catalog sweeps. For webhook-triggered runs, set and delete operations are applied atomically within each API batch to prevent race conditions. For large-scale syncs, operations are chunked by product owner to stay within platform limits while maximizing throughput.

The result is a scalable platform that provides automated, attribute-driven product content assignment across a large multi-category sports retail catalog.
By connecting declarative merchandising rules, real-time catalog event processing, and safe bulk metafield orchestration, the system delivers consistent product storytelling and merchandising signals at scale — while providing a configuration-driven foundation for new content types, attributes, and targeting logic as the catalog grows.