cold-teacher-46250
10/07/2025, 3:33 PMancient-wolf-19325
10/07/2025, 3:33 PMfrom flytekit import task, workflow, conditional
@task
def check_status() -> bool:
# Your logic here
return True
@task
def success_task() -> str:
return "Success"
@task
def failure_task() -> str:
return "Failure"
@workflow
def my_workflow() -> str:
status = check_status()
return (
conditional("status_check")
.if_(status.is_true())
.then(success_task())
.else_()
.then(failure_task())
)
This pattern is documented in the official Flyte conditionals guide and examples. Would you like more detail or a step-by-step explanation?
Sources:
- Flyte conditionals documentation
- Flytesnacks conditional example 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.cold-teacher-46250
10/07/2025, 3:37 PMancient-wolf-19325
10/07/2025, 3:37 PM