Fluid Forge
Get Started
See it run
  • Local (DuckDB)
  • Source-Aligned (Postgres → DuckDB)
  • AI Forge + Data Models
  • GCP (BigQuery)
  • Snowflake Team Collaboration
  • Declarative Airflow
  • Orchestration Export
  • Jenkins CI/CD
  • Universal Pipeline
  • 11-Stage Production Pipeline
  • Catalog Forge End-to-End
CLI Reference
  • Overview
  • Quickstart
  • Examples
  • Your own CI
  • Your own scaffolding
  • Custom validator
  • Apply hook
  • Reference
Demos
  • Overview
  • Architecture
  • GCP (BigQuery)
  • AWS (S3 + Athena)
  • Snowflake
  • Local (DuckDB)
  • Custom Providers
  • Roadmap
GitHub
GitHub
Get Started
See it run
  • Local (DuckDB)
  • Source-Aligned (Postgres → DuckDB)
  • AI Forge + Data Models
  • GCP (BigQuery)
  • Snowflake Team Collaboration
  • Declarative Airflow
  • Orchestration Export
  • Jenkins CI/CD
  • Universal Pipeline
  • 11-Stage Production Pipeline
  • Catalog Forge End-to-End
CLI Reference
  • Overview
  • Quickstart
  • Examples
  • Your own CI
  • Your own scaffolding
  • Custom validator
  • Apply hook
  • Reference
Demos
  • Overview
  • Architecture
  • GCP (BigQuery)
  • AWS (S3 + Athena)
  • Snowflake
  • Local (DuckDB)
  • Custom Providers
  • Roadmap
