Thread
#prefect-community
    Raimundo Pereira De Souza Neto

    Raimundo Pereira De Souza Neto

    6 months ago
    Hello Prefecters! What's up? I tried to create a schedule flow using:
    from prefect import flow
    from prefect.deployments import DeploymentSpec
    from prefect.orion.schemas.schedules import IntervalSchedule
    from datetime import timedelta
    
    
    @flow(name="TestingFlow")
    async def testing_flow(name="raimundo"):
        try:
            print(f"Hello {name}!")
        except Exception as e:
            print(e)
    
    
    DeploymentSpec(
        flow=testing_flow,
        name="hw-30s",
        schedule=IntervalSchedule(interval=timedelta(seconds=20)),
        tags=["rai", "20s"],
    )
    when I run
    prefect deployment create my_file.py
    , that creates it correctly, but the tasks don't run. Anyone help me please 💙
    There are no or tasks runs in
    orion dashboard
    nicholas

    nicholas

    6 months ago
    Hi @Raimundo Pereira De Souza Neto - from your code, it doesn’t look like you have any tasks in your flow, so this would only show up as a flow run without any associated task runs
    Raimundo Pereira De Souza Neto

    Raimundo Pereira De Souza Neto

    6 months ago
    @task
    async def print_hello(name):
        print(f"Hello {name}!")
    
    
    @flow(name="TestingFlow")
    async def testing_flow(name="raimundo"):
        print_hello(name)
    
    
    DeploymentSpec(
        flow=testing_flow,
        name="hw-30s",
        schedule=IntervalSchedule(interval=timedelta(seconds=20)),
        tags=["rai", "20s"],
    )
    Hi @nicholas, with this code, I had the same result 😞 .
    There are 16 late runs 👀
    nicholas

    nicholas

    6 months ago
    Ah that would be why you’re not seeing much then - your runs aren’t being picked up. For deployments you’ll want to create a work queue for your run and start an agent; you can read more about that here
    Anna Geller

    Anna Geller

    6 months ago
    you could do:
    prefect work-queue create SOME_NAME -t rai
    this will output UUID and you can use that to start an agent that will pick up those late runs:
    prefect agent start UUID
    Raimundo Pereira De Souza Neto

    Raimundo Pereira De Souza Neto

    6 months ago
    thanks @nicholas and @Anna Geller