Skip to content

iaminawe/flowise-to-langchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

40 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Flowise to LangChain Converter - Production Ready πŸš€

A comprehensive, production-ready TypeScript system that converts Flowise visual workflows and AgentFlow multiagent teams into executable LangChain code with full observability, monitoring, and deployment support.

🎯 Quick Start

# Development installation
git clone https://github.com/yourusername/flowise-to-langchain.git
cd flowise-to-langchain
npm install && npm run build

# Convert Flowise export to LangChain TypeScript
npm run start -- convert my-flow.json output

# Convert to Python with monitoring
npm run start -- convert my-flow.json output --target python --with-monitoring

# Convert with Langfuse observability
npm run start -- convert flow.json output --with-langfuse

# Deploy to production
./scripts/deploy-production.sh production docker

# Use web interface with Flowise integration
cd testing-ui && npm run dev  # Access at http://localhost:3000

# Use standalone converters for quick conversions
node convert-all-chatflows.cjs    # Convert traditional chatflows
node convert-all-agentflows.cjs   # Convert multi-agent workflows

πŸš€ Production Features (v3.0.0 - Phase 3 Complete)

πŸ—οΈ Complete Conversion System - 98.5% Node Coverage

  • 130+ Node Types across all Flowise categories with production patterns
  • 100% Enterprise Coverage: Cache systems, Google Suite, advanced search APIs, business tools
  • AgentFlow v2.0 Support: Full multiagent workflow conversion with 41 new converters
  • Multi-Language: TypeScript and Python LangChain code generation
  • Type Safety: Zero TypeScript compilation errors, fully typed with comprehensive error handling

πŸŽ‰ Phase 3 Achievements - Enterprise Ready

  • βœ… Cache Systems: Redis, InMemory, Momento, Upstash Redis converters
  • βœ… Google Suite Integration: Gmail, Calendar, Drive, Docs, Sheets, Workspace, Meet, Forms
  • βœ… Advanced Search APIs: Tavily, Brave, Google, Exa, Arxiv, WolframAlpha, SerpAPI, SearchAPI, DataForSEO, SearXNG
  • βœ… Business Tools: Jira, Stripe, Airtable, Notion, Slack, HubSpot, Salesforce, Microsoft Teams, Asana
  • βœ… Development Tools: Code Interpreter, OpenAPI, GitHub, Docker, Shell, Database converters
  • βœ… AgentFlow V2: Agent, Tool, CustomFunction, Subflow workflow orchestration

πŸ”§ Build System Excellence

  • Zero TypeScript Errors: Complete type safety with functional build system
  • Production Build: 311 compiled files with .js, .d.ts, and .map files
  • CLI Ready: Fully functional command-line interface
  • Test Framework: Optimized with proper parameter handling and 800+ tests

πŸ” Enterprise Observability

  • Langfuse Integration: Prompt versioning, execution tracing, and evaluation
  • Performance Monitoring: Real-time metrics with bottleneck analysis
  • Error Tracking: Structured error handling with recovery strategies
  • Resource Monitoring: CPU, memory, and network usage tracking

🌐 Production Deployment

  • Docker & Kubernetes: Complete containerization support
  • Cloud Ready: AWS, GCP, Azure deployment scripts
  • Load Balancing: Production-grade scaling and distribution
  • Health Checks: Comprehensive monitoring and alerting

πŸ€– Advanced Multiagent Support

  • 7 Real-world Examples: Complete industry-specific workflows
  • Team Coordination: Hierarchical and mesh coordination patterns
  • Performance Optimization: Optimized multiagent execution
  • Specialized Roles: Customer support, development, finance, healthcare teams

πŸ› οΈ Enhanced Developer Experience

  • Interactive Web Interface: Next.js 14 with real-time monitoring
  • Flowise Integration: Direct API import from Flowise instances
  • Professional CLI: Convert, validate, test, watch, batch, and run commands
  • Package Distribution: Complete release packaging with validation
  • Integration Tests: Comprehensive test suites for all components

