|
|
ADK with Eventarc
Author: Venkata Sudhakar
Eventarc is a GCP managed eventing service that routes events from Google Cloud services - Cloud Storage, Firestore, BigQuery, Cloud SQL, and others - to targets like Cloud Run services. By pointing an Eventarc trigger at a Cloud Run service that runs an ADK agent, you can fire agent logic automatically in response to any GCP infrastructure event, with no polling or custom webhook plumbing.
ShopMax India uses Eventarc in three workflows: when a new product image is uploaded to Cloud Storage, an ADK agent generates the product description automatically. When a daily sales report lands in BigQuery, an agent summarises it and sends it to the management team. When a customer record is updated in Firestore, an agent checks if the change triggers a loyalty tier upgrade.
The below example shows a Cloud Run service that receives Eventarc events from Cloud Storage and triggers an ADK agent to generate product descriptions for ShopMax India.
It gives the following output,
INFO: Cloud Run service starting on port 8080
[Eventarc] New file: gs://shopmax-products/products/SM-TV-55-QLED/front-view.jpg (image/jpeg)
[Agent] Description for SM-TV-55-QLED:
Experience cinema-quality visuals at home with the ShopMax India Samsung 55"
QLED TV, featuring 4K resolution, Quantum Dot technology, and built-in Alexa
for the modern Indian living room. Available exclusively at ShopMax stores
across Mumbai, Bangalore, Delhi, and Hyderabad - order now for same-day delivery.
[Eventarc] New file: gs://shopmax-products/products/SM-PHONE-IP15/box.jpg (image/jpeg)
[Agent] Description for SM-PHONE-IP15: iPhone 15 Pro redefines...
The below example shows the Eventarc trigger configuration using the gcloud CLI to route Cloud Storage object creation events to the ShopMax India Cloud Run service.
It gives the following output,
Deploying Cloud Run service... done
Service URL: https://shopmax-eventarc-agent-xyz.run.app
Creating Eventarc trigger... done
Trigger: shopmax-product-upload-trigger
Location: asia-south1
Destination: shopmax-eventarc-agent -> /eventarc/storage
Filter: google.cloud.storage.object.v1.finalized
Bucket: shopmax-products
Status: ACTIVE
Name: shopmax-product-upload-trigger
CreateTime: 2026-04-06T04:00:00Z
State: ACTIVE
Eventarc makes ADK agents reactive to the entire GCP infrastructure ecosystem. ShopMax India can connect agents to any GCP event source - Cloud Storage uploads, Firestore document changes, BigQuery job completions, Cloud SQL row inserts - without writing any event routing code. The agent simply receives an HTTP POST and acts on the event payload, making it trivial to extend the automation surface as new data sources come online.
|
|