Through the following code, I am trying to run a f...
# prefect-community
h
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()
@Anna Geller @Nate
a
please don't tag anyone
upvote 1
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
upvote 1