A Claude orchestrator manages a customer service workflow with 3 subagents: order_lookup_agent, refund_processing_agent, and email_notification_agent. The orchestrator is designed with trust that all subagents return accurate results. During an incident, it's discovered that the email_notification_agent was sending confirmation emails before refund_processing_agent confirmed successful refund. The orchestrator's log shows it was calling all three agents in parallel to reduce latency. What is the correct dependency management architecture?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — batch result validation with dependency enforcement is the architecturally correct solution. The issue is not parallelism itself — order_lookup and refund_processing are genuinely parallelizable (order lookup doesn't depend on refund processing).
Full explanation below image
Full Explanation
Batch result validation with dependency enforcement is the architecturally correct solution. The issue is not parallelism itself — order_lookup and refund_processing are genuinely parallelizable (order lookup doesn't depend on refund processing). The bug is that email_notification was incorrectly parallelized with refund_processing when it has a hard dependency on refund success. The correct architecture: (1) parallel batch 1: order_lookup_agent + refund_processing_agent run simultaneously, (2) orchestrator validates both results — specifically checking refund_processing returns CONFIRMED, (3) only on confirmed refund: call email_notification_agent. This preserves the latency benefit of batch 1 parallelism while enforcing the email → refund dependency. Option A (full sequential) eliminates the parallelism benefit unnecessarily — order_lookup and refund_processing have no dependency relationship and can safely run in parallel. Option B (event-driven with pub/sub) is architecturally elegant but adds infrastructure complexity (event bus, subscription management) for what is a simple sequential dependency. Option D (optimistic execution with compensation) is a dangerous pattern for financial transactions: customers receive a confirmation email for a refund that hasn't happened, creating customer trust issues and potential regulatory liability.