How to set the status "successfully" at the end of the task?

I have a simple ‘Hello world!’ code with schedule. But when I run the code I always get “'late runs” and “yellow graph” as in the screenshot

Question: How to set the status “successfully” at the end of the task and get a green graph?

from prefect import task, Flow
from datetime import timedelta
from prefect.schedules import IntervalSchedule

def say_hello():
    print("Hello, world!")

schedule = IntervalSchedule(interval=timedelta(minutes=1))

with Flow("Hello", schedule=schedule) as flow:

1 Like

Do you have an agent querying for tasks, e.g. prefect agent local start

1 Like

Also, it would be best if you remove both of those lines:

and use Prefect CLI instead:

prefect register --project Lesson -p
prefect run -p

Then, as Andrew mentioned, you would need to actually start an agent, which you can do using:

prefect agent local start

I transferred the project to a vps, and launched both the project and the agent there. It works! But it refuses to work in my local pc and freezes at the moment “Waiting for flow runs…”

In the end, I found what I was looking for. Thanks!

1 Like