Core Components

Workflow Engine Architecture

System Overview

The Workflow Engine is an advanced orchestration system for AI tool execution, supporting both local and remote processing with parallel step execution capabilities. It provides a declarative approach to complex multi-step AI workflows through configuration files.

graph TB
    subgraph "Workflow Engine Layer"
        WFE[Workflow Executor<br/>High-level API]
        WE[Workflow Engine<br/>Core Engine]
        CL[Configuration Loader<br/>Config Loader]
        H[Step Handlers<br/>Execution Logic]
    end

    subgraph "Configuration Layer"
        PC[Private Config<br/>Tool Config]
        PUBC[Public Config<br/>Interface Config]
        ST[Step Types<br/>Handler Definitions]
        FL[Flow<br/>Execution Steps]
    end

    subgraph "Execution Layer"
        A[AI Handlers<br/>Gemini API]
        API[API Handlers<br/>HTTP Calls]
        FH[File Handlers<br/>File Operations]
        PH[Cloud Handlers<br/>External Scripts]
    end

    WFE --> WE
    WE --> CL
    WE --> H
    CL --> PC
    CL --> PUBC
    PC --> ST
    PC --> FL
    H --> A
    H --> API
    H --> FH
    H --> PH

Configuration System

The workflow engine uses a declarative configuration framework that enables workflow specification:

name: analyzeSentiment
execution_target: remote
model: "gemini-2.5-flash"
step_types:
  - name: "ai_prompt"
    handler: "ai_prompt"
    prompt_template: "Analyze sentiment: {{flow_input.text}}"
flow:
  - step: "analyze_sentiment"
    type: "ai_prompt"

Step Handler Architecture

The workflow engine implements a modular step handler system:

  • AI-powered text processing with templating
  • External API integrations with authentication
  • File system operations with security validation
  • Cloud execution environments
  • Internal service orchestration

Tool Execution System

System Overview

The execution system implements intelligent routing of commands to either remote API endpoints or local implementations.

graph TB
    subgraph "Input Layer"
        MCP[Tool Interface<br/>Command + Parameters]
    end

    subgraph "Discovery Layer"
        CAT[Tool Registry<br/>Available Tools]
        META[Tool Metadata<br/>Configuration]
    end

    subgraph "Routing Layer"
        TD[Execution Router<br/>Main Router]
        RT{Routing Logic<br/>Target?}
    end

    subgraph "Execution Layer"
        REMOTE[Remote Execution<br/>API Call]
        LOCAL[Local Execution<br/>Direct Handler]
    end

    subgraph "Handler Registry"
        REG[Handler Library<br/>Local Tools]
        AH[Analysis Handler]
        SH[System Handler]
        FH[File Handler]
    end

    MCP --> TD
    TD --> CAT
    TD --> RT
    RT -->|remote| REMOTE
    RT -->|local| LOCAL
    LOCAL --> REG
    REG --> AH
    REG --> SH
    REG --> FH

Execution Routing Algorithm

The system provides intelligent routing between execution environments based on configuration and availability.

Handler Categories

AI/ML Processing

  • Sentiment analysis and text classification
  • Code generation and content creation

System Operations

  • System monitoring and diagnostics
  • File metadata extraction and processing

Hybrid Processing

  • Chart generation with local rendering
  • Image conversion and enhancement

Desktop Orchestrator

System Orchestration

The desktop application serves as the central orchestrator for the entire system, managing server lifecycle, configuration, and user experience.

graph TB
    subgraph "User Interface Layer"
        TRAY[Tray Interface<br/>Status Display]
        SETTINGS[Settings Panel<br/>Configuration Management]
        TOOLS[Tools Panel<br/>Tool Control]
    end

    subgraph "System Orchestration Layer"
        MCP[Server Control<br/>Lifecycle Management]
        CACHE[Smart Caching<br/>Configuration Cache]
        CONFIG[IDE Integration<br/>Auto Configuration]
    end

    subgraph "Integration Layer"
        API[API Monitoring<br/>Health Checks]
        LOCAL[Hardware Access<br/>Local Execution]
    end

    subgraph "Communication Layer"
        ENV[Environment Management<br/>Settings]
        IPC[Process Communication<br/>Inter-process]
    end

    TRAY --> MCP
    SETTINGS --> CACHE
    TOOLS --> CONFIG
    MCP --> API
    LOCAL --> ENV
    IPC --> ALL

Server Lifecycle Management

Complete process orchestration with automatic startup, restart, and monitoring capabilities.

Multi-level Configuration Storage

Application Settings

Persistent configuration for user preferences and system settings.

Project-level Configuration

Per-project tool activation and behavior settings.

IDE Integration

Automatic configuration synchronization with development environments.

Component Integration

Data Flow Architecture

sequenceDiagram
    participant Cursor as Cursor IDE
    participant TrayApp
    participant MCP
    participant API
    participant Gemini

    Cursor->>TrayApp: Tool request
    TrayApp->>MCP: Execute command
    MCP->>MCP: Apply configuration
    MCP->>API: Remote processing
    API->>Gemini: AI processing
    Gemini-->>API: AI response
    API-->>MCP: Formatted result
    MCP-->>Cursor: Response

Configuration Process

sequenceDiagram
    participant TrayApp
    participant Environment
    participant ConfigBuilder
    participant MCP

    TrayApp->>Environment: Set preferences
    Environment->>ConfigBuilder: Read settings
    ConfigBuilder->>ConfigBuilder: Build configuration
    ConfigBuilder->>MCP: Apply configuration
    MCP->>MCP: Use configuration

Performance Optimization

Caching Strategies

  • Multi-level Caching: Configuration, execution data, and results
  • Intelligent Invalidation: Time-based and event-driven cleanup
  • Memory Management: Efficient cache with configurable limits

Resource Management

  • Handler Pooling: Reusable execution instances
  • Lazy Initialization: Non-blocking startup with on-demand loading
  • Request Batching: Optimized communication patterns

Monitoring & Health Checks

  • Real-time Status: Continuous monitoring of all components
  • Automated Recovery: Intelligent restart mechanisms
  • Performance Analytics: Detailed insights into resource utilization

These core components provide the sophisticated orchestration foundation that enables ReCloud's advanced AI workflow capabilities across the entire system architecture.

Slopbook® Engine - powered by Slopman