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.
Community Discussion