https://prefect.io logo
p

Peter

09/04/2023, 10:31 AM
Hi everyone, I'm having a weird issue when I trigger my prefect deployment through the prefect api. I have the flow registered and deployed already, but If I go the "create flow run" or "create flow run from deployment" passed in necessary request body parameters, and I hit execute, the deployment will get triggered but it won't run the tasks in the flow. This is the request body I passed to it under the "create_flow_run" : { "state": { "type": "RUNNING" }, "name": "weather_flow_run", "flow_id": "xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } Then, that's the flow run status below: it doesn't run the tasks in my flow and it keeps running forever @Jeff Hale @Ifeoluwa Daranijo
1
l

Lior Barak

09/04/2023, 2:58 PM
hey Peter, I had the same issue and resolved it with using "SCHEDULED"
Copy code
{
  "state": {
    "type": "SCHEDULED",
    "name": "deployment-name",
    "message": "Run started",
  },
  "parameters": {
    "some_parametaer": "bla_bla" 
  },
  "tags": [
  ],
}
and the flow id is in the url:
Copy code
api/deployments/{FLOW_ID}/create_flow_run
p

Peter

09/04/2023, 3:01 PM
okay, I'd try that now. Thanks
sorry do you mean deployment_id instead of flow_id, the parameter it asks for is the deployment_id
l

Lior Barak

09/04/2023, 3:07 PM
yes yes of course. deployment id
p

Peter

09/04/2023, 3:12 PM
This is what it's resulting in: it's not running the flow immediately
🤔 1
l

Lior Barak

09/04/2023, 3:17 PM
maybe it has something to do with work pool or work queue? because when I run with "scheduled" I immediately see them in the UI
p

Peter

09/04/2023, 3:38 PM
sorry, how did you configure your work pool and work queue to use default?, was it in the deployment script
n

Nate

09/05/2023, 1:55 AM
hi @Peter - are you running a worker? i see that your flow run is scheduled but marked late, it could be that whichever work pool you have deployed your flow to does not have a worker that would pick up and execute your flow run
configure your work pool and work queue
you select a work pool (optionally a work queue as well) at deployment creation time, which is basically selecting the type of infra (Process, Docker, k8s) you want your flow runs to execute on - the default infra is Process, which would be created by a process worker if you ran
prefect worker start -p my_new_process_pool
p

Peter

09/05/2023, 11:27 AM
Alright, Noted. It works fine now, Thanks very much
🦜 1