Skip to main content

Integration

API Integration

REST API Configuration:

bash

# Create API key management script
cat > ~/manage-api-keys.js << 'EOF'
const axios = require('axios');
const FLOWISE_URL = 'http://localhost:3000';
const ADMIN_USERNAME = 'admin';
const ADMIN_PASSWORD = 'your_password';
async function createAPIKey(keyName) {
try {
const response = await axios.post(`${FLOWISE_URL}/api/v1/apikey`, {
keyName: keyName,
keyDescription: `API key for ${keyName}`
}, {
auth: {
username: ADMIN_USERNAME,
password: ADMIN_PASSWORD
}
});
console.log('API Key created:', response.data);
return response.data;
} catch (error) {
console.error('Error creating API key:', error.response?.data || error.message);
}
}
// Usage
createAPIKey('production-api');
EOF
# Run the script
node ~/manage-api-keys.js

Webhook Integration:

bash

# Create webhook handler script
cat > ~/webhook-handler.js << 'EOF'
const express = require('express');
const app = express();
app.use(express.json());
// Webhook endpoint for flow completions
app.post('/webhook/flow-complete', (req, res) => {
const { flowId, result, timestamp } = req.body;
console.log('Flow completed:', {
flowId,
result,
timestamp: new Date(timestamp)
});
// Process the webhook data
// Add your custom logic here
res.status(200).json({ status: 'received' });
});
app.listen(3001, () => {
console.log('Webhook handler listening on port 3001');
});
EOF
# Install dependencies and run
npm init -y
npm install express
node ~/webhook-handler.js &

External Service Integration

OpenAI Integration:

bash


# Configure OpenAI API key through Flowise UI or environment
export OPENAI_API_KEY="your-openai-api-key"
# Add to environment file
echo "OPENAI_API_KEY=your-openai-api-key" | sudo tee -a /etc/flowise/flowise.env
Pinecone Vector Database Integration:
bash



# Configure Pinecone credentials
export PINECONE_API_KEY="your-pinecone-api-key"
export PINECONE_ENVIRONMENT="your-pinecone-environment"
# Add to environment file
cat << 'EOF' | sudo tee -a /etc/flowise/flowise.env
PINECONE_API_KEY=your-pinecone-api-key
PINECONE_ENVIRONMENT=your-pinecone-environment
EOF

Authentication Integration

LDAP Integration (Ubuntu):

bash



# Install LDAP dependencies
npm install --save ldapauth-fork passport-ldapauth
# Create LDAP configuration
sudo cat > /etc/flowise/ldap-config.json << 'EOF'
{
"ldap": {
"url": "ldap://your-ldap-server:389",
"bindDN": "cn=admin,dc=example,dc=com",
"bindCredentials": "admin-password",
"searchBase": "ou=users,dc=example,dc=com",
"searchFilter": "(uid={{username}})",
"searchAttributes": ["uid", "cn", "mail"]
}
}
EOF
# Update environment
echo "FLOWISE_AUTH_TYPE=ldap" | sudo tee -a /etc/flowise/flowise.env
echo "LDAP_CONFIG_PATH=/etc/flowise/ldap-config.json" | sudo tee -a /etc/flowise/flowise.env

LDAP Integration (RHEL8):

bash


# Install LDAP dependencies
npm install --save ldapauth-fork passport-ldapauth
# Create LDAP configuration with SELinux considerations
sudo cat > /etc/flowise/ldap-config.json << 'EOF'
{
"ldap": {
"url": "ldap://your-ldap-server:389",
"bindDN": "cn=admin,dc=example,dc=com",
"bindCredentials": "admin-password",
"searchBase": "ou=users,dc=example,dc=com",
"searchFilter": "(uid={{username}})",
"searchAttributes": ["uid", "cn", "mail"]
}
}
EOF
# Set SELinux context
sudo setsebool -P authlogin_nsswitch_use_ldap 1
sudo setsebool -P httpd_can_connect_ldap 1
# Update environment
echo "FLOWISE_AUTH_TYPE=ldap" | sudo tee -a /etc/flowise/flowise.env
echo "LDAP_CONFIG_PATH=/etc/flowise/ldap-config.json" | sudo tee -a /etc/flowise/flow