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 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group