πŸ“ Project Structure

flowise-langchain/
β”œβ”€β”€ flowise-to-langchain/     # Main converter package (production ready)
β”‚   β”œβ”€β”€ src/                  # TypeScript source (130+ converters)
β”‚   β”‚   β”œβ”€β”€ converters/       # Node type converters
β”‚   β”‚   β”œβ”€β”€ emitters/         # Code generation (TypeScript/Python)
β”‚   β”‚   β”œβ”€β”€ utils/            # Error handling, logging, monitoring
β”‚   β”‚   └── registry/         # Converter registry with 98.5% coverage
β”‚   β”œβ”€β”€ dist/                 # Compiled JavaScript & types (311 files)
β”‚   β”œβ”€β”€ bin/                  # CLI executables
β”‚   β”œβ”€β”€ examples/             # 7 real-world multiagent examples
β”‚   β”œβ”€β”€ docs/                 # Comprehensive documentation
β”‚   └── tests/                # Integration & unit tests (800+)
β”œβ”€β”€ testing-ui/      # Next.js 14 interface with monitoring
β”‚   β”œβ”€β”€ src/                  # React components & hooks
β”‚   β”‚   β”œβ”€β”€ components/       # UI components with shadcn/ui
β”‚   β”‚   β”‚   └── flowise/      # Flowise API integration
β”‚   β”‚   β”œβ”€β”€ lib/              # Langfuse & Flowise integration
β”‚   β”‚   └── hooks/            # React hooks for tracing
β”‚   └── public/               # Static assets
β”œβ”€β”€ scripts/                  # Production deployment scripts
β”‚   β”œβ”€β”€ deploy-production.sh  # Docker, PM2, cloud deployment
β”‚   └── package-release.js    # Release packaging
β”œβ”€β”€ docs/                     # Repository documentation  
β”œβ”€β”€ coordination/             # Claude Flow coordination patterns
└── memory/                   # Persistent agent memory

πŸ“– Detailed Guide: See ./flowise-to-langchain/README.md for comprehensive documentation.

πŸ”— Flowise Integration (NEW!)

Direct Flow Import

Import flows directly from your Flowise instance without manual export/upload:

# Start the web interface
cd testing-ui && npm run dev

# Configure your Flowise instance
# 1. Navigate to Settings β†’ Flowise Configuration
# 2. Enter your Flowise URL (e.g., http://localhost:3000)
# 3. Add your API key for authentication
# 4. Test connection and save

# Browse and import flows
# 1. Go to Workspace β†’ Flowise Integration
# 2. Browse available flows with search and filtering
# 3. Preview flow details and compatibility
# 4. Import single flows or bulk import multiple flows

Features

  • Secure API Integration: Encrypted API key storage
  • Flow Browser: Search, filter, and preview flows
  • Bulk Import: Import multiple flows simultaneously
  • Real-time Status: Connection monitoring and health checks
  • Error Recovery: Robust error handling with retry mechanisms

πŸ” Observability & Monitoring

Langfuse Integration

# Environment setup
export LANGFUSE_PUBLIC_KEY=your_public_key
export LANGFUSE_SECRET_KEY=your_secret_key

# Convert with Langfuse tracking
npm run start -- convert flow.json output --with-langfuse

# View traces in web interface
open http://localhost:3000/langfuse

Performance Monitoring

// Generated code with monitoring
import { performanceMonitor } from './monitoring/performance-monitor';

export async function runFlow(input: string): Promise<string> {
  const tracker = performanceMonitor.track('workflow.execution');
  
  try {
    const result = await agent.call({ input });
    tracker.measure('execution_time');
    return result;
  } finally {
    const snapshot = tracker.end();
    performanceMonitor.recordSnapshot(snapshot);
  }
}

πŸ€– Multiagent Examples