GitHub
GitHub
  • Introduction

    • Home
    • Getting Started
    • Snowflake Quickstart
    • See it run
    • Forge Data Model
    • Vision & Roadmap
    • Playground
    • FAQ
  • Concepts

    • Concepts
    • Builds, Exposes, Bindings
    • What is a contract?
    • Quality, SLAs & Lineage
    • Governance & Policy
    • Agent Policy (LLM/AI governance)
    • Providers vs Platforms
    • Fluid Forge vs alternatives
  • Data Products

    • Product Types — SDP, ADP, CDP
  • Walkthroughs

    • Walkthrough: Local Development
    • Source-Aligned: Postgres → DuckDB → Parquet
    • AI Forge And Data-Model Journeys
    • Walkthrough: Deploy to Google Cloud Platform
    • Walkthrough: Snowflake Team Collaboration
    • Declarative Airflow DAG Generation - The FLUID Way
    • Generating Orchestration Code from Contracts
    • Jenkins CI/CD for FLUID Data Products
    • Universal Pipeline
    • The 11-Stage Pipeline
    • End-to-End Walkthrough: Catalog → Contract → Transformation
  • CLI Reference

    • CLI Reference
    • fluid init
    • fluid demo
    • fluid forge
    • fluid skills
    • fluid status
    • fluid validate
    • fluid plan
    • fluid apply
    • fluid generate
    • fluid generate artifacts
    • fluid validate-artifacts
    • fluid verify-signature
    • fluid generate-airflow
    • fluid generate-pipeline
    • fluid viz-graph
    • fluid odps
    • fluid odps-bitol
    • fluid odcs
    • fluid export
    • fluid export-opds
    • fluid publish
    • fluid datamesh-manager
    • fluid market
    • fluid import
    • fluid policy
    • fluid policy check
    • fluid policy compile
    • fluid policy apply
    • fluid contract-tests
    • fluid contract-validation
    • fluid diff
    • fluid test
    • fluid verify
    • fluid product-new
    • fluid product-add
    • fluid workspace
    • fluid ide
    • fluid ai
    • fluid memory
    • fluid mcp
    • fluid scaffold-ci
    • fluid scaffold-composer
    • fluid scaffold-ide
    • fluid docs
    • fluid config
    • fluid split
    • fluid bundle
    • fluid auth
    • fluid doctor
    • fluid providers
    • fluid provider-init
    • fluid roadmap
    • fluid version
    • fluid runs
    • fluid retention
    • fluid secrets
    • fluid stats
    • fluid contract
    • fluid ship
    • fluid rollback
    • fluid schedule-sync
    • Catalog adapters

      • Source Catalog Integration (V1.5)
      • BigQuery Catalog
      • Snowflake Horizon Catalog
      • Databricks Unity Catalog
      • Google Dataplex Catalog
      • AWS Glue Data Catalog
      • DataHub Catalog
      • Data Mesh Manager Catalog
    • CLI by task

      • CLI by task
      • Add quality rules
      • Add agent governance
      • Debug a failed pipeline run
      • Switch clouds with one line
  • Recipes

    • Recipes
    • Recipe — add a quality rule
    • Recipe — switch clouds with one line
    • Recipe — tag PII in your schema
  • SDK & Plugins

    • SDK & Plugins
    • Quickstart — your first plugin
    • Examples

      • Runnable examples
      • Example: hello-scaffold — the minimal viable plugin
      • Example: gitlab-ci-scaffold — generate a complete CI project
      • Example: steward-validator — a custom governance rule
      • Example: prod-key-guard — apply-time invariant check
    • Journeys

      • Journeys
      • Your own CI/CD

        • You have your own CI/CD setup, no problem
        • GitLab CI — the bundle template
        • GitHub Actions — the bundle template
        • Jenkins — the bundle template
        • CircleCI — the bundle template
      • You have a strict project layout, no problem
      • You have governance rules, no problem
      • You want a check at apply time, no problem
    • Reference

      • Reference
      • Roles reference
      • Entry points reference
      • Trust model
      • Packaging
      • Companion packages
  • Providers

    • Providers
    • Provider Architecture
    • GCP Provider
    • AWS Provider
    • Snowflake Provider
    • Local Provider
    • Creating Custom Providers
    • Provider Roadmap
  • Advanced

    • Blueprints
    • Governance & Compliance
    • Airflow Integration
    • Built-in And Custom Forge Guidance
    • FLUID Forge Contract GPT Packet
    • Forge Discovery Guide
    • Forge Memory Guide
    • LLM Providers
    • Capability Warnings
    • LiteLLM Backend (opt-in)
    • MCP Server
    • Credential Resolver — Security Model
    • Cost Tracking
    • Agentic Primitives
    • Typed Errors
    • Typed CLI Errors
    • Authoring Forge Tools
    • Source-Aligned Acquisition
    • API Stability — fluid_build.api
    • Guided fluid forge UX
    • V1.5 Catalog Integration — Architecture Deep-Dive
    • V1.5 + V2 Hardening — Release Notes
  • Project

    • Contributing to Fluid Forge
    • Fluid Forge Docs Baseline: CLI 0.8.3
    • Fluid Forge Docs Baseline: CLI 0.8.0
    • Fluid Forge Docs Baseline: CLI 0.7.11
    • Fluid Forge Docs Baseline: CLI 0.7.9
    • Fluid Forge v0.7.1 - Multi-Provider Export Release

fluid rollback

Restore a data product from the auto-snapshot taken before a destructive fluid apply --mode replace / replace-and-build. This is the "how do I undo this?" answer after a bad destructive deploy.

Added in 0.8.0.

Syntax

# Restore
fluid rollback --env ENV --product PRODUCT_ID [--snapshot NAME] [--dry-run] [--yes]

# Discovery (read-only)
fluid rollback --list [--env ENV] [--product PRODUCT_ID]

Key options

Restore mode

OptionDescription
--envEnvironment the product was applied to (dev / staging / prod / …). Required for restore.
--productProduct ID from the contract (matches the id field). Required for restore.
--snapshotSpecific snapshot name to restore. Default: the most recent snapshot matching --env + --product.
--state-filePath to the rollback state file. Default .fluid/rollback-state.json relative to CWD.
--dry-runPrint the target snapshot + restore DDL without executing. Use before every production rollback.
--yesConfirm the destructive restore. Required when not --dry-run.

Discovery mode

OptionDescription
--listList available snapshots from .fluid/rollback-state.json without performing any restore. Optionally narrow with --env and/or --product. Read-only; safe in any env.

How snapshots are created

Every time fluid apply --mode replace* runs, the pipeline auto-snapshots the target before the destructive DDL. The snapshot is recorded in .fluid/rollback-state.json (git-ignored by default):

