Local agent can get flow-run by 'prefect deployment run xxx', but can not by create_flow_run api, what`s wrong?

i start local server and local agent, build .yaml by prefect build;
i test prefect deployment build xxx, the agent work well;
but when i use api, the flow-run is created, but still in pendding status, agent do not get the flow-run
the api:
curl -i -X POST
-H “Content-Type:application/json”
-d
‘{
“parameters”: {
“cfg”: “”
}
}’
http://127.0.0.1:4200/api/deployments/745f3ed9-1b8a-4ae6-ad4e-3947f2c6df54/create_flow_run

I have resolved the issue. I saw in the UI through the server that the state parameter was added when deploying. The issue was resolved by adding the state parameter.
curl -i -X POST
-H “Content-Type:application/json”
-d
‘{
“state”: {
“type”:“SCHEDULED”
},
“parameters”: {
“cfg”: “”
}
}’
http://127.0.0.1:4200/api/deployments/745f3ed9-1b8a-4ae6-ad4e-3947f2c6df54/create_flow_run?id=745f3ed9-1b8a-4ae6-ad4e-3947f2c6df54

1 Like