Milly gupta
02/19/2021, 3:06 PMnicholas
flow.register
, Prefect creates a serialized version of the metadata of your flow , for example where the flow lives and what the task dependency graph looks like and sends it to the API. When your agent queries the API for flows that need to be run, the API returns that serialized flow, which tells the agent where to find your flow code and how to run it.
If you haven't specified storage for your flow, it defaults to Local
storage. Local storage stores a reference to your flow in the form of a directory path, which an agent running on that same machine should be able to retrieve and run.
Take a look at our docs on flow storage and the local agent for more information.Milly gupta
02/19/2021, 3:21 PMnicholas
Milly gupta
02/19/2021, 3:32 PMnicholas
Milly gupta
04/15/2021, 8:29 AMnicholas
Milly gupta
04/15/2021, 2:32 PMnicholas
Milly gupta
04/15/2021, 2:34 PMnicholas
Milly gupta
04/15/2021, 2:35 PMnicholas
Milly gupta
04/15/2021, 2:40 PMnicholas
Milly gupta
04/15/2021, 2:44 PMnicholas
Milly gupta
04/15/2021, 2:49 PMnicholas
Milly gupta
04/15/2021, 2:56 PMnicholas
@task
def say_hello():
print("hello")
with Flow("hello-flow") as flow:
say_hello()
and another time here:
flow = Flow("hello-flow", storage=Module("test_module"))
flow.register(project_name="CDP")
Both have the same name but only 1 has tasks attached and it's not the one you're calling flow.register on.Milly gupta
04/15/2021, 3:50 PMnicholas
@task
def say_hello():
print("hello")
storage=Module("test_module")
with Flow("hello-flow", storage=storage) as flow:
say_hello()
flow.register(project_name="CDP")
Milly gupta
04/15/2021, 3:55 PMnicholas
Milly gupta
04/15/2021, 3:55 PMnicholas
Milly gupta
04/15/2021, 4:00 PMnicholas
Milly gupta
04/19/2021, 1:20 PM