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? 
.