Executes an agentflow with the provided input and returns the agent’s response. This endpoint processes the user’s message through the configured agent workflow.
Path Parameters
The unique identifier of the agentflow to execute
Request Body
The user’s input message or query to send to the agent
Optional chat session identifier to maintain conversation context
Enable streaming responses. Defaults to false
Array of previous messages for conversation context
Override specific node configurations for this execution
Response
The agent’s response text
The chat session identifier
Unique identifier for this message in the conversation
Array of source documents used by the agent (if applicable)
Array of tools used by the agent during execution
Step-by-step reasoning process of the agent
Any artifacts generated during execution
Example Request
curl -X POST \
'https://your-flowise-instance.com/api/v1/prediction/abc123-def456-ghi789' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"question": "Help me troubleshoot my login issue",
"chatId": "session-xyz",
"streaming": false
}'
Example Response
{
"text": "I can help you troubleshoot your login issue. Let me gather some information first...",
"chatId": "session-xyz",
"chatMessageId": "msg-789",
"usedTools": [
{
"tool": "knowledge_base",
"query": "login troubleshooting steps"
}
],
"agentReasoning": [
{
"action": "search",
"thought": "I need to find relevant troubleshooting steps"
}
]
}
Streaming Response
When streaming is set to true, the response is sent as Server-Sent Events (SSE):
curl -X POST \
'https://your-flowise-instance.com/api/v1/prediction/abc123-def456-ghi789' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"question": "Help me troubleshoot my login issue",
"streaming": true
}'
Error Responses
Bad Request - Missing required question field or invalid input format
Unauthorized - Invalid or missing API key
Not Found - Agentflow with the specified ID does not exist
Internal Server Error - Error during agentflow execution