Imported tasks from different flows are executed under a False-case condition
See original GitHub issueDescription
Given the following code: `
with Flow(...) as flow_A:
# do stuff
with case(False, True):
# This is Skipped
run_tasks_from_flow_A()
# This is Scheduled
# This flow_B is imported from a different file
schedule_a_new_task_from_flow_B_different_from_flow_a()
` When the case is False, the run_tasks_from_flow_A() is run and then Skipped. This is great. However, the task schedule_a_new_task_from_flow_B_different_from_flow_a() is Scheduled AT THE SAME TIME the flow_a runs, so it even wait for the condition to be evaluated.
Expected Behavior
I would expect schedule_a_new_task_from_flow_B_different_from_flow_a() to be skipped.
Reproduction
Stated previously.
Environment
{ "config_overrides": { "cloud": { "agent": { "auth_token": true, "labels": true } } }, "env_vars": [], "system_information": { "platform": "Linux-5.4.0-51-generic-x86_64-with-Ubuntu-18.04-bionic", "prefect_backend": "cloud", "prefect_version": "0.13.10", "python_version": "3.6.9" } }
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
How to build a conditional flow-of-flows, i.e. trigger a different ...
Here is an example flow you may try. from prefect import Flow, task from prefect.tasks.prefect import create_flow_run, wait_for_flow_run from ...
Read more >Record-Triggered Flow Considerations - Salesforce Help
A record-triggered autolaunched flow makes additional updates to the triggering record before or after it's saved to the database. Understand the consider.
Read more >Run repetitive tasks with instant flows - Power Automate
- Power Automate. Specify that a cloud flow performs one or more tasks only if a condition is true.
Read more >Running the same subflow concurrently multiple times raises ...
But when I simplify it and modify to run same Flow (not different 4) then I get. RuntimeError("The task runner is already started!")....
Read more >Can podio workflows be triggered by excel import
is there a way for podio workflows to trigger when an item is created via excel import? i set up a flow as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Appreciate really your help. The more I use Prefect, the more I love it!
Hard to say without knowing your use case; if you want to conditionally create a flow run at runtime using this
case
statement, I suggest using the built-inStartFlowRun
task: https://docs.prefect.io/api/latest/tasks/prefect.html#startflowrun