---
title: Load and process data incrementally with Lakeflow pipeline flows
description: A Lakeflow pipeline flow is a query that loads and processes data incrementally. Includes default flows, append flows, Auto CDC, and update flows.
canonical_url: https://docs.databricks.com/aws/en/ldp/concepts/flows
---

# Load and process data incrementally with Lakeflow pipeline flows

Data is processed in pipelines through *flows*. Each flow consists of a *query* and, typically, a *target*. The flow processes the query, either as a batch, or incrementally as a stream of data into the target. A flow lives within a Lakeflow pipeline.

Typically, flows are defined automatically when you create a query in a pipeline that updates a target, but you can also explicitly define additional flows for more complex processing, such as appending to a single target from multiple sources.

Flows are securable objects in Unity Catalog (Beta), so you can grant privileges to view, refresh, or manage individual flows. See [Flows in Unity Catalog](https://docs.databricks.com/aws/en/data-governance/unity-catalog/flows.md).

## Updates

A flow is run each time that its defining pipeline is updated. The flow will create or update tables with the most recent data available. Depending on the type of flow and the state of the changes to the data, the update may perform an incremental refresh, which processes only new records, or perform a full refresh, that reprocesses all records from the data source.

* For more information about pipeline updates, see [Run a pipeline update](https://docs.databricks.com/aws/en/ldp/updates.md).
* For more information about scheduling and triggering updates, see [Triggered vs. continuous pipeline mode](https://docs.databricks.com/aws/en/ldp/concepts/pipeline-mode.md).
* For the Structured Streaming trigger that streaming flows use in each pipeline mode, see [Structured Streaming triggers by pipeline mode](https://docs.databricks.com/aws/en/ldp/concepts/pipeline-mode.md#trigger-types).

## <a id="append-flows" />Default flows and append flows

When you create a query in a pipeline that updates a target, a *default flow* is defined automatically. For a streaming table, the default flow is an *append* flow that adds new rows with each update, and it has the same name as the target. Creating a flow and its target in a single step is the most common way to use pipelines, and you can use it to ingest or transform data.

You can also define flows separately from a target, which lets multiple flows append data to a single target. This is useful when you need to:

* Add streaming sources that append to an existing streaming table without requiring a full refresh.
* Backfill a streaming table with missing historical data.
* Combine data from multiple sources without using a `UNION` clause.

For examples of creating default and explicit flows, see [Use flows in Lakeflow pipelines](https://docs.databricks.com/aws/en/ldp/flow-examples.md).

## <a id="flow-types" />Types of flows

The default flow of a streaming table is an append flow. The default flow of a materialized view processes data in batch. You can also create flows to read from *change data capture* data sources. The following table describes the different types of flows.

| Flow type                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Append                                | *Append* flows are the most common type of flow, where new records in the source are written to the target with each update. They use append mode in Structured Streaming, except in the cases described in [Output modes by flow type](https://docs.databricks.com/aws/en/ldp/concepts/flows.md#output-modes). You can add the `ONCE` flag, indicating a batch query whose data should be inserted into the target only one time, unless the target is fully refreshed. Any number of append flows can write to a particular target.<br />Default flows (created with the target streaming table or materialized view) have the same name as the target. Other targets do not have default flows. |
| Auto CDC (previously *apply changes*) | An *Auto CDC* flow ingests a query containing change data capture (CDC) data. Auto CDC flows can only target streaming tables, and the source must be a streaming source (even in the case of `ONCE` flows). Multiple auto CDC flows can target a single streaming table. A streaming table that acts as a target for an auto CDC flow can only be targeted by other auto CDC flows.<br />For more information about CDC data, see [The AUTO CDC APIs: Simplify change data capture with pipelines](https://docs.databricks.com/aws/en/ldp/cdc.md).                                                                                                                                                |
| Update (Public Preview)               | *Update* flows output global, non-watermarked streaming aggregates to a sink, emitting only the records that changed in each batch.<br />Update flows are only available in Python. See [update\_flow](https://docs.databricks.com/aws/en/ldp/developer/ldp-python-ref-update-flow.md).                                                                                                                                                                                                                                                                                                                                                                                                            |

## <a id="output-modes" />Output modes by flow type

Pipelines choose the [Structured Streaming output mode](https://docs.databricks.com/aws/en/structured-streaming/output-mode.md) for each flow based on the flow type and its target, so you don't set an output mode in the flow definition. The following table shows the output mode that each flow type uses:

| Flow type                                                    | Output mode                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Append flow, including the default flow of a streaming table | Append mode. If the query can't run in append mode, such as a streaming aggregation without a watermark, and the flow is the only flow that writes to its streaming table, the pipeline runs the flow in complete mode. In complete mode, each micro-batch rewrites the table with the query's full result. When more than one flow writes to the same streaming table, each flow must support append mode, or the update fails.             |
| Append flow that uses `ONCE`                                 | None. The flow runs as a batch query one time, unless the target is fully refreshed.                                                                                                                                                                                                                                                                                                                                                         |
| Auto CDC                                                     | None. The pipeline merges each micro-batch into the target streaming table, inserting and updating rows. When you specify delete handling (`apply_as_deletes` in Python or `APPLY AS DELETE WHEN` in SQL), slowly changing dimension (SCD) Type 1 targets delete the row and SCD Type 2 targets end the current record. See [The AUTO CDC APIs: Simplify change data capture with pipelines](https://docs.databricks.com/aws/en/ldp/cdc.md). |
| Auto CDC from snapshot                                       | None. The flow runs as a batch query. See [How AUTO CDC FROM SNAPSHOT works](https://docs.databricks.com/aws/en/ldp/cdc.md#cdc-from-snapshot).                                                                                                                                                                                                                                                                                               |
| Append flow to a sink                                        | Append mode. See [Sinks in Lakeflow pipelines](https://docs.databricks.com/aws/en/ldp/concepts/sinks.md).                                                                                                                                                                                                                                                                                                                                    |
| Update flow to a sink                                        | Update mode. Update flows don't support Delta Lake table sinks. See [update\_flow](https://docs.databricks.com/aws/en/ldp/developer/ldp-python-ref-update-flow.md).                                                                                                                                                                                                                                                                          |
| Default flow of a materialized view                          | None. Materialized views are processed in batch, so output modes don't apply. See [Materialized views](https://docs.databricks.com/aws/en/ldp/concepts/materialized-views.md).                                                                                                                                                                                                                                                               |

## Additional resources

For more information on flows and their use, see the following topics:

* [Use flows in Lakeflow pipelines](https://docs.databricks.com/aws/en/ldp/flow-examples.md)
* [The AUTO CDC APIs: Simplify change data capture with pipelines](https://docs.databricks.com/aws/en/ldp/cdc.md)
* [Backfilling historical data with pipelines](https://docs.databricks.com/aws/en/ldp/flows-backfill.md)
* [Writing pipelines in Python or SQL](https://docs.databricks.com/aws/en/ldp/developer/index.md)
* [Streaming tables](https://docs.databricks.com/aws/en/ldp/concepts/streaming-tables.md)
* [Materialized views](https://docs.databricks.com/aws/en/ldp/concepts/materialized-views.md)
* [Sinks in Lakeflow pipelines](https://docs.databricks.com/aws/en/ldp/concepts/sinks.md)
* [Flows in Unity Catalog](https://docs.databricks.com/aws/en/data-governance/unity-catalog/flows.md)
