cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

How can i set the workflow status to Skipped?

iscpablogarcia
New Contributor II

I have a Python script workflow with 2 tasks: Task A and Task B.

When task A has data, this is shared to Task B via createOrReplaceGlobalTempView with no issues.

The goal is: When A has no data, skip the Task B and also set the workflow status to "Skipped" like the image below

iscpablogarcia_0-1737152423551.png

I have tried several ways:

  • Tried dbutils.notebook.exit("Skip this workflow, no data found in task A.") but this sets the status as Succeeded.
  • Tried assertions in Python but it's either Succeeded or Failed.
  • Tried if/else but it always throws Succeeded or Failed too.

Is there a way to show in the workflow page the Skipped status with the condition on Task A? 
.

1 REPLY 1

Walter_C
Databricks Employee
Databricks Employee

To achieve the goal of setting the workflow status to "Skipped" when Task A has no data, you can use the "Run if" conditional task type in Databricks Jobs. This allows you to specify conditionals for later tasks based on the outcome of other tasks.

https://docs.databricks.com/en/jobs/index.html#run-if-conditional-tasks 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now