How can i set the workflow status to Skipped?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2025 02:29 PM
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
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?
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2025 06:00 AM
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

