WorkingDirectory icon
Clone icon
Script icon
If icon
AIAgent icon
GoogleGemini icon
SlackIncomingWebhook icon
Set icon
Flow icon

Review Firestore Config Changes with an AI Agent and Alert Owners in Slack

Review Firestore config changes with a Gemini agent after each Git snapshot, rate their risk, and mention collection owners in Slack on high-risk changes.

Categories
AI

Feature flags and settings in Firestore are edited straight from the Firebase console, and nobody reads the snapshot diff until something breaks. This flow has a Gemini agent explain and rate every changed document, and mentions the collection's owner in Slack when a change is high risk.

How it works

  1. A Flow trigger starts the review each time firestore-collection-git-snapshot succeeds.
  2. Clone checks out the snapshot repository inside a WorkingDirectory.
  3. A Python script compares the snapshot files between the last reviewed commit, kept in the KV store, and HEAD, and lists each changed document with its values before and after.
  4. An If task stops here when nothing changed.
  5. An AIAgent with Google Gemini returns structured JSON: a summary, and per change an explanation, a HIGH, MEDIUM or LOW risk and the reason.
  6. SlackIncomingWebhook posts the review and mentions the owner from vars.owners next to each HIGH change.
  7. kv.Set stores the reviewed commit, and the errors branch posts to Slack if any step fails.

What you get

  • A plain-language review of every console edit.
  • Owners notified only for risky changes to their own collections.
  • No message on quiet nights, and no change reviewed twice.

Who it's for

  • Product and platform teams that keep feature flags, settings or prices in Firestore.

Why orchestrate this with Kestra

  • The review starts on the snapshot's success event, never on a half-pushed commit.
  • The bookmark only moves after a successful review, so a failed run is retried on the next snapshot.
  • Every review keeps its outputs and token usage in the execution history.

Prerequisites

  • The Firestore collection snapshot blueprint running in the same namespace.
  • A Gemini API key from Google AI Studio. The free tier is enough for small collections.
  • A worker that can run Docker containers, for the python:3.12 image.

Secrets

  • GITHUB_USERNAME: Git username that owns the token.
  • GITHUB_TOKEN: token with read access to the snapshot repository.
  • GEMINI_API_KEY: Google AI Studio API key used by the agent.
  • SLACK_WEBHOOK: Slack incoming webhook URL for reviews and failure alerts.

Quick start

  1. Add the four secrets to your namespace.
  2. Set repo_url in the trigger inputs to the snapshot repository, and map each collection to its owner's Slack member ID in variables.owners.
  3. Execute the flow once by hand to review the latest snapshot commit.
  4. Change a document in the Firebase console and run the snapshot flow. The review follows on its own.

How to extend

  • Open a GitHub issue for every HIGH change, assigned to the owner.
  • Give the agent your flag documentation, so it can tell a planned rollout from a mistake.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.