Trigger CrewAI Flow Remotely

I am trying to build a CrewAI flow, that needs to be triggered remotely, when a certain event occurs. I have built an FastAPI POST endpoint, that listens for a POST request with a payload, that is then passed to the flow as arguments, but I was wondering if there is a more elegant solution?

I have packaged both the app.py FastAPI & main.py containing the crewAI flow in the same /src/<flowname> directory and import the crewAI Flow class from the main.py in my app.py so that I can kickoff the flow.

I am aware that this function exists in the Enterprise edition, but I’d rather not use it, and use something from the community edition. What are my options here? And in order not to timeout my POST request, I am using FastAPI’s BackgroundTasks.

There’s running and testing the flow and orchestrating the execution of the flow. If you are happy with your flow you could look at Dapr to handle the orchestration of it.