A reproducible workflow for turning legacy SQL into a reviewed pipeline DAG while preserving logic, measuring cost and keeping execution human-controlled.
A current example—and the claim boundary
Google Cloud reported on November 20 that Vodafone Czech Republic used the BigQuery Data Engineering Agent, Gemini, Dataform and materialized views to refactor a multi-thousand-line stored procedure. The published customer story reports shorter execution, migration time and cost, and describes parallelizing independent steps plus caching intermediate results.
Those percentages are Google and Vodafone's reported outcome, not a DeepSecurity.io benchmark or a guarantee for another warehouse. The transferable workload is to turn a difficult legacy procedure into a reviewable graph, test each proposed optimization against an approved baseline and withhold run authority from the model.

Prepare the workspace and evidence contract
This workflow fits data engineering, analytics-platform, FinOps, security and governance teams. In BigQuery, Google documents that an administrator must enable Gemini in BigQuery and the relevant APIs. The user needs Dataform code editing, BigQuery job execution and Gemini Data Analytics stateless chat permissions appropriate to the project. Verify current regional, licensing and billing terms in the organization's own console because the cited documentation does not present one universal price or availability statement.
Create a nonproduction workspace with version-controlled SQL, expected outputs, representative partitions, freshness rules, scan-cost baselines, owners and rollback. The agent has no web access and, according to Google's current documentation, cannot execute the pipeline; a person must review and then manually run or schedule the generated Dataform workflow.
- Logic baseline: expected rows, keys, null behavior, late data and reconciliation totals.
- Security baseline: approved datasets, service identity and least-privilege access.
- Operations baseline: runtime, bytes scanned, freshness, alerts and rollback owner.
Step 1: ask for a graph, assumptions and tests
Example prompt: “Map this stored procedure into Dataform nodes without changing business logic. Mark dependencies, independent branches, repeated scans and candidate materializations. Cite the source statement for every node. For each optimization, list the parity test, freshness risk, permission needed and rollback. Do not run or schedule anything.”
The expected output is a code change plus a review table, not a production-ready pipeline. Compare the proposed graph with the source procedure and ask the business owner to validate ordering, transaction boundaries and implicit assumptions that a syntactic conversion will miss.
Step 2: replay results and measure the whole cost
Run the original and proposed pipelines over the same approved partitions. Compare row counts, checksums or domain-specific reconciliations, then inspect query plans, bytes scanned, slot use, materialization refresh cost and storage. Parallelizing work can increase full-table scans, so concurrency alone is not an optimization.
Test failures, backfills, late-arriving data and partial reruns. Cache only where freshness and invalidation are explicit. Record the generated code, agent configuration, reviewer changes and execution plan so a later model or prompt update does not silently change the basis of the result.

Step 3: approve through four operating gates
Require separate sign-off for business-logic parity, least-privilege access, measured cost behavior and operational readiness. Start with a one-time nonproduction run, then a small production slice whose owner can stop or revert it. Keep the legacy procedure callable until the new pipeline has survived scheduled operation and a tested rollback.
Useful local measures are parity failures, reviewer corrections, bytes scanned per successful run, materialization overhead, freshness violations, failed rerun recovery and time to rollback. Report a savings claim only with the baseline, workload window and denominator attached.
Limitations and topic-selection signal
Generated SQL can preserve syntax while changing semantics, a tidy test partition can hide production skew, materialized views can go stale and local speedups can shift cost elsewhere. The agent cannot supply business ownership, production authorization or a reliable forecast of savings. Preserve the old path, monitor after deployment and require people to resolve ambiguous logic.
Focused Firecrawl research on November 27 returned Google's November 20 customer case and current November 18 documentation prominently, plus a November 23 independent engineering roundup. That is fresh evidence and current attention around a concrete workload; it is not proof of search volume, rankings, universal savings or traffic to DeepSecurity.io.
Put the insight into practice.
Deep Security helps organizations assess risk, validate controls, and build a practical plan to strengthen their defenses.
Talk with Deep Security
