Docs
Advanced TopicsWriting Custom dbt Models

Writing Custom dbt Models

Embed standard dbt Core SQL directly into your visual canvas. The engine will seamlessly compile the ref() lineage graph and execute it pushed-down natively into your target data warehouse.

Note

Custom dbt models are executed exactly as written. They bypass the AI Auto-Healer mechanisms during execution. If an upstream schema drifts, the Copilot will flag a warning during compilation but will not auto-patch your manual SQL script.

Extending Auto-Generated SQL

While the AI Copilot provides over 95% of the boilerplate logic to build a standard dimensional model, Advanced Analytics teams inevitably encounter hyper-specific business logic scenarios that require manual intervention.

  • Custom fiscal-year padding and window functions
  • Highly proprietary domain-specific matching algorithms
  • Overriding default materialized view clustering maps
models/gold/custom_fiscal_model.sql
{{ config(materialized='table') }} WITH base_orders AS ( SELECT * FROM {{ ref('stg_orders') }} ) SELECT id, customer_id, -- Insert highly custom fiscal logic here manually calculate_custom_fiscal_quarter(order_date) AS fiscal_qtr FROM base_orders WHERE status != 'cancelled';

The dbt Node Integration Pipeline

Within the Pipeline Canvas, dragging a pure "dbt Component" allows you to seamlessly mix AI nodes and completely manual overrides. Once injected, DataFlow AI natively renders this custom model back into its global Data Catalog and Lineage Graph, ensuring zero loss of observability.

← Back to Main App

© 2026 DataFlow AI Docs