---
title: Pipeline task for jobs
description: Configure a pipeline task in a Lakeflow Job to run a pipeline as part of a workflow, on a schedule, or continuously with a job.
canonical_url: https://docs.databricks.com/aws/en/jobs/tasks/pipeline
---

# Pipeline task for jobs

Lakeflow Jobs provides a procedural approach to defining relationships between *tasks*. Lakeflow pipelines provide a declarative approach to defining relationships between *datasets* and *transformations*. Schedule a pipeline to run as a task in a job, using the Jobs UI, the Lakeflow pipelines UI, or SQL.

A pipeline task runs its pipeline in one of two ways, depending on the job's schedule:

* In a triggered or scheduled job, the pipeline task starts a single update and stops when the update completes.
* In a continuous job, the pipeline task runs the pipeline continuously. The job's schedule determines the execution mode, so the pipeline runs continuously even if its own **Pipeline mode** setting is triggered. See [Run a pipeline continuously with a continuous job](https://docs.databricks.com/aws/en/jobs/tasks/pipeline.md#continuous-pipeline).

To learn more about triggered and continuous pipelines, see [Triggered vs. continuous pipeline mode](https://docs.databricks.com/aws/en/ldp/concepts/pipeline-mode.md).

## <a id="pipeline-task" />Configure a pipeline task with the Jobs UI

Lakeflow pipelines manage all configurations for source code and compute in the pipeline definition.

To add a pipeline to a job, complete the following steps:

1. Create and name a new task and select **pipeline** for the **Type**.
2. In the **Pipeline** drop-down menu, select an existing pipeline.
3. You can optionally trigger a full refresh on the pipeline.
4. You can optionally set parameter overrides in the **Parameters** field. See [Parameters](https://docs.databricks.com/aws/en/jobs/tasks/pipeline.md#parameters).
5. (Optional) To configure retries or run-duration thresholds, see [ Advanced task settings](https://docs.databricks.com/aws/en/jobs/configure-task.md#advanced).

> [!NOTE]
>
> You can also create a new ingestion pipeline when creating a task by choosing ![Plus icon.](https://docs.databricks.com/aws/en/images/product-icons/PlusIcon.svg) **New ingestion pipeline** from the **Add task** pane or the tasks **Type** drop-down.

To edit, clone, disable, or delete this task, see [Configure and edit tasks in Lakeflow Jobs](https://docs.databricks.com/aws/en/jobs/configure-task.md).

### <a id="backlog-alerts-unsupported" />Streaming backlog alerts and pipeline tasks

Streaming backlog metric thresholds and notifications aren't supported for pipeline tasks. To monitor a pipeline's streaming backlog, use one of the following instead:

* A Databricks SQL alert that queries the pipeline event log. See [Databricks SQL alerts](https://docs.databricks.com/aws/en/sql/user/alerts/index.md) and [Pipeline event log](https://docs.databricks.com/aws/en/ldp/monitor-event-logs.md).
* A pipeline event hook. See [Define custom monitoring of pipelines with event hooks](https://docs.databricks.com/aws/en/ldp/event-hooks.md).

## <a id="continuous-pipeline" />Run a pipeline continuously with a continuous job

When a [continuous job](https://docs.databricks.com/aws/en/jobs/continuous.md) contains a pipeline task, the job runs the pipeline continuously. You don't need to set the pipeline's built-in **Pipeline mode** to continuous: the job's schedule determines the execution mode and takes precedence over the **Pipeline mode** setting.

This applies only to Lakeflow pipelines. Standalone materialized views and streaming tables always run in triggered mode.

A continuous pipeline wrapped in a continuous job can use serverless [performance modes](https://docs.databricks.com/aws/en/ldp/serverless.md#performance), such as Standard mode, which the pipeline's built-in continuous mode doesn't support.

Databricks recommends running continuous pipelines with a continuous job rather than the pipeline's built-in continuous setting. To avoid unexpected behavior, set the pipeline's **Pipeline mode** to triggered (the default) when you wrap it in a continuous job. For more information, see [Run a continuous pipeline with a continuous job](https://docs.databricks.com/aws/en/ldp/concepts/pipeline-mode.md#continuous-with-jobs).

You can create the continuous job in the Jobs UI, directly from the pipeline page, or with Declarative Automation Bundles. See [Schedule a pipeline with the pipeline UI](https://docs.databricks.com/aws/en/jobs/tasks/pipeline.md#pipeline-schedule) and [Define a continuous pipeline job in Declarative Automation Bundles](https://docs.databricks.com/aws/en/jobs/tasks/pipeline.md#dabs-continuous-pipeline).

### <a id="dabs-continuous-pipeline" />Define a continuous pipeline job in Declarative Automation Bundles

The following Declarative Automation Bundles example defines a continuous job that runs a pipeline as a task. Setting `continuous.pause_status` to `UNPAUSED` runs the pipeline continuously, `continuous.maintenance_window` sets a weekly one-hour window for platform-initiated updates and restarts, and `performance_target: STANDARD` runs the job in Standard performance mode.

```yaml
# resources/continuous_job.yml
resources:
  jobs:
    continuous_pipeline_job:
      name: continuous_pipeline_job
      performance_target: STANDARD
      continuous:
        pause_status: UNPAUSED
        maintenance_window:
          start_hour: 2
          day_of_week: TUESDAY
          timezone_id: America/New_York
      email_notifications:
        on_failure:
          - your_email@example.com
      tasks:
        - task_key: refresh_pipeline
          pipeline_task:
            pipeline_id: ${resources.pipelines.example_pipeline.id}
```

For the minimum Databricks CLI version that supports `maintenance_window`, see [Configure a maintenance window with Declarative Automation Bundles](https://docs.databricks.com/aws/en/ldp/maintenance-windows.md#schedule-dabs).

To migrate an existing continuous pipeline to a continuous job, remove the `continuous` field from the pipeline definition. The job then configures continuous execution.

For the equivalent Jobs API payload, see the [`jobs/create`](https://docs.databricks.com/api/workspace/jobs/create) reference.

## <a id="database-table-sync" />Database Table Sync pipeline

The **Database Table Sync pipeline** task is a pipeline task that runs the pipeline maintaining a [Lakebase synced table](https://docs.databricks.com/aws/en/oltp/projects/sync-tables.md). Use it to refresh a synced table on a schedule, or when the source Unity Catalog table changes, so that operational applications read current data from Lakebase Postgres.

In the task **Type** drop-down, **Database Table Sync pipeline** appears under **Ingestion and Transformation**. Selecting it configures a pipeline task. In the **Pipeline** field, choose the pipeline associated with the synced table you want to refresh.

To configure the task for your synced table, see [Schedule or trigger subsequent syncs](https://docs.databricks.com/aws/en/oltp/projects/sync-tables.md#schedule-trigger).

## <a id="ingestion-pipeline" />Ingestion pipeline

The **Ingestion pipeline** task is a pipeline task that runs an ingestion pipeline. In the task **Type** drop-down, choosing **Ingestion pipeline** starts the **Add data** wizard, which creates a pipeline task for an ingestion pipeline.

The wizard's first page asks for the data source. The following pages depend on the source you select. For example, if you select MySQL, see [Option 1: Databricks UI](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/mysql-pipeline.md#using-databricks-ui) for the steps. For the available sources, see [Lakeflow Connect connector concepts](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/index.md).

## <a id="parameters" />Parameters

You can access [job](https://docs.databricks.com/aws/en/jobs/job-parameters.md) or [task](https://docs.databricks.com/aws/en/jobs/task-parameters.md) parameters in your pipeline task using dynamic value references. You can override parameters by adding **Key**-**Value** pairs in the **Parameters** of your task configuration.

For details on how to access the parameter values from within your pipeline, see [Access parameter values from a task](https://docs.databricks.com/aws/en/jobs/parameter-use.md).

## <a id="concurrency" />Concurrency limits with pipeline tasks

A pipeline can only run one update at a time. Jobs that contain a pipeline task are subject to the following concurrency caps:

* A job with `max_concurrent_runs > 1` that contains a pipeline task is capped to a single concurrent run. The job UI shows a notice when this cap is applied.
* A pipeline task wrapped in a [for-each task](https://docs.databricks.com/aws/en/jobs/tasks/for-each.md) is capped to one concurrent iteration, regardless of the loop's configured concurrency.

Plan around these caps when designing parameterized pipelines that you intend to run with many parameter combinations or in tight schedules.

## <a id="pipeline-schedule" />Schedule a pipeline with the pipeline UI

Adding a schedule to a pipeline creates a job with a single pipeline task. For more advanced triggering options, see [Configure a pipeline task with the Jobs UI](https://docs.databricks.com/aws/en/jobs/tasks/pipeline.md#pipeline-task).

Configure a pipeline task in a scheduled job using the pipeline UI by completing the following steps:

1. In your workspace, click ![Workflows icon.](https://docs.databricks.com/aws/en/images/product-icons/WorkflowsIcon.svg) **Jobs & Pipelines** in the sidebar.
2. Click on the pipeline **Name**. The pipeline UI appears.
3. Click **Schedule**.
   * If no schedule exists for the pipeline, the **New schedule** dialog appears.
   * If one or more schedules already exist, click **Add schedule**.
4. In the **Trigger type** drop-down list, select a trigger type:
   * **Scheduled** creates a time-based schedule. Select **Advanced** for more options, including cron syntax.
   * **Continuous** creates a [continuous job](https://docs.databricks.com/aws/en/jobs/continuous.md) that runs the pipeline continuously. See [Run a pipeline continuously with a continuous job](https://docs.databricks.com/aws/en/jobs/tasks/pipeline.md#continuous-pipeline).
5. Enter a unique name for the job in the **Job name** field.
6. (Optional) To run the pipeline in Standard performance mode, clear the **Performance optimized** checkbox. See [Select a performance mode](https://docs.databricks.com/aws/en/ldp/serverless.md#performance).
7. (Optional) For a **Continuous** schedule, expand **Advanced settings** and set a **Maintenance window** to control when Databricks applies updates that restart the pipeline. See [Manage updates for continuous pipelines](https://docs.databricks.com/aws/en/ldp/maintenance-windows.md).
8. (Optional) Under **More options**, configure one or more email addresses to receive alerts on pipeline start, success, or failure.
9. Click **Create**.

For a continuous schedule, Databricks starts the run automatically. To stop it, click **Stop** on the pipeline page or pause the schedule. Both actions also cancel the active update.

> [!NOTE]
>
> If the pipeline is included in one or more scheduled jobs, the **Schedule** button shows the number of existing schedules, for example, **Schedule (5)**.

## <a id="refresh-schedule" />Add a schedule to a materialized view or streaming table in Databricks SQL

Materialized views and streaming tables defined in Databricks SQL support time-based scheduling specified in `CREATE` or `ALTER` commands.

For details, see the following articles:

* [CREATE MATERIALIZED VIEW](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-create-materialized-view.md)
* [CREATE STREAMING TABLE](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-create-streaming-table.md)
* [ALTER MATERIALIZED VIEW](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-alter-materialized-view.md)
* [ALTER STREAMING TABLE](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-alter-streaming-table.md)

## <a id="additional-resources" />Additional resources

* [Pipeline task](https://docs.databricks.com/aws/en/dev-tools/bundles/job-task-types.md#pipeline-task): Define a pipeline task as code with Declarative Automation Bundles.
* [Triggered vs. continuous pipeline mode](https://docs.databricks.com/aws/en/ldp/concepts/pipeline-mode.md): Learn about pipeline trigger modes.
* [Configure task parameters](https://docs.databricks.com/aws/en/jobs/task-parameters.md): Pass parameters to the task.
