Through the following code, I am trying to run a flow on prefect cloud. But it was getting in scheduled and pending state then I added .start() line of code with agent, the flow was no more scheduled but when I am trying to do the same with a new flow it is just running an agent. Is this a right way bcz its just running agent but not registering the new version until I stop the agent*?*
Copy code
@task(log_stdout=True, result=LocalResult())
def hello_world():
text = f"hello to {FLOW_NAME}"
print(text)
return text
from prefect.agent.local import LocalAgent
from prefect.run_configs import LocalRun
with Flow(
FLOW_NAME, storage=STORAGE, run_config=LocalRun(labels=["xyz"])
) as flow:
data = hello_world()
LocalAgent(labels=["xyz"]).start()
Hafsa Junaid
07/31/2022, 4:03 PM
@Anna Geller@Nate
a
Anna Geller
07/31/2022, 6:00 PM
please don't tag anyone
upvote 1
Anna Geller
07/31/2022, 6:01 PM
are you new to Prefect? if so, try Prefect 2.0 docs.prefect.io which is LTS version
Prefect 1.0 is in a maintenance mode, 2.0 is LTS so better to get started with that one
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.