Documentation Index
Fetch the complete documentation index at: https://docs.moodmnky.com/llms.txt
Use this file to discover all available pages before exploring further.
Chatflows
This guide covers the management and usage of chatflows in the Flowise service.
Chatflows Overview
Chatflows are the core building blocks in Flowise that allow you to create conversational AI workflows using a visual builder. Each chatflow represents a complete conversation flow that can be embedded in your applications or accessed via API.
Chatflow Endpoints
List Chatflows
Retrieve a list of all available chatflows.
GET /api/v1/chatflows
curl "https://flowise.moodmnky.com/api/v1/chatflows" \
-H "x-api-key: your_api_key"
Response:
{
"chatflows": [
{
"id": "chatflow-1234",
"name": "Customer Support Bot",
"category": "Support",
"deployed": true,
"isPublic": true,
"updatedAt": "2024-03-15T12:30:45Z"
},
{
"id": "chatflow-5678",
"name": "Product Recommender",
"category": "Sales",
"deployed": true,
"isPublic": false,
"updatedAt": "2024-03-20T09:15:22Z"
}
]
}
Get Chatflow
Retrieve a specific chatflow by ID.
GET /api/v1/chatflows/{chatflowId}
curl "https://flowise.moodmnky.com/api/v1/chatflows/chatflow-1234" \
-H "x-api-key: your_api_key"
Response:
{
"id": "chatflow-1234",
"name": "Customer Support Bot",
"deployed": true,
"isPublic": true,
"category": "Support",
"updatedAt": "2024-03-15T12:30:45Z",
"nodes": [...],
"edges": [...],
"variables": [...]
}
Create Chatflow
Create a new chatflow.
POST /api/v1/chatflows
curl -X POST "https://flowise.moodmnky.com/api/v1/chatflows" \
-H "x-api-key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "New Support Bot",
"category": "Support",
"isPublic": true,
"nodes": [...],
"edges": [...]
}'
Response:
{
"id": "chatflow-9876",
"name": "New Support Bot",
"category": "Support",
"deployed": false,
"isPublic": true,
"createdAt": "2024-04-01T10:25:12Z",
"updatedAt": "2024-04-01T10:25:12Z"
}
Update Chatflow
Update an existing chatflow.
PUT /api/v1/chatflows/{chatflowId}
curl -X PUT "https://flowise.moodmnky.com/api/v1/chatflows/chatflow-9876" \
-H "x-api-key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Support Bot",
"category": "Support",
"nodes": [...],
"edges": [...]
}'
Delete Chatflow
Delete a chatflow.
DELETE /api/v1/chatflows/{chatflowId}
curl -X DELETE "https://flowise.moodmnky.com/api/v1/chatflows/chatflow-9876" \
-H "x-api-key: your_api_key"
Duplicate Chatflow
Duplicate an existing chatflow.
POST /api/v1/chatflows/{chatflowId}/duplicate
curl -X POST "https://flowise.moodmnky.com/api/v1/chatflows/chatflow-1234/duplicate" \
-H "x-api-key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Customer Support Bot (Copy)"
}'
Response:
{
"id": "chatflow-9999",
"name": "Customer Support Bot (Copy)",
"category": "Support",
"deployed": false,
"isPublic": true,
"createdAt": "2024-04-01T10:25:12Z",
"updatedAt": "2024-04-01T10:25:12Z"
}
Chat Prediction
Execute a chatflow prediction (non-streaming).
POST /api/v1/prediction/{chatflowId}
curl -X POST "https://flowise.moodmnky.com/api/v1/prediction/chatflow-1234" \
-H "x-api-key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"question": "Hello, how can you help me?",
"overrideConfig": {},
"sessionId": "session-123"
}'
Stream Chat
Execute a chatflow prediction with streaming response.
POST /api/v1/prediction/{chatflowId}/stream
curl -X POST "https://flowise.moodmnky.com/api/v1/prediction/chatflow-1234/stream" \
-H "x-api-key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"question": "Tell me about your products",
"overrideConfig": {},
"sessionId": "session-123"
}'
Stop Chat
Stop an active streaming chatflow execution.
POST /api/v1/prediction/{chatflowId}/stop
curl -X POST "https://flowise.moodmnky.com/api/v1/prediction/chatflow-1234/stop" \
-H "x-api-key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "session-123"
}'
Deploy Chatflow
Deploy a chatflow to make it available for use.
POST /api/v1/chatflows/{chatflowId}/deploy
curl -X POST "https://flowise.moodmnky.com/api/v1/chatflows/chatflow-9876/deploy" \
-H "x-api-key: your_api_key"
Response:
{
"id": "chatflow-9876",
"deployed": true,
"updatedAt": "2024-04-01T10:30:45Z"
}
Undeploy Chatflow
Undeploy a chatflow to make it unavailable for use.
POST /api/v1/chatflows/{chatflowId}/undeploy
curl -X POST "https://flowise.moodmnky.com/api/v1/chatflows/chatflow-9876/undeploy" \
-H "x-api-key: your_api_key"
Response:
{
"id": "chatflow-9876",
"deployed": false,
"updatedAt": "2024-04-01T10:35:12Z"
}
Chatflow Parameters
Chatflow Object
| Field | Type | Description |
|---|
| id | string | Unique identifier for the chatflow |
| name | string | Name of the chatflow |
| category | string | Category for organization purposes |
| deployed | boolean | Whether the chatflow is deployed and available for use |
| isPublic | boolean | Whether the chatflow is accessible without authentication |
| nodes | array | Array of node objects that make up the chatflow |
| edges | array | Array of edge objects connecting the nodes |
| variables | array | Array of variable objects for the chatflow |
| createdAt | string | Creation timestamp |
| updatedAt | string | Last update timestamp |
Node Object
| Field | Type | Description |
|---|
| id | string | Unique identifier for the node |
| type | string | Type of the node (e.g., “textInput”, “llmChain”) |
| position | object | X and Y coordinates of the node in the builder |
| data | object | Configuration data for the node |
Edge Object
| Field | Type | Description |
|---|
| id | string | Unique identifier for the edge |
| source | string | ID of the source node |
| target | string | ID of the target node |
| sourceHandle | string | Output handle of the source node |
| targetHandle | string | Input handle of the target node |
Usage Examples
List and Filter Chatflows
// List all chatflows
const response = await client.flowise.listChatflows();
console.log(`Found ${response.chatflows.length} chatflows`);
// Filter by category
const supportChatflows = response.chatflows.filter(
flow => flow.category === "Support"
);
console.log(`Found ${supportChatflows.length} support chatflows`);
// Get only deployed chatflows
const deployedChatflows = response.chatflows.filter(
flow => flow.deployed === true
);
console.log(`Found ${deployedChatflows.length} deployed chatflows`);
Manage Chatflow Deployment Status
// Deploy a chatflow
async function deployChatflow(chatflowId) {
try {
const result = await client.flowise.deployChatflow(chatflowId);
console.log(`Chatflow ${chatflowId} deployed successfully`);
return result;
} catch (error) {
console.error(`Failed to deploy chatflow: ${error.message}`);
throw error;
}
}
// Undeploy a chatflow
async function undeployChatflow(chatflowId) {
try {
const result = await client.flowise.undeployChatflow(chatflowId);
console.log(`Chatflow ${chatflowId} undeployed successfully`);
return result;
} catch (error) {
console.error(`Failed to undeploy chatflow: ${error.message}`);
throw error;
}
}
// Toggle deployment status
async function toggleChatflowDeployment(chatflowId) {
const chatflow = await client.flowise.getChatflow(chatflowId);
if (chatflow.deployed) {
return await undeployChatflow(chatflowId);
} else {
return await deployChatflow(chatflowId);
}
}
Create and Update Chatflows
// Create a simple chatflow with text input and LLM response
async function createSimpleChatbot(name, category, apiKey) {
const chatflowData = {
name,
category,
isPublic: true,
nodes: [
{
id: "textInput",
type: "textInput",
position: { x: 100, y: 200 },
data: { text: "Hello! How can I help you today?" }
},
{
id: "llmChain",
type: "llmChain",
position: { x: 400, y: 200 },
data: {
model: "gpt-3.5-turbo",
apiKey: apiKey,
temperature: 0.7
}
}
],
edges: [
{
id: "edge-1",
source: "textInput",
target: "llmChain",
sourceHandle: "output",
targetHandle: "input"
}
]
};
return await client.flowise.createChatflow(chatflowData);
}
// Update chatflow with a new node
async function addMemoryToExistingChatflow(chatflowId) {
// Get existing chatflow
const chatflow = await client.flowise.getChatflow(chatflowId);
// Add memory node
const memoryNode = {
id: "memoryNode",
type: "bufferMemory",
position: { x: 250, y: 300 },
data: { memoryKey: "chat_history" }
};
// Add new edges
const newEdges = [
{
id: "edge-to-memory",
source: "textInput",
target: "memoryNode",
sourceHandle: "output",
targetHandle: "input"
},
{
id: "edge-from-memory",
source: "memoryNode",
target: "llmChain",
sourceHandle: "output",
targetHandle: "memory"
}
];
// Update chatflow
chatflow.nodes.push(memoryNode);
chatflow.edges = [...chatflow.edges, ...newEdges];
return await client.flowise.updateChatflow(chatflowId, chatflow);
}
Best Practices
-
Chatflow Design
- Keep chatflows focused on specific use cases
- Use clear naming conventions
- Organize with meaningful categories
- Document the purpose of each chatflow
-
Deployment Management
- Test thoroughly before deploying
- Use deployment toggles for maintenance
- Monitor usage after deployment
- Implement versioning for important changes
-
Security Considerations
- Use isPublic flag judiciously
- Implement proper authentication
- Validate and sanitize user inputs
- Review node configurations for sensitive data
-
Performance Optimization
- Minimize complex node arrangements
- Use caching where appropriate
- Monitor response times
- Implement rate limiting for public chatflows
Advanced Features
Chatflow Variables
You can define variables in your chatflows that can be accessed and modified across nodes.
// Update chatflow to include variables
const chatflowWithVariables = {
// ... existing chatflow data
variables: [
{
name: "userName",
type: "string",
defaultValue: "Guest"
},
{
name: "userPreferences",
type: "json",
defaultValue: { language: "en", theme: "light" }
}
]
};
await client.flowise.updateChatflow(chatflowId, chatflowWithVariables);
Chatflow Export and Import
// Export a chatflow
async function exportChatflow(chatflowId) {
const response = await client.flowise.exportChatflow(chatflowId);
const json = JSON.stringify(response);
// Save to file or database
return json;
}
// Import a chatflow
async function importChatflow(chatflowJson) {
const chatflowData = JSON.parse(chatflowJson);
// Modify as needed
chatflowData.name = `${chatflowData.name} (Imported)`;
return await client.flowise.createChatflow(chatflowData);
}
Support & Resources