{
  "version": "1",
  "snapshots": [
    {
      "timestamp": "2026-04-23T10:00:00Z",
      "env": "prod",
      "product_id": "silver.telco.subscriber360_v1",
      "backup_name": "backup_silver_telco_subscriber360_v1_1714000000",
      "provider": "snowflake",
      "mode": "replace",
      "location": {"database": "TELCO_LAB", "schema": "TELCO_FLUID_DEMO"}
    }
  ]
}

Per-provider snapshot technique. Snowflake clones are table-level, not database-level — the snapshot's ddl[] array is the source of truth, and limiting clones to the tables actually being changed avoids overwriting unrelated tables in the same database during restore.

ProviderSnapshotRestore
SnowflakeCREATE OR REPLACE TABLE <db>.<sch>.<tbl>__backup CLONE <db>.<sch>.<tbl> (per-table, zero-copy)CREATE OR REPLACE TABLE <db>.<sch>.<tbl> CLONE <db>.<sch>.<tbl>__backup
BigQuerybq cp --force <src> <backup> per tablebq cp --force <backup> <src> per table
RedshiftCREATE TABLE <backup> AS SELECT * FROM <src> (slow but correct)TRUNCATE <src>; INSERT INTO <src> SELECT * FROM <backup> in a transaction

Examples

Discovery before a restore

Always check what's available first — --list is read-only:

# All recorded snapshots, newest first
fluid rollback --list

# Narrow by environment
fluid rollback --list --env prod

# Narrow by product
fluid rollback --list --product silver.telco.subscriber360_v1

# Both filters
fluid rollback --list --env prod --product silver.telco.subscriber360_v1

Sample output:

  #  timestamp                   env       mode                  product_id                                  backup_name
-----------------------------------------------------------------------------------------------------
  1  2026-04-23T10:00:00Z        prod      replace-and-build     silver.telco.subscriber360_v1              backup_silver_telco_subscriber360_v1_1714001000
  2  2026-04-20T10:00:00Z        dev       replace               silver.telco.subscriber360_v1              backup_silver_telco_subscriber360_v1_1713000000

[rollback] 2 snapshot(s). Restore with:
fluid rollback --env <ENV> --product <ID> --snapshot <BACKUP_NAME> --yes

Dry-run preview (SAFE — no state mutation)

fluid rollback \
  --env prod \
  --product silver.telco.subscriber360_v1 \
  --dry-run

Prints the exact DDL that would run, the chosen snapshot, and the timestamp. Use this before every production rollback.

Restore the latest snapshot

fluid rollback \
  --env prod \
  --product silver.telco.subscriber360_v1 \
  --yes

--yes is required unless --dry-run is also set. Rollback is destructive (it overwrites the current state with the snapshot).

Restore a specific named snapshot

Useful when the "latest snapshot" isn't what you want (e.g. you want to roll back two deploys, not one):

fluid rollback \
  --env prod \
  --product silver.telco.subscriber360_v1 \
  --snapshot backup_silver_telco_subscriber360_v1_1713000000 \
  --yes

Copy the backup_name from fluid rollback --list output.

Safety properties

  • Two-factor destructive gate: --yes required unless --dry-run. Refuses to run otherwise with a clear error.
  • SQL-injection hardened: every identifier (database, backup name) flows through validate_ident + quote_string_literal from providers/_sql_safety.py before the CLONE / bq cp / CTAS DDL is composed. A malicious --snapshot value is rejected by the whitelist, not interpolated.
  • Read-only discovery: --list is guaranteed to not touch the provider. Regression-tested — a future change that accidentally dispatches to the provider restore path under --list breaks the CI.
  • Idempotent: restoring the same snapshot twice produces the same final state.

Notes

  • .fluid/rollback-state.json is part of the product's operational history. Commit it to the product repo for an audit trail, or treat it as ephemeral and rely on warehouse-level snapshot retention instead.
  • --list exits 0 even when the state file doesn't exist (a fresh workspace has no snapshots — that's not a failure).
  • For providers that don't yet have a restore implementation (BigQuery and Redshift are limited), the CLI raises rollback_not_implemented with an actionable hint for the equivalent manual workflow.
  • Rollback is stage-8-agnostic: IAM bindings are not re-applied by rollback. If you need both the data AND the policy rolled back, chain fluid rollback with a re-run of fluid policy apply against the historical bindings.json.
Edit this page on GitHub
Last Updated: 5/13/26, 6:01 AM
Contributors: fas89
Prev
fluid ship
Next
fluid schedule-sync