Real-world Team Workflows

# Customer Support Team
npm run start -- convert examples/multiagent/customer-support/flowise/customer-support-agentflow.json output

# Software Development Team  
npm run start -- convert examples/multiagent/software-development/flowise/software-development-agentflow.json output

# Financial Analysis Team
npm run start -- convert examples/multiagent/financial-analysis/flowise/financial-analysis-agentflow.json output

Generated Multiagent Code

// Production-ready multiagent coordination
import { SupervisorAgent, WorkerAgent } from './agents';
import { performanceMonitor } from './monitoring';

export class CustomerSupportTeam {
  private supervisor: SupervisorAgent;
  private workers: WorkerAgent[];

  async processInquiry(inquiry: string): Promise<string> {
    const tracker = performanceMonitor.track('team.inquiry');
    
    // Classify β†’ Route β†’ Respond β†’ Escalate if needed
    const classification = await this.workers[0].classify(inquiry);
    const response = await this.supervisor.delegate(inquiry, classification);
    
    tracker.end();
    return response;
  }
}

πŸš€ Production Deployment

Docker Deployment

# Production deployment with monitoring
./scripts/deploy-production.sh production docker

# Services included:
# - API service with health checks
# - Frontend with real-time monitoring
# - Redis cache for performance
# - Prometheus metrics
# - Grafana dashboards

Health Monitoring

# Health check endpoints
curl http://localhost:8080/health          # API health
curl http://localhost:3000/api/health      # Frontend health
curl http://localhost:8080/metrics         # Prometheus metrics

# Access dashboards
open http://localhost:3000/monitoring      # Performance dashboard
open http://localhost:3001/grafana         # Grafana dashboard

πŸ“Š Supported Node Types (130+ Converters - 98.5% Coverage)

Core LangChain Components

  • βœ… LLM Providers: OpenAI, Anthropic, Google, Cohere, HuggingFace, Azure, Bedrock
  • βœ… Agent Types: Supervisor, Worker, Coordinator, Specialist teams
  • βœ… Memory Systems: Buffer, Window, Summary, Vector Store, Persistent, Zep
  • βœ… Chains: LLM, Conversation, Retrieval QA, Sequential, Transform chains
  • βœ… Tools: Calculator, Wikipedia, Web Search, Custom tools
  • βœ… Document Loaders: PDF, CSV, JSON, Text, Web, API loaders
  • βœ… Vector Stores: Pinecone, Chroma, FAISS, Weaviate, Qdrant
  • βœ… Embeddings: OpenAI, HuggingFace, Cohere, Google
  • βœ… Output Parsers: JSON, List, Regex, Custom parsers

Phase 3 Enterprise Extensions (NEW!)

  • βœ… Cache Systems (4): Redis, InMemory, Momento, Upstash Redis
  • βœ… Google Suite (8): Gmail, Calendar, Drive, Docs, Sheets, Workspace, Meet, Forms
  • βœ… Advanced Search APIs (10): Tavily, Brave, Google, Exa, Arxiv, WolframAlpha, SerpAPI, SearchAPI, DataForSEO, SearXNG
  • βœ… Business Tools (9): Jira, Stripe, Airtable, Notion, Slack, HubSpot, Salesforce, Microsoft Teams, Asana
  • βœ… Development Tools (6): Code Interpreter, OpenAPI, GitHub, Docker, Shell, Database
  • βœ… AgentFlow V2 (4): Agent, Tool, CustomFunction, Subflow orchestration

Advanced Workflows

  • βœ… Multiagent Teams: Customer Support, Development, Finance, Healthcare
  • βœ… RAG Chains: Retrieval Augmented Generation patterns
  • βœ… Function Calling: Enhanced function calling with monitoring
  • βœ… Streaming: Real-time response capabilities

