Hi everyone, please how can I run prefect 2.0 Agen...
# best-practices
o
Hi everyone, please how can I run prefect 2.0 Agent within python code that contain the flow?
k
Hi @Oluremi Akinwale, If you just want to run a flow with the python code, you can just trigger the code directly without the prefect Agent. Could you describe more what you are trying to accomplish with the agent within the python code that contains the flow?
o
Thanks Kalise for your reply
I deployed the flow on prefect cloud and also scheduled it but this doesn’t run except I run the agent first
k
Ah ok so the Agent is intended to be long running so it can poll cloud for scheduled work. when it finds the scheduled deployment, it gets the metadata such as the deployment infrastructure (where it should/how it should run) and the storage block (where the code is stored). It sounds like you need to specify a storage block for where you are storing the flow code. If you're looking for more serverless, here's an example Anna wrote: https://towardsdatascience.com/prefect-aws-ecs-fargate-github-actions-make-serverless-dataflows-as-easy-as-py-f6025335effc
o
Ok, I will check it out.Thanks