Flash sales are where ecommerce platforms earn their reputation — or lose it. Run one well and you move inventory, spike revenue, and build customer loyalty. Run it badly and you oversell, crash your promotion engine, send customers to pages for products that ran out three minutes ago, and spend the next week issuing apology vouchers.
The traditional approach is rules-based automation: if inventory drops below X, disable the promotion; if sales velocity exceeds Y, trigger a restock alert. It works — until the conditions are more complex than a single threshold, until multiple promotions interact, until the right move requires judgment rather than a rule you wrote six months ago in a sprint no one remembers.
Google’s Agent Development Kit 2.0 — which hit general availability in May 2026 — offers a different model. Its graph-based workflow engine and dynamic loop support make it possible to build a promotion agent that doesn’t just react to thresholds, but actively monitors, reasons, and adapts throughout the lifetime of a sale.
What ADK 2.0 Actually Changes
The headline feature in ADK 2.0 is the shift from a hierarchical agent executor to a graph-based execution engine. In the 1.x model, agents were standalone executors — you chained them together and hoped the handoffs worked. In 2.0, agents become nodes in a workflow graph. Routing is explicit. State flows between nodes. The graph enforces structure while AI reasoning fills the gaps that rules can’t reach.
For a promotion engine, this matters enormously. The workflow isn’t a straight line — it branches based on inventory conditions, loops while the sale is live, and has clearly defined escalation paths. That’s exactly what graph workflows are designed to express.
The Dynamic Promotion Engine
Here’s what the agent workflow looks like for a flash sale running across a multi-category ecommerce platform.

Each box in this diagram is an ADK agent node with a focused responsibility. The graph engine handles routing. The loop between Velocity Check and the monitoring cycle runs for the duration of the sale — checking at a configured interval, re-routing based on current conditions, never relying on a rule set someone has to maintain manually.
Walking Through the Workflow
Sale Start Trigger kicks off the graph when the promotion goes live — either on a scheduled time or a manual activation event. This is ADK’s ambient agent capability: the workflow can be pre-loaded and waiting, activating without human intervention.
Inventory Snapshot Agent fetches current stock levels for every SKU in the promotion. In ADK 2.0, this agent calls your inventory API as a tool, stores the result in the workflow’s shared state, and passes it downstream. The state management is explicit — no hidden context passing, no hoping the next agent remembers what the previous one found.
Velocity Check Agent is where the reasoning happens. It takes inventory levels plus recent order velocity — how fast items are selling right now — and decides which path through the graph to take. This is the node where AI judgment replaces a rigid ruleset. A rule says “if stock < 50, throttle.” The agent says “stock is at 47, but velocity is slowing and the sale has 4 hours left — hold the current promotion, don’t throttle yet.”
The four downstream paths reflect real operational conditions:
- Healthy stock, high velocity → Optimizer agent expands the promotion surface. Push the product up in search rankings, add it to the homepage banner, increase the recommendation weight.
- Low stock, high velocity → Throttle agent reduces exposure without killing the promotion. The “only 12 left” nudge goes live. Customers see urgency; the platform avoids overselling.
- Near-zero stock → The promotion disables automatically and a restock notification gets queued. No customer reaches a sold-out page through an active promotion.
- Anomalous spike → Fraud Signal Agent cross-references order velocity with your fraud model. Bulk-buying patterns, unusual session clustering, rapid repeat orders from the same device fingerprint — if the score clears, normal routing resumes. If it doesn’t, the workflow escalates to a human operator and pauses the affected SKUs while review happens.
The loop is the core of the dynamic behavior. While the sale is active, the workflow returns to the Inventory Snapshot agent after each check interval — say, every 5 minutes — and repeats the evaluation. Conditions that were healthy 20 minutes ago may not be now. The agent adapts without any human intervention.
Post-Sale Agent runs after the loop exits. It generates a structured summary: which SKUs performed against forecast, which ran out early, what the fraud signal rate was, what the promotion configuration looked like hour by hour. This feeds directly into planning for the next sale.
Why This Is Harder Than It Looks With Rules
You could attempt this with a rules engine and a cron job. Teams do it all the time. The problems surface at the edges:
Rules are static. The conditions that matter during a flash sale — the interaction between inventory levels, velocity, time remaining, fraud signals, and competitor activity — are dynamic and correlated. Writing rules that cover every meaningful combination is a maintenance burden that grows with the catalog.
Rules don’t explain themselves. When something goes wrong during a sale, the post-mortem question is always “why did the system do that?” An agent that made a decision can tell you. A rule that fired at 2am cannot.
Rules escalate poorly. Knowing when to page a human is a judgment call. “Stock below 50 AND velocity above 200 per hour AND order size above 5 units” is a guess at the right condition. An agent scoring a fraud signal against context is reasoning about it.
Getting This Into Production
ADK 2.0 deploys natively to Google Cloud via Agent Runtime, Cloud Run, or GKE — one command, managed infrastructure, built-in Cloud Trace observability. For a promotion engine where you need to audit every decision the agent made during a sale, the built-in tracing is not a nice-to-have. It’s how you reconstruct the full picture when a VP asks why 300 units of a product went out at a price that shouldn’t have been active.
One important migration note for teams already on ADK 1.x: the 2.0 graph engine introduces breaking changes. BaseAgent now subclasses BaseNode. Custom execution overrides via _run_async_impl() are bypassed silently by the new workflow engine — you’ll need to move that logic into the BeforeAgentCallback and AfterAgentCallback interfaces. If you have custom session storage with rigid database columns, the new node_info and output fields in the Event schema need to be accommodated before you upgrade. The ADK 2.0 migration guide covers this in detail.
The upgrade is worth it for the graph engine. But do the migration properly — don’t treat it as a drop-in.
The Bigger Picture
A dynamic promotion engine is a contained, well-scoped example of something ADK 2.0 makes tractable at a systems level: workflows that combine deterministic structure with adaptive AI reasoning, that run autonomously under normal conditions, and that escalate gracefully when conditions fall outside what the system can handle alone.
That pattern — structured graph, AI judgment at the decision points, clear human escalation paths — is the right mental model for production agentic systems in general. Promotion management is just one place where ecommerce teams can start proving it out before expanding the pattern to order exception handling, catalog enrichment, pricing optimization, and the dozen other workflows where rules are failing quietly right now.
Start with the flash sale. Build the feedback loop. The rest follows.
