QuestionQ271

VerifiedProductionizing Data Pipelines

A notebook task named check_volume computes a daily data volume and stores the result in a Lakeflow Jobs task value called record_count. If this value exceeds 1 million, the job should trigger high_volume_pipeline; otherwise, it should trigger normal_pipeline.

Which control-flow feature should be used to implement this behavior?

Explanation

Lakeflow Jobs (Databricks Workflows) provides an If/else condition task type that lets you define a boolean expression referencing task values set by upstream tasks (using the {{tasks.<task_name>.values.<key>}} syntax). Based on the evaluation of that expression, the job can branch to different downstream tasks — in this case routing to high_volume_pipeline when record_count exceeds 1,000,000, or to normal_pipeline otherwise. A For each task is designed for looping over a list of inputs rather than conditional branching, retries only govern automatic re-execution after task failure, and Run if conditions only evaluate the completion status (success/failure/skipped) of dependent tasks, not custom numeric task values. Therefore only the If/else condition task can implement value-based conditional routing.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!