|
|
ADK with Cloud Scheduler
Author: Venkata Sudhakar
Not every agent workflow needs a human trigger. Daily sales summaries, morning inventory alerts, weekly performance reports, and end-of-month reconciliation tasks all run on fixed schedules. Google Cloud Scheduler is a fully managed cron service that sends HTTP requests to a Cloud Run endpoint at a configured time, making it straightforward to run ADK agents on autopilot.
ShopMax India uses Cloud Scheduler to run three recurring agent tasks: a 7am daily stock alert that flags items below reorder level across all warehouses, a 6pm daily sales summary sent to the management team, and a Monday morning weekly performance report covering all cities. All three are ADK agents triggered by scheduled HTTP calls to Cloud Run endpoints.
The below example shows a Cloud Run service that hosts a scheduled ADK agent to generate a ShopMax India daily stock alert report.
It gives the following output,
[Scheduler] Stock alert triggered at 2026-04-06T01:30:00 (07:00 IST)
SHOPMAX INDIA - Daily Stock Alert Report
Generated: 06 April 2026, 07:00 IST
ITEMS BELOW REORDER LEVEL:
SKU | City | Stock | Reorder | Shortfall
SM-PHONE-OP12 | Delhi | 8 | 25 | -17
SM-PHONE-S24 | Pune | 3 | 20 | -17
SM-AUDIO-BOAT | Chennai | 12 | 30 | -18
RECOMMENDED ACTIONS:
1. Raise emergency PO for SM-PHONE-S24 (Pune) - critically low at 3 units
2. Transfer 10 SM-PHONE-OP12 units from Mumbai to Delhi warehouse
3. Place standard reorder for SM-AUDIO-BOAT (Chennai)
Email sent to ['[email protected]', '[email protected]']
The below example shows the gcloud CLI commands to deploy the Cloud Run service and create the Cloud Scheduler job that triggers it daily at 7am IST.
It gives the following output,
Deploying Cloud Run service... done
Service URL: https://shopmax-scheduled-agents-xyz.run.app
Creating scheduler job: shopmax-daily-stock-alert... done
Schedule: 30 1 * * * (daily 07:00 IST)
Target: POST /scheduled/stock-alert
Creating scheduler job: shopmax-weekly-report... done
Schedule: 30 2 * * 1 (Monday 08:00 IST)
Target: POST /scheduled/weekly-report
ID LOCATION SCHEDULE STATUS
shopmax-daily-stock-alert asia-south1 30 1 * * * ENABLED
shopmax-weekly-report asia-south1 30 2 * * 1 ENABLED
Cloud Scheduler with ADK agents replaces brittle cron scripts and manual reporting workflows at ShopMax India. Each scheduled job runs a fully capable Gemini-powered agent that can query live data, reason about results, generate narrative summaries, and dispatch notifications - all automatically, on time, every day, without any human in the loop.
|
|