question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Imported tasks from different flows are executed under a False-case condition

See original GitHub issue

Description

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:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
AdeSantosSierracommented, Oct 21, 2020

Appreciate really your help. The more I use Prefect, the more I love it!

0reactions
cicdwcommented, Oct 21, 2020

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-in StartFlowRun task: https://docs.prefect.io/api/latest/tasks/prefect.html#startflowrun

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found