Architecture overview
FluxPrompt consists of several interconnected components that work together to execute workflows, manage queues, and provide user interfaces.Main API (Nest.js)
The main API is built with Nest.js and serves as the central service responsible for all system processes. It handles:- User authentication and authorization
- Flow and node management
- API endpoints for workflow execution
- Business logic and data processing
- Integration with the PostgreSQL database using TypeORM
PostgreSQL database
The primary database stores all application data including:- User accounts and authentication data
- Flows, nodes, and their configurations
- Execution history and logs
- Billing and usage information
- System configuration
Temporal orchestrator
Temporal manages the execution queues for nodes and agents. It provides:- Workflow orchestration and state management
- Reliable execution of long-running processes
- Queue management for node and agent processing
- Retry logic and error handling
- Workflow history and state persistence
Temporal database
A dedicated database stores Temporal’s internal data:- Workflow execution state
- Activity execution history
- Queue information and metadata
- Temporal’s internal state management data
Worker service
The worker is a microservice responsible for processing workflow executions. It:- Processes agent and node executions from the Temporal queue
- Executes Temporal activities
- Handles the actual AI model calls and processing
- Manages resource-intensive operations
- Reports execution results back to Temporal
React frontend
The main frontend application built with React provides:- Visual workflow builder for creating nodes and connections
- Dashboard for monitoring workflows and usage
- User interface for managing flows, agents, and configurations
- Real-time updates and execution monitoring
- Forms and data input interfaces
Temporal UI
A separate frontend application provides visualization and debugging tools for Temporal workflows:- Workflow execution visualization
- Queue status monitoring
- Activity execution details
- Debugging and troubleshooting tools
- Workflow history inspection
Key concepts
Nodes
Nodes are the building blocks of workflows. Each node represents a specific operation such as:- Text generation using AI models
- Data transformation
- Conditional logic
- API calls
- File operations