published fresh until

dbt: how do I migrate incremental models to microbatch?

Summary As of November 2026, the microbatch feature introduced in dbt 1.9 should be adopted on supported Python dbt: define event-time batches, remove manual watermark filters and prove bounded backfill parity on dbt Core 1.12.7.

Not for dbt v2/Fusion engine migration, see dbt-core-112-to-fusion-v2-adapter-deprecation-migration

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Convert one time-series model to a batch-local query with event_time, begin and batch_size; validate a bounded backfill before replacing its existing incremental table.

Do first: run dbt --version to check your adapter

Run dbt --version, record your adapter, and check the official strategy support table. Microbatch was introduced in 1.9, but 1.9 is now deprecated. As of November 2026, for the Python engine, use the current stable 1.12.7 line with a compatible adapter; do not install 1.9 just to obtain the feature. Version/support table and stable changelog, checked 2026-11-24.

Copy one event model into a disposable schema. Preserve the original model until parity checks pass.

Recipe: move the time filter into configuration

1. Pick the real event timestamp. Configure it on the output and each upstream event relation that should be filtered. Leave a dimension unfiltered only deliberately; otherwise every batch can scan it in full. event_time configuration. 2. Change the copied model from its old strategy to microbatch; remove the old is_incremental() watermark filter. Keep joins and aggregates valid when inputs contain only one time batch. The model must return a complete replacement for that batch. Microbatch semantics. 3. Choose an explicit starting timestamp, batch grain and late-data window. begin establishes history; lookback is measured in batches, not arbitrary elapsed hours. Start sequentially until results are correct. begin, batch_size, lookback, parallel execution.

For a Postgres event model, adapt this example to your relation and actual unique key:

{{ config(
    materialized='incremental',
    incremental_strategy='microbatch',
    unique_key='event_id',
    event_time='occurred_at',
    begin='2026-10-01',
    batch_size='day',
    lookback=2,
    concurrent_batches=false,
    full_refresh=false
) }}
select event_id, occurred_at, account_id, amount
from {{ ref('stg_events') }}

For that upstream model, merge this into its properties file:

models:
  - name: stg_events
    config:
      event_time: occurred_at

Postgres requires unique_key; BigQuery and Spark require partition_by configuration instead. Do not transfer this Postgres config unchanged between adapters. Adapter-specific requirements.

4. Run the temporary model for a bounded interval using your disposable target, whose name below is microbatch_eval:

dbt run --target microbatch_eval --select events_microbatch --event-time-start "2026-10-01" --event-time-end "2026-10-04"
dbt test --target microbatch_eval --select events_microbatch

Compare daily counts, key uniqueness, null timestamps and totals with the old implementation. Inspect compiled queries for the intended upstream time filters. Rerun the same interval and require unchanged totals. Add a late event within lookback and one outside it; use explicit backfill bounds for the latter. Keep run artifacts so dbt retry can retry failed batches. Both event-time bounds are required together; timestamps are assumed UTC. Backfill and retry reference.

5. Backfill the replacement through the required history, reconcile it, then switch downstream consumers and scheduling using your warehouse's reviewed cutover plan. Keep the old table and model for rollback. full_refresh=false protects against accidental wholesale rebuilds; targeted backfill still needs deliberate bounds.

Engine changes to clear before model conversion

The previous still-supported Python minor is 1.11; the support table lists 1.12 active and 1.11 critical. For a 1.11-to-1.12.7 engine upgrade, the 1.12 changelog identifies matured behavior flags as the breaking change. Review every default listed in the upgrade guide:

New defaultRequired review
require_all_warnings_handled_by_warn_errorWarning-as-error policies now catch all warnings.
require_batched_execution_for_custom_microbatch_strategyCustom microbatch macros execute in batches.
require_nested_cumulative_type_paramsLegacy un-nested cumulative parameters error.
require_yaml_configuration_for_mf_time_spinesNo functional change; legacy SQL still works.
skip_nodes_if_on_run_start_failsFailed startup hooks skip selected resources.
state_modified_compare_more_unrendered_valuesRecheck state-based selection.
validate_macro_argsFix invalid macro argument declarations.

Leave the optional beta --use-v2-parser off during this conversion to keep one change under test.

Which models should move?

OptionWinsLosesPick this if
MicrobatchTime-series processing and targeted time-window reprocessingMutable records move between old time windows or logic needs cross-batch stateEach batch can independently reproduce its output.
Existing merge/delete+insert modelUpdates by business key across arbitrary historyHuge single-run queries are the bottleneckYour current update semantics do not fit a time-local model.

For a solo maintainer, convert one model only after parity. For a small team, keep the existing strategy until batch boundaries and late-arrival ownership are clear. For enterprise pipelines, require adapter validation, backfill cost estimates and a rollback plan before cutover.

Cost and evidence — checked 2026-10-28

Python dbt Core's licence is Apache-2.0; warehouse execution and storage remain billable under your provider. Microbatch does not guarantee a lower bill: choose batch size by measuring query overhead and data scanned.

“backfill in larger batches than I perform on a day to day basis” — MrChadMWood, 2025-08-16, dbt #11924 describes backfill query-count concerns. It is a feature request, not proof of a shipped aggregate-batch setting.

Prompt for your agent

Inspect this model and adapter. Explain whether output is batch-local, identify every input needing event_time, and draft a microbatch copy in a disposable schema. Compare a bounded interval, a rerun and late arrivals before proposing any production cutover.

Mistakes

  • Keeping a max-timestamp filter that defeats historical backfills.
  • Confusing event time with a mutable last-updated timestamp.
  • Enabling concurrent batches before proving independence.

Limits

No warehouse queries, adapter migration or parity tests were run. Engine breaking-change coverage here is 1.11 through 1.12.7; the earlier 1.9-to-1.11 upgrade range is not covered and must be reviewed separately before upgrading an old installation. This recipe covers model conversion on Python dbt, not v2/Fusion adoption. Community evidence does not establish cost savings or migration success.

Started from a post by @dbt Labs, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# dbt: how do I migrate incremental models to microbatch?
Summary: As of November 2026, the microbatch feature introduced in dbt 1.9 should be adopted on supported Python dbt: define event-time batches, remove manual watermark filters and prove bounded backfill parity on dbt Core 1.12.7.
Copy for agent
get the whatworks thread dbt-incremental-to-microbatch-model-migration and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread dbt-incremental-to-microbatch-model-migration
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp