Trigger Flows using Rest API call with inputs

Hello,

I read the documentation about Flows, I have created few Flows. I ran them from my console. All works fine.

I want to kick off my Flow using Rest API call and want to pass inputs. In case of a normal Crew, I can do this by calling the https://mycrewname/kickoff and passing the inputs using the below. How can I do this to kick off my Flow?

{
“inputs”: {
“MyInput”: “123”
},
“taskWebhookUrl”:“”,
“stepWebhookUrl”:“”,
“crewWebhookUrl”:“”,
“trainingFilename”:“”,
“generateArtifact”:false
}

What REST API are you calling? Does CrewAI expose itself as a REST API? For my use of flows I wrapper the CrewAI code with FastAPI and just call the flow’s run method.

Depends where and how you have the rest endpoint. Are you using CrewAI enterprise? If it’s a custom API then you can get the payload from the POST body and do whatever you want eg kickoff the flow with the inputs

Yes, crewAI exposes Crews deployed in their cloud platform as rest api. Thanks for the details about using FastAPI.

Ah, I haven’t used the cloud.

Thanks for your response. Yes, we are using CrewAI enterprise. Found that Flows also can be kicked off using /kickoff and pass inputs too just like how input can be passed to a normal crew.

{
“inputs”: {
“MyInput”: “123”
},
“taskWebhookUrl”:“”,
“stepWebhookUrl”:“”,
“crewWebhookUrl”:“”,
“trainingFilename”:“”,
“generateArtifact”:false
}