DATA OPS
On-demand expensive-query triage and rewrite suggestions
When someone flags a costly BigQuery job in Slack, an agent pulls the query and its execution stats, diagnoses why it is expensive, drafts a cheaper rewrite.
How it runs
The automated pipeline, trigger to output.
- TriggerSlack mention with BigQuery job IDSlack
- ActionFetch job SQL and execution stats from BigQueryBigQuery
- ActionAnalyze cost drivers with the modelOpenAI
- LogicDecide if a rewrite is warranted
- OutputPost diagnosis and rewrite to the Slack threadSlack
What it does
Triggered by a Slack mention with a BigQuery job ID, an agent fetches the job's SQL and execution metadata, reasons about the cost drivers (full scans, missing partition filters, exploding joins), and produces a plain-language explanation plus a suggested optimized query. It posts the diagnosis and rewrite back into the originating Slack thread and tags the original author.
When to use it
Use this when the data team wants self-serve cost coaching instead of a senior engineer manually reviewing every flagged query. It turns a one-line Slack ping into an actionable optimization writeup the author can act on immediately.
How it works
- 1A Slack mention with a job ID triggers the workflow.
- 2A BigQuery action retrieves the job's SQL text and execution statistics including bytes billed and referenced tables.
- 3The agent analyzes the query and stats to identify the dominant cost drivers.
- 4A logic step decides whether a rewrite is warranted or the query is already efficient.
- 5The agent drafts an optimized query and a short explanation, then posts it to the Slack thread tagging the author.
Set it up
What you configure once, before turning it on.
- 1Connect BigQueryDatasets, queries, schemas.
- 2Connect SlackChannels, DMs, threads, mentions.
- 3Connect OpenAIModels, embeddings, files.
- 4Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
- 5Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
- 6Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.
More Data Ops workflows
Weekly BigQuery Cost Trend Sheet and Exec Digest
Compiles week-over-week BigQuery scheduled-query cost by owner and dataset into a Google Sheet with trend columns.
Daily BigQuery Scheduled-Query Cost Attribution to Owners
Each morning, totals the prior day's on-demand bytes-billed per scheduled query, maps each query to its owner from a label, and posts a per-owner cost leaderboard to Slack.
BigQuery Per-Team Budget Breach Alert to PagerDuty
Tracks month-to-date BigQuery scheduled-query spend per team and, when a team crosses its monthly budget, pages the team's on-call in PagerDuty and snapshots the spend breakdown…
dbt source freshness watcher with severity-routed alerts
Checks Snowflake loaded-at timestamps against each dbt source's freshness SLA, then routes warnings to Slack and hard breaches to a PagerDuty incident so stale data never…
dbt orphan model detector with Linear cleanup tickets
Scans your dbt manifest for models that no other model, exposure, or BI tool consumes.
Raw Sensor Telemetry Archive to BigQuery
Captures every incoming building sensor reading via webhook, normalizes the payload into a consistent schema.
Run it inside a business
This workflow drops into a full company template. Import the org, and this is one of the playbooks its agents run.

Run this workflow in your colony.
14-day trial. No DevOps. No Sales call. Provisioned in under a minute.