Production Features

  • βœ… Error Handling: Structured errors with recovery strategies
  • βœ… Performance: Monitoring, optimization, bottleneck analysis
  • βœ… Observability: Langfuse integration with tracing and evaluation
  • βœ… Deployment: Docker, Kubernetes, cloud deployment support

πŸ“ˆ Development Status

  • Version: 3.0.0 Phase 3 Complete βœ…
  • Node Coverage: 98.5% (130+ converters) βœ…
  • TypeScript Errors: Zero compilation errors βœ…
  • Build System: Fully functional with 311 compiled files βœ…
  • CLI: βœ… Full-featured with all commands
  • TypeScript: βœ… Production-ready with monitoring
  • Python: βœ… Complete async/await support
  • Testing: βœ… Comprehensive integration tests (800+)
  • Documentation: βœ… Complete with deployment guides
  • Observability: βœ… Langfuse integration
  • Deployment: βœ… Docker, Kubernetes, cloud ready

πŸš€ Latest Features (v3.0.0 - Phase 3)

βœ… 98.5% Node Coverage Achieved

  • Complete enterprise feature coverage with 130+ specialized converters
  • Zero TypeScript compilation errors with production-ready build system
  • Advanced enterprise integrations: cache, search, business tools, Google Suite
  • AgentFlow V2 workflow orchestration with enhanced coordination patterns

βœ… Enterprise Integrations

  • Complete Google Suite integration (Gmail, Calendar, Drive, Docs, Sheets, etc.)
  • Advanced search API support (Tavily, Brave, Google, Exa, WolframAlpha, etc.)
  • Business tool connectors (Jira, Stripe, Airtable, Notion, Slack, HubSpot, etc.)
  • Development tool integration (Code Interpreter, OpenAPI, GitHub, Docker, etc.)

βœ… Production Build Excellence

  • Zero TypeScript compilation errors across entire codebase
  • 311 compiled files with complete type definitions and source maps
  • Optimized test framework with 800+ tests and proper parameter handling
  • Functional CLI tool with full command support

βœ… Enhanced Observability

  • Langfuse integration with prompt versioning and evaluation
  • Performance dashboard with real-time metrics
  • Structured error reporting and recovery
  • Resource monitoring (CPU, memory, network)

βœ… Advanced Multiagent Support

  • 7 real-world multiagent workflow examples
  • Enhanced team coordination patterns
  • Performance-optimized multiagent execution
  • Specialized teams for different industries

βœ… Expanded Language Support

  • Complete Python LangChain code generation
  • Enhanced TypeScript with monitoring integration
  • Modern async/await patterns in both languages

🀝 Contributing

Priority areas for contributions:

  1. Additional Node Converters: Implement more specialized Flowise node types
  2. Enhanced Monitoring: Advanced monitoring and alerting features
  3. Performance Optimization: Code optimization and best practices
  4. Documentation: More examples and tutorials
  5. Testing: Expand test coverage and scenarios

πŸ“ License

MIT License - see LICENSE for details.

πŸ™ Acknowledgments

  • Original Creator: Gregg Coppen gregg@iaminawe.com
  • Claude Flow Development Team: Enhanced multiagent and production features
  • Contributors: All community contributors and testers
  • Special Thanks: Claude Code for development assistance

πŸ“ž Support


Status: Phase 3 Complete βœ… | Version: 3.0.0 | Node Coverage: 98.5% (130+ Types) | TypeScript Errors: Zero βœ… | Languages: TypeScript + Python | Multiagent: 7 Real-world Examples | Observability: Langfuse Integration | Deployment: Docker + Kubernetes Ready

This comprehensive, production-ready toolkit successfully converts Flowise visual workflows and AgentFlow multiagent teams into executable LangChain code with full observability, monitoring, error handling, and deployment support for both TypeScript and Python environments. Phase 3 completion delivers enterprise-grade coverage with 98.5% node support and zero compilation errors.

About

A tool to help convert visual Flowise flows into langchain code.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •