Skip to content

How to create a conditional flow? #3545

Answered by jcrist
newskooler asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @snenkov

When posting issues, please:

  • Ensure that your example can be run, there's some clear typos in the above (thomasfrederikhoeck isn't a valid decorator :))
  • Describe what the expected behavior is, from the above it's not clear to me what you want this flow to do
  • Describe how it doesn't work. From the above, it's not clear how things fail.

Doing these things makes it much easier for people to help you.


From a quick glance over, it looks like you expect case to match on the type of the value (tuple). case matches on equality - you probably want something like:

import prefect
from perfect import task, case, Flow, Parameter

@task
def check_task(input) -> bool:
    if input == 2:
 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@newskooler
Comment options

Answer selected by newskooler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants