Currently, the native Pipeline task in Databricks Jobs doesn't support dynamically mapping a job parameter directly to the execution's Full Refresh flag (it operates as a static option in the UI).
However, you can easily achieve this behavior by using a lightweight Python Notebook task as an orchestrator. By leveraging the Databricks SDK, you can read the job parameter at runtime and conditionally trigger the correct update mode via the API.
Here is how you can set it up:
Step 1: Create an Orchestrator Notebook
Create a simple notebook that will act as the trigger for your LakeFlow Connect pipeline. Use the following Python code:
from databricks.sdk import WorkspaceClient
import time
w = WorkspaceClient()
# 1. Define the widget to catch the job parameter (defaulting to "false")
dbutils.widgets.text("is_full_refresh", "false")
# 2. Retrieve and evaluate the parameter
is_full_refresh_param = dbutils.widgets.get("is_full_refresh").strip().lower()
run_full_refresh = is_full_refresh_param == "true"
# Replace with your actual pipeline ID
pipeline_id = "<your-lakeflow-pipeline-id>"
# 3. Start the pipeline update
print(f"Triggering pipeline {pipeline_id}. Full refresh: {run_full_refresh}")
update = w.pipelines.start_update(
pipeline_id=pipeline_id,
full_refresh=run_full_refresh
)
print(f"Update started successfully. Update ID: {update.update_id}")
# Optional: Add a polling loop if you want the Job task to wait for the pipeline to finish
# before moving to the next task.
# ...
Step 2: Configure Your Job
Go to your Databricks Workflow and replace your native Pipeline task with a Notebook task pointing to the notebook you just created.
In the Parameters section of your Job or Task, add a key named is_full_refresh.
When you run the job with parameters, you can now pass the value "true" to force a full refresh, or "false" (or leave it as default) to perform your standard incremental ingestion.
Why this works: LakeFlow Connect pipelines are built on Delta Live Tables (DLT) architecture under the hood. The start_update method in the Databricks SDK natively interacts with the same API that the UI uses, giving you full programmatic control over the full_refresh boolean flag.