Can I break in a workflow? Or rather if a task / w...
# ask-the-community
e
Can I break in a workflow? Or rather if a task / workflow at a certain point doesn't match n criteria i'd like to stop execution in a parent workflow
h
hmmm you can add validation tasks if that's what you mean, things like:
Copy code
@task
def check_output(i: int):
  if i < 0:
    raise Error("...

@workflow
def my_wf() -> int:
  a = t1()
  check1 = check_output(o=a)
  b = t2()
  check2 = check_output(o=b)

  # Ensure that check1 runs before b is produced even when t2() 
  # doesn't depend on the output of check_output
  check1 >> b

  # return the final output
  return b
e
Oh yeah