Skip to content

Orchestrator Architecture

The Stavily Orchestrator’s architecture is designed to provide a reliable, scalable platform for automation. It combines multiple services working together to coordinate all automation activities.

graph TB
    subgraph "API Layer"
        PublicAPI[Public API Gateway]
        PrivateAPI[Private API Gateway]
    end

    subgraph "Service Layer"
        WF[Workflow Service]
        AF[Agent Fleet Service]
        PR[Plugin Registry]
        EP[Event Processing]
        AC[Audit & Compliance]
    end

    subgraph "Data Layer"
        PG[(Database)]
        RD[(Cache & Queues)]
        MQ[(Event Bus)]
    end

    subgraph "External"
        AGENTS[Agents]
        UI[Web UI]
        GIT[Plugin Repositories]
    end

    PublicAPI --> AF
    PublicAPI --> EP
    PrivateAPI --> WF
    PrivateAPI --> AC

    WF --> PG
    AF --> RD
    PR --> GIT
    EP --> MQ
    AC --> PG

    AF --> AGENTS
    UI --> PrivateAPI
    PR --> AGENTS

The Orchestrator serves as the central hub, connecting all components and ensuring coordinated automation across the entire platform.

Purpose: Secure external communication with agents and third-party integrations.

Key Features:

  • Agent communication endpoints
  • Authentication and authorization
  • Rate limiting and traffic management
  • High availability and performance

Core Functionality:

  • Workflow parsing and validation
  • Execution orchestration
  • State management
  • Error handling and retry logic

Key Components:

  • Workflow definitions and executions
  • Dependency resolution
  • Parallel execution support

Core Data Structures:

  • Organizations and users
  • Agents and their heartbeats
  • Workflows and executions
  • Plugins and metadata
  • Audit logs

Data Types:

  • Session and metadata caching
  • Agent pools and capabilities
  • Load balancing data
  • Event streams and queues

Key Aspects:

  • Multi-region deployment for high availability
  • Automatic scaling based on demand
  • Load balancing across regions
  • Failover and disaster recovery

Scaling Approaches:

  • Horizontal scaling of services
  • Database read replicas
  • Connection pooling
  • Automated backups

Multi-Level Caching:

  • Application-level caching
  • API-level caching
  • Session and query caching

Security Layers:

  • Transport encryption
  • Token-based authentication
  • Role-based access control
  • Certificate management

Compliance Features:

  • Data protection and privacy
  • Audit trails and reporting
  • Data residency controls
  • Automated compliance workflows

Key Metrics:

  • Service performance metrics
  • Workflow success rates
  • Agent health indicators
  • Infrastructure utilization

Logging Features:

  • Structured logging
  • Log aggregation and analysis
  • Automated alerting
  • Long-term archival