Prediction

Prediction API is the primary endpoint for interacting with your Flowise flows and assistants. It allows you to send messages to your selected flow and receive responses back. This API handles the core chat functionality, including:

  • Chat Interactions: Send questions or messages to your flow and receive AI-generated responses

  • Streaming Responses: Get real-time streaming responses for better user experience

  • Conversation Memory: Maintain context across multiple messages within a session

  • File Processing: Upload and process images, audio, and other files as part of your queries

  • Dynamic Configuration: Override chatflow settings and pass variables at runtime

For details, see the Prediction Endpoint API Reference.

Base URL and Authentication

Base URL: http://localhost:3000 (or your Flowise instance URL)

Endpoint: POST /api/v1/prediction/:id

Authentication: Refer Authentication for Flows

Request Format

Basic Request Structure

{
    "question": "Your message here",
    "streaming": false,
    "overrideConfig": {},
    "history": [],
    "uploads": [],
    "form": {}
}

Parameters

Parameter
Type
Required
Description

question

string

Yes

The message/question to send to the flow

form

object

Either question or form

The form object to send to the flow

streaming

boolean

No

Enable streaming responses (default: false)

overrideConfig

object

No

Override flow configuration

history

array

No

Previous conversation messages

uploads

array

No

Files to upload (images, audio, etc.)

humanInput

object

No

Return human feedback and resume execution

SDK Libraries

Flowise provides official SDKs for Python and TypeScript/JavaScript:

Installation

Python: pip install flowise

TypeScript/JavaScript: npm install flowise-sdk

Python SDK Usage

TypeScript/JavaScript SDK Usage

Direct HTTP API Usage

If you prefer to use the REST API directly without SDKs:

Basic Request

Advanced Features

Form Input

In Agentflow V2, you can select form as input type.

You can override the value by Variable Name of the Form Input

Configuration Override

Override chatflow settings dynamically.

Override config is disabled by default for security reasons. Enable it from the top right: Settings → Configuration → Security tab:

For array type, hovering over the info icon will shows the schema that can be overriden.

Array value from overrideConfig will concatenate with existing array values. For example, if existing startState has:

And if we enable override:

The final startState will be:

Overriding Specific Node

By default, if multiple nodes share the same type and no node ID is specified, overriding a property will update that property across all matching nodes.

For example, there are 2 LLM nodes where I want to override the system message:

After enabling the ability to override:

I can override the system message for both LLMs like so:

From the Execution, you can see the overriden system message:

In some cases, you might want to just override config for specific node. You can do so by specifying the node id inside the property you want to override.

For example:

If you head back to Execution, you can see each LLM has the correct overriden value:

Conversation History

Provide conversation context by including previous messages in the history array.

History Message Format

Session Management

Use sessionId to maintain conversation state across multiple API calls. Each session maintains its own conversation context and memory.

Variables

Pass dynamic variables to your flow using the vars property in overrideConfig. Variables can be used in your flow to inject dynamic content.

Image Uploads

Upload images for visual analysis when your flow supports image processing. Refer to Image for more reference.

Upload Structure:

Data: Base64 or URL of an image

Type: url or file

Name: name of the image

Mime: image/png, image/jpeg, image/jpg

Audio Uploads (Speech to Text)

Upload audio files for speech-to-text processing. Refer to Audio for more reference.

Upload Structure:

Data: Base64 or URL of an audio

Type: url or file

Name: name of the audio

Mime: audio/mp4, audio/webm, audio/wav, audio/mpeg

File Uploads

Upload files to have LLM process the files and answer query related to the files. Refer to Files for more reference.

Human Input

To resume the execution from a previously stopped checkpoint, humanInput needs to be provided. Refer Human In The Loop for details.

Human Input Structure

  • type: Either proceed or reject

  • feedback: Feedback to the last output

Troubleshooting

  1. 404 Not Found: Verify the flow ID is correct and the flow exists

  2. 401 Unauthorized Access: Verify if the flow is API key protected

  3. 400 Bad Request: Check request format and required fields

  4. 413 Payload Too Large: Reduce file sizes or split large requests

  5. 500 Internal Server Error: Check if there is any misconfiguration from the nodes in the flow

Last updated