Hello guys, I'm using `prefect=2.0a12`, and I woul...
# prefect-community
r
Hello guys, I'm using
prefect=2.0a12
, and I would like to schedule my flow like a cronJob. It's possible with decorator?
Copy code
from prefect import flow, task

@task()
def s1(message):
    print(message)

@flow() # where I put schedule params?
def update_flow() -> None:
    s1("hello prefect")
a
You set a schedule as part of the `DeploymentSpec`:
Copy code
from prefect.deployments import DeploymentSpec
from prefect.orion.schemas.schedules import IntervalSchedule
from datetime import timedelta

DeploymentSpec(
    flow_location="/Developer/workflows/my_flow.py",
    name="my-first-deployment",
    parameters={"nums": [1, 2, 3, 4]}, 
    schedule=IntervalSchedule(interval=timedelta(minutes=15)),
)