A2A Protocol in Practice: Cross-Company Supply Chain Negotiation
Traditional B2B integrations are brittle. They require months of coordination, custom API mappings, and break whenever either party changes their systems. When a manufacturer needs a new supplier, the integration cost alone can kill the deal.
Google's Agent-to-Agent (A2A) protocol changes this equation. Instead of building point-to-point integrations, companies expose AI agents that speak a common protocol. A procurement agent can discover a supplier it's never interacted with, understand its capabilities, negotiate terms, and place orders—all without custom integration work.
This isn't hypothetical. Tyson Foods and Gordon Food Service are already using A2A to coordinate supply chain operations, with agents sharing product data and sales leads in real-time across company boundaries.
This guide walks through a realistic scenario: a manufacturer's procurement agent negotiating with multiple competing supplier agents to source components for a production run.
Full Implementation: The complete working code for this example is available at github.com/mshoaibiqbal/a2a-supply-chain
Why APIs Aren't Enough
Before diving in, let's be clear about when A2A adds value over traditional APIs.
If you control both endpoints and the interaction is predictable, use an API. A2A adds overhead you don't need.
A2A shines when:
You don't control the other side. Your procurement system needs to work with suppliers you haven't met yet. You can't mandate their API structure.
Interactions require negotiation. Price, terms, and delivery schedules aren't fixed—they emerge from back-and-forth conversation. REST endpoints don't negotiate.
Capabilities vary and change. One supplier offers expedited shipping, another offers volume discounts, a third can customize specifications. You need to discover these capabilities dynamically, not hardcode them.
The work is opaque. You don't care how the supplier agent determines pricing or checks inventory. You care about the outcome. A2A treats agents as black boxes by design.
The Scenario
Aurora Manufacturing produces industrial sensors. They need 10,000 pressure transducers for a Q2 production run. Their procurement agent must:
- Discover potential suppliers from an agent registry
- Evaluate each supplier's capabilities and constraints
- Request quotes with specific requirements
- Negotiate on price, delivery, and terms
- Select the best offer and place a binding order
- Handle the unexpected—a supplier might counter-offer, request specification changes, or decline entirely
The suppliers are independent companies with their own systems. Aurora hasn't integrated with them before. The only common ground is that everyone speaks A2A.
How A2A Enables Cross-Company Collaboration
A2A provides four capabilities that make this kind of collaboration possible.
Agent Discovery Through Agent Cards
Every A2A agent publishes a JSON document describing what it can do. This "agent card" lives at a well-known URL (/.well-known/agent.json) and acts as a digital business card.
{
"name": "Apex Controls Supplier",
"description": "B2B procurement interface for industrial components",
"url": "https://agents.apexcontrols.com/",
"skills": [
{
"id": "rfq-processing",
"name": "Quote Requests",
"description": "Submit RFQs for industrial components",
"tags": ["rfq", "quote", "pricing", "procurement"]
},
{
"id": "negotiation",
"name": "Price Negotiation",
"description": "Negotiate pricing and terms on active quotes"
}
]
}
When Aurora's procurement agent needs suppliers, it queries a registry, fetches each supplier's agent card, and understands their capabilities without prior integration. A new supplier joins the ecosystem simply by publishing an agent card—no changes needed on the buyer's side.
Stateful Multi-Turn Negotiation
Unlike REST APIs where each request is independent, A2A maintains conversation context through task lifecycles. A negotiation might span multiple rounds over hours or days:
┌─────────────────────────────────────────────────────────────────────────────┐
│ PARALLEL QUOTE REQUEST │
├─────────────────────────────────────────────────────────────────────────────┤
│ Buyer ────────────────┬──────────────────┬──────────────────> 3 Suppliers │
│ │ │ │
│ ▼ ▼ ▼ │
│ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │
│ │ Apex Controls │ │ Pacific Sensor │ │ MidWest Parts │ │
│ └───────┬────────┘ └───────┬────────┘ └───────┬────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │
│ │ Quote: $74.11 │ │ Quote: $70.82 │ │ Quote: $75.62 │ │
│ └───────┬────────┘ └───────┬────────┘ └───────┬────────┘ │
│ │ │ │ │
├───────────────────────┴──────────────────┴──────────────────┴───────────────┤
│ PARALLEL NEGOTIATION │
├─────────────────────────────────────────────────────────────────────────────┤
│ Buyer Counter: $52.00 ──────────────────────────────────> All Suppliers │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │
│ │ Final: $65.22 │ │ Final: $58.07 │ │ Final: $68.06 │ │
│ └────────────────┘ └───────┬────────┘ └────────────────┘ │
│ │ │
├──────────────────────────────────────────┴──────────────────────────────────┤
│ SELECTION & ORDER │
├─────────────────────────────────────────────────────────────────────────────┤
│ Buyer selects Pacific Sensor (lowest price: $58.07/unit) │
│ │ │
│ Accept & Place Order ──────────────────>│ │
│ │ │
│ Order Confirmed: SO-XYZ67890 <──────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
Each message references the same negotiation context. The supplier agent tracks state internally—quote history, approval status, inventory holds—without exposing any of it. The buyer just sees responses.
Opaque Business Logic
This is crucial for B2B scenarios. Each supplier agent encapsulates proprietary business rules:
| Supplier | Strategy | Base Price | Delivery | Negotiation Style |
|---|---|---|---|---|
| Apex Controls | Premium Partner | $52/unit | 14 days | Formal, relationship-focused |
| Pacific Sensor Co | Value Leader | $48/unit | 21 days | Friendly, solutions-oriented |
| MidWest Parts | Flexible Dealer | $55/unit | 10 days | Direct, most flexible on price |
The procurement agent never sees these rules. It sends counter-offers; suppliers respond with accepts, rejects, or revised offers. The negotiation strategy on each side remains private.
Communication Formats
Each supplier uses a different A2A message format to showcase the protocol's flexibility:
| Supplier | Format | Description |
|---|---|---|
| Apex Controls | JSON | Structured data only (enterprise-style) |
| Pacific Sensor Co | Natural Language | Text responses parsed by LLM |
| MidWest Parts | Hybrid | Text context + structured data |
The procurement agent automatically handles all formats. This demonstrates a key A2A principle: agents don't need to agree on message structure, only on the protocol.
Where LLM is Used
LLM (Claude) is used in two specific places:
- Pacific Sensor Co - Generates natural language responses and parses incoming NL requests into structured data
- Procurement Agent - Parses Pacific's NL responses back into structured data
Apex and MidWest don't use LLM—they use JSON/Hybrid formats with deterministic templates. This demonstrates that A2A works with or without AI-powered agents.
If ANTHROPIC_API_KEY is not set, the system uses fallback static messages and regex parsing.
Aurora Manufacturing
+-----------------------------+
| Procurement Agent |
| (discovers, negotiates, |
| orders) |
+-------------+---------------+
|
| A2A Protocol
|
+---------------------+---------------------+
| | |
v v v
+---------------+ +---------------+ +---------------+
| Apex Controls | | Pacific Sensor| | MidWest Parts |
| (Premium) | | (Value) | | (Flexible) |
| port 8001 | | port 8002 | | port 8003 |
| [JSON] | | [NL] | | [Hybrid] |
| | | | | |
| Business Logic| | Business Logic| | Business Logic|
| | | + | | |
| | | LLM Service | | |
+---------------+ +---------------+ +---------------+
Long-Running Task Support
B2B transactions don't complete in milliseconds. A quote request might need internal approval. A large order might require credit checks. A2A's task lifecycle handles this through defined task states:
| State | Description |
|---|---|
| submitted | Task received, queued for processing |
| working | Agent is actively processing the request |
| input-required | Agent needs additional information to proceed |
| completed | Task finished successfully with results |
| failed | Task could not be completed |
The key insight: when an agent needs time, it returns the task in a working state rather than blocking until completion. This enables asynchronous workflows:
Buyer Supplier
│ │
│── Request Quote ────────────────────────────>│
│ │
│<── Status: working (checking inventory) ─────│
│ │
│── Poll for status ──────────────────────────>│
│ │
│<── Status: working (calculating pricing) ────│
│ │
│── Poll for status ──────────────────────────>│
│ │
│<── Status: completed (quote ready) ──────────│
The procurement agent can poll for status or receive push notifications when state changes. No need for custom webhook implementations—A2A handles the infrastructure.
The Negotiation Flow
Here's how a complete procurement cycle works in practice.
Phase 1: Discovery
The procurement agent queries available suppliers and fetches their agent cards:
[Phase 1] Discovering suppliers...
+ Apex Controls Supplier
+ Pacific Sensor Co Supplier
+ MidWest Parts Supplier
Found 3 potential suppliers
Any supplier speaking A2A can participate. The procurement agent doesn't need prior knowledge of who's available.
Phase 2: Parallel Quote Requests
The agent requests quotes from all discovered suppliers simultaneously:
[Phase 2] Requesting quotes...
QUOTES:
Supplier Unit Price Total Lead Time
-------------------- ------------ -------------- ------------
Pacific Sensor Co $ 70.82 $ 708,238.08 21 days
Apex Controls $ 74.11 $ 741,101.40 14 days
MidWest Parts $ 75.62 $ 756,191.70 10 days
Each supplier receives the same RFQ. Their responses reflect their own pricing logic, inventory positions, and margin requirements—none of which is visible to the buyer.
Phase 3: Competitive Negotiation
With quotes in hand, the procurement agent negotiates toward its target price:
[Phase 3] Negotiating with top candidates...
Target price: $52.00/unit
Negotiation round 1:
Apex Controls: Counter $65.22 (FINAL)
Pacific Sensor Co: Counter $58.07 (FINAL)
MidWest Parts: Counter $68.06 (FINAL)
Notice that each supplier hit their floor at different prices—that's their internal pricing strategy at work. Pacific can go lower because they're the "Value Leader" with lower base costs. MidWest charges a premium for faster delivery (10 days vs 21). None of this is exposed; it just emerges from the negotiation.
Phase 4: Selection and Order
The agent selects the best offer based on price, delivery, and any other criteria, then places a binding order:
[Phase 4] Selecting supplier...
Selected: Pacific Sensor Co
Price: $58.07/unit
Total: $580,724.00
[Phase 5] Placing order...
+ Order confirmed!
Our PO: PO-ABC12345
Supplier Order: SO-XYZ67890
Delivery: 2026-02-15
The entire flow—discovery, quoting, negotiation, ordering—happened through A2A. No custom integrations, no prior relationships, no API mapping projects.
What Makes This Different from Traditional Integration
| Aspect | Traditional B2B | A2A-Based |
|---|---|---|
| New Supplier Onboarding | Months of integration work | Discover and transact immediately |
| Negotiation | Phone calls, emails, manual back-and-forth | Automated multi-round negotiation |
| Business Logic | Often exposed through API contracts | Fully encapsulated and private |
| Protocol Changes | Requires coordinated updates | Versioned capabilities in agent cards |
| Multi-Party | Point-to-point integrations for each | Standard protocol for all |
Extending the Pattern
The supply chain negotiation example demonstrates core A2A capabilities, but the pattern extends to more sophisticated scenarios.
Multi-Tier Sourcing: When a supplier can't fulfill the full quantity, they could delegate to their own suppliers via A2A, creating a chain of negotiations that resolves automatically.
Compliance Verification: Add an agent that verifies supplier certifications, checks sanctions lists, and validates insurance coverage—all as part of the procurement flow.
Demand-Driven Procurement: Connect the procurement agent to a forecasting agent that triggers purchases automatically when projected demand exceeds inventory thresholds.
Competitive Auctions: Instead of sequential negotiation, implement sealed-bid auctions where suppliers submit final offers simultaneously.
Getting Started
The complete implementation is available at:
github.com/mshoaibiqbal/a2a-supply-chain
The repository includes:
- Three Supplier Agents: Each with unique personalities, pricing strategies, and communication formats
- Procurement Agent: Discovers suppliers, manages parallel negotiations, and selects winners
- LLM Integration: Claude-powered dynamic responses with deterministic business logic fallback
Prerequisites
- Python 3.12+
- The
a2a-sdkpackage - Anthropic API key (optional, for LLM-powered responses)
Quick Start
# Clone the repository
git clone https://github.com/mshoaibiqbal/a2a-supply-chain.git
cd a2a-supply-chain
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install package
pip install -e .
# Configure environment (optional, for LLM responses)
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY
# Start supplier agents (each in a separate terminal)
run-apex # Port 8001 - Premium partner
run-pacific # Port 8002 - Value leader
run-midwest # Port 8003 - Flexible dealer
# Run the procurement agent
run-procurement
Production Considerations
Moving from demo to production requires addressing several concerns:
Authentication: The example uses no auth. Production deployments need mutual TLS, OAuth 2.0, or API keys. Agent cards declare authentication requirements; clients must comply.
Agent Registries: Hardcoded URLs don't scale. Production systems need proper registries—potentially federated across industries—where suppliers publish their agent cards and buyers discover them.
Audit Trails: Every negotiation message should be logged immutably. A2A's context IDs and task IDs enable tracing, but you need infrastructure to capture and store the audit trail.
Approval Workflows: Large purchases need human approval. A2A's input-required task state supports this—the agent can pause and wait for authorization before proceeding.
Error Recovery: Network failures, agent crashes, timeout scenarios—production systems need retry logic, compensation transactions, and graceful degradation.
Conclusion
A2A earns its complexity when agents need to discover, negotiate, and collaborate across organizational boundaries. The supply chain scenario shows the pattern clearly: each party maintains full control over their business logic while participating in a shared protocol for interaction.
This isn't about replacing APIs for known, stable integrations. It's about enabling interactions between parties that haven't pre-integrated—and might not even know each other exists until the moment of discovery.
The protocol's foundation on HTTP and JSON-RPC means it works with existing infrastructure. The opaque agent model means companies can participate without exposing proprietary systems. And the task lifecycle model handles the reality that B2B interactions often span hours or days, not milliseconds.