From manual to autonomous: A blueprint for agentic process automation

TL;DR

This blog outlines a multi-agent Google Cloud architecture designed to turn enterprise customer value management into an autonomous analytics engine. By coordinating specialized agents for query generation, data analysis, and visualization; our framework lets teams go beyond complex business questions to actionable insights.

Problem

In traditional customer value management, it often takes weeks to move from asking a high-value business question to launching a targeted campaign.

Consider a common scenario: a business leader wants to know why premium subscriber retention dipped last month in a key regional cohort. An analytics ticket is filed, a data engineer writes SQL to query petabyte-scale data lakes, an analyst reshapes the output into a dashboard, and a strategy team manually designs campaign segments.

Each handoff adds operational latency and misinterpretation risks. That’s why modern architectures are moving away from static dashboards and basic chatbots.

By designing an end-to-end multi-agent system on Google Cloud, organizations can transition analytical workflows from reactive reporting into an intent-driven autonomous engine. This system navigates complex schemas and multi-step cohort diagnostics to deliver insights in minutes.

Below, we outline the blueprint, patterns, and evaluation strategy required to build enterprise-grade agentic process automation.

What we built

1. System architecture: The multi-agent orchestration framework

A single monolithic LLM prompt can’t reliably parse database relationships, execute complex statistical aggregations, and render visuals all at the same time. To achieve high accuracy and predictable latency, the workflow must be decoupled into specialized and collaborative agents orchestrated under a modular pattern.

Component Operational responsibility Key architectural mechanism
Schema pre-processor Context window optimization and schema linking Runs a two-step retrieval pass to identify candidate tables and dynamically injects relevant BigQuery schema and BigQuery DDLs into the prompt context.
Root orchestrator Intent parsing and execution trajectory Maintains multi-turn conversation state, routes sub-tasks to specialists, and compiles final natural-language explanations.
Database agent NL2SQL synthesis and validation Generates dialect-accurate BigQuery SQL with automated self-healing execution loops and persists query artifacts.
Data science agent In-memory transformations and cohort analysis Executes sandboxed Python code to perform transformation and analysis on tabular data.
Visualization agent Visual insight rendering Transforms tabular outputs into suitable charts.

2. Core engineering tools and context optimization strategies

Deploying agents over complex enterprise data requires strict grounding. As such, we’ve implemented several prompt engineering and tool-design strategies to maintain high-quality generation:

Dynamic example selection and business knowledge injection

Stuffing hundreds of static few-shot examples or entire enterprise data dictionaries into an LLM context exhausts token limits, inflates inference latency, and degrades reasoning quality.

  • Vector-grounded few-shot retrieval: Curated “golden” question-query pairs are indexed in a vector store. At runtime, the system uses semantic similarity to retrieve and inject only the k-most relevant question-query pairs into the context window.

  • Dynamic business glossary: Domain-specific business logic like exact rules for calculating active churn, port-outs, or tenure cohort is indexed in structured formats and retrieved dynamically to guide SQL WHERE clause formulation.

Self-healing query validation loops

To prevent broken SQL, the database agent operates within an automated feedback loop:

  1. The agent synthesizes candidate BigQuery SQL based on the user’s intent.

  2. A dry-run validation checks syntax, type casting (e.g., explicit TIMESTAMP casting), and table partition filters.

  3. If BigQuery returns an execution or schema error, the error traceback is routed to the agent for correction before execution.

Query persistence for downstream actionability

An analytics agent should not be a dead end. When the system identifies a useful cohort selection question (via user feedback), it saves the generated SQL definition and results via dedicated query storage tools. Downstream marketing platforms can then ingest the audience segment directly for campaign execution.

3. Multi-tier evaluation: Moving beyond guesswork

Evaluating a multi-agent system requires assessing each sub-agent on its specialized output rather than relying on a single overall score.

Evaluation target Evaluated capability Metrics and methodology
Root orchestrator Sub-agent routing and multi-turn state tracking Agent trajectory evaluation: Verifying step-by-step tool invocation paths against golden task trajectories.
Database agent SQL generation correctness Execution accuracy (EX) and Exact match (EM) against live BigQuery datasets.
Data science agent Statistical explanations and insights Objective: ROUGE-L, BERTScore. LLM-as-a-judge: Factuality, coherence.
Visualization agent Chart correctness and fidelity Data similarity verification: Comparing underlying tabular data distributions to eliminate visual false positives/negatives.

To scale testing across hundreds of business questions, we used Agent Platform’s Gen AI evaluation service to benchmark agent changes against regression suites before promoting prompt or model updates to production.

Technical wins and lessons learned

Building an enterprise agent platform highlights key architectural lessons:

  • :bullseye: Metadata quality dictates the accuracy ceiling: On complex enterprise schemas, baseline accuracy is generally. By refining table and column descriptions, removing unused legacy attributes, and establishing clear business glossaries, accuracy can be greatly improved on golden test suites without fine-tuning models. Your data documentation is your prompt.

  • :locked_with_key: Cross-environment interoperability and security: Bridging conversational frontends (such as Gemini Enterprise) with backend runtimes (Agent Platform Agent Runtime / Cloud Run) requires strict IAM roles, service-to-service token propagation, and end-to-end encryption of user queries to meet governance requirements.

  • :chart_increasing: Explainability drives adoption: Business users hesitate to trust black-box outputs. Designing the orchestrator to provide clear step-by-step reasoning alongside generated SQL and visuals of data is essential to build user trust.

Key takeaways

Moving enterprise workflows from manual pipelines to autonomous systems takes more than prompt templates. It requires:

  1. A real-time, unified data fabric acting as the live source of truth.

  2. Modular multi-agent decomposition separating schema linking, SQL synthesis, statistical analysis, and visualization.

  3. Continuous, multi-tier evaluation pipelines that track performance across every tool call and agent trajectory.

When these architectural pillars are in place, agentic automation stops being an experimental showcase and becomes a dependable system for enterprise transformation.

Question:

  • How are you seeing others build complex multi-agent workflows for manual process automations using their own stack?
13 Likes

At what point would you require human approval before an agent can act on its own? Especially when the generated insight or SQL could lead to a business decision, I’d be curious how you define that boundary in production.

2 Likes

Thank you for the question.

I think there are a two main scenarios here: volume of user queries is such that every output can be vetted and volume of user queries is high. For the case where every output can be vetted We can add the HITL stage after the result of a user query is generated. The query and other details like explanation are being persisted as per this blueprint so the HITL has complete transparency to check if what was generated makes sense. For the other case, we can attach a confidence score to query generation using approaches like self-consistency. We query the model n times with same input for the SQL so the confidence score would be m/n where m is the number of times the same query is generated.

1 Like

That makes sense. I like the idea of combining HITL with a confidence score as the query volume grows. Would you also use the confidence score as a threshold to decide when human review is required?

2 Likes

Thank you for the response. Thresholding would be important here. We can setup some arbitary starting threshold. Remember these values are being persisted in BQ so we can set an alert on top of it. As the persisted query, confidence score, etc data volume grows we can do a distribution analysis to determine the exact business threshold.

2 Likes

Great article! “Your data documentation is your prompt” was my biggest takeaway. It’s a useful way to explain why an agent’s output depends so much on how clearly the underlying data and business rules are documented. Have you found that improving the documentation changes the quality of the results more than refining the prompts themselves?

2 Likes

Thank you for your question. Absolutely, we had empirical findings on improvements obtained just by improving the table names, column names and descriptions of columns.

1 Like