A lightweight, embeddable workflow engine for Go developers. Implements the Saga pattern with orchestrator approach, providing transaction management and compensation capabilities.

Go Library Saga Pattern PostgreSQL

Why Floxy?

Floxy means "flow" + "flux" + "tiny". It's a lightweight, embeddable workflow engine for developers who love Go, simplicity, and control.

Lightweight, Not Heavyweight

Most workflow engines require you to deploy multiple services, brokers, and databases just to run a single flow. Floxy is different — it's a Go library. You import it, initialize an engine, and define your workflow directly in Go code.

No clusters. No queues.

Pragmatic by Design

Floxy doesn't try to solve every problem in distributed systems. It focuses on clear, deterministic workflow execution with the tools Go developers already use: PostgreSQL as durable storage, Go's standard net/http for API, structured retries, compensation, and rollback.

Features

Workflow DSL

Declarative workflow definition using Builder pattern. Define complex workflows with a clean, intuitive API.

Saga Pattern

Orchestrator-based saga implementation with compensation. Automatic rollback and compensation on failures.

Workflow Versioning

Safe changing flows using versions. Update workflows without breaking existing instances.

Transaction Management

Built-in transaction support with rollback capabilities. SavePoints for rollback to specific points in execution.

Parallel Execution

Fork/Join patterns for concurrent workflow steps with dynamic wait-for detection. Execute multiple branches simultaneously.

Error Handling

Automatic retry mechanisms and failure compensation. Configurable retry policies per step.

Conditional Branching

Condition steps for dynamic workflow paths. Smart rollback for parallel flows with condition steps.

Human-in-the-loop

Interactive workflow steps that pause execution for human decisions. Perfect for approval workflows.

Dead Letter Queue

Two modes for error handling: Classic Saga with rollback/compensation or DLQ Mode with paused workflow and manual recovery.

Distributed Mode

Microservices can register only their handlers. Steps without local handlers are returned to queue for other services to process.

Priority Aging

Prevents queue starvation by gradually increasing step priority as waiting time increases.

PostgreSQL Storage

Persistent workflow state and event logging. Embedded database migrations with go:embed.

Products

Floxy ecosystem includes multiple products for different use cases and requirements.

Floxy

The core library - a lightweight, embeddable workflow engine for Go. Perfect for teams who want simplicity and control.

  • Go library - no external services
  • PostgreSQL storage
  • Builder DSL for workflows
  • Saga pattern with compensation
  • Fork/Join patterns
  • Human-in-the-loop support
  • Dead Letter Queue
View Repository
PRO

Floxy Pro

Advanced version with features including partitioned tables, CLI tool, and runtime daemon.

  • All Floxy features
  • Partitioned tables with pg_partman
  • floxyctl CLI tool
  • floxyd runtime daemon
  • Bash and HTTP handlers
  • YAML workflow definitions
View Repository

Floxy Manager

Modern web interface for managing Floxy workflows with Go backend and React frontend. Enterprise-ready with SSO, RBAC, and multi-tenancy.

  • Visual workflow builder
  • SSO/SAML authentication
  • LDAP integration
  • Role-based access control
  • Multi-tenancy support
  • Workflow visualization
  • Dead Letter Queue management
  • Audit logging
View Repository

GoLand Plugin

Visualization and export plugin for GoLand that renders workflow graphs. Helps developers understand workflow logic directly in the IDE.

  • Workflow visualization
  • PlantUML and Mermaid diagrams
  • Export to .puml, .mmd, .svg, .png
  • Offline rendering
  • Smart step recognition
  • Auto-refresh on changes
View Repository

Quick Start

Get started with Floxy in minutes. Here's a simple example:

package main

import (
    "context"
    "github.com/jackc/pgx/v5/pgxpool"
    "github.com/floxy-project/floxy"
)

func main() {
    ctx := context.Background()
    
    // Connect to PostgreSQL
    pool, _ := pgxpool.New(ctx, "postgres://...")
    defer pool.Close()
    
    // Run migrations
    floxy.RunMigrations(ctx, pool)
    
    // Create engine
    engine := floxy.NewEngine(pool)
    defer engine.Shutdown()
    
    // Define workflow
    workflow, _ := floxy.NewBuilder("order-processing", 1).
        Step("process-payment", "payment").
        OnFailure("refund-payment", "compensation").
        Then("reserve-inventory", "inventory").
        Build()
    
    // Register and start
    engine.RegisterWorkflow(ctx, workflow)
    instanceID, _ := engine.Start(ctx, "order-processing-v1", input)
    
    // Process steps
    engine.ExecuteNext(ctx, "worker1")
}

Installation

go get github.com/floxy-project/floxy

Requires Go 1.24+ and PostgreSQL database.

Examples

  • Hello World - Basic single-step workflow
  • E-commerce - Order processing with compensation
  • Data Pipeline - Parallel data processing
  • Microservices - Complex service orchestration
  • SavePoint Demo - Rollback functionality
  • Human-in-the-loop - Interactive workflows