GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - luno/workflow: The type-safe, event-driven workflow orchestration library that scales with your business. Build robust, distributed workflows in Go with compile-time safety, automatic retries, and horizontal scaling out of the box. Integrate with your existing tech stack using adapters 🚀

BranchesTags
Open more actions menu

Latest commit

 

History

371 Commits
371 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
_examples
_examples
 
 
adapters
adapters
 
 
docs
docs
 
 
internal
internal
 
 
logo
logo
 
 
testdata
testdata
 
 
workflowpb
workflowpb
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
await.go
await.go
 
 
await_test.go
await_test.go
 
 
builder.go
builder.go
 
 
builder_internal_test.go
builder_internal_test.go
 
 
callback.go
callback.go
 
 
callback_internal_test.go
callback_internal_test.go
 
 
connector.go
connector.go
 
 
connector_internal_test.go
connector_internal_test.go
 
 
consumer.go
consumer.go
 
 
delete.go
delete.go
 
 
delete_internal_test.go
delete_internal_test.go
 
 
errors.go
errors.go
 
 
event.go
event.go
 
 
eventfilter.go
eventfilter.go
 
 
eventfilter_test.go
eventfilter_test.go
 
 
eventstreamer.go
eventstreamer.go
 
 
filter.go
filter.go
 
 
filter_test.go
filter_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
hook.go
hook.go
 
 
hook_internal_test.go
hook_internal_test.go
 
 
hook_test.go
hook_test.go
 
 
logger.go
logger.go
 
 
marshal.go
marshal.go
 
 
metrics_test.go
metrics_test.go
 
 
options.go
options.go
 
 
order.go
order.go
 
 
order_internal_test.go
order_internal_test.go
 
 
outbox.go
outbox.go
 
 
pause.go
pause.go
 
 
pause_internal_test.go
pause_internal_test.go
 
 
pause_test.go
pause_test.go
 
 
record.go
record.go
 
 
renovate.json
renovate.json
 
 
rolescheduler.go
rolescheduler.go
 
 
run.go
run.go
 
 
run_internal_test.go
run_internal_test.go
 
 
runstate.go
runstate.go
 
 
runstate.md
runstate.md
 
 
runstate_internal_test.go
runstate_internal_test.go
 
 
runstate_test.go
runstate_test.go
 
 
schedule.go
schedule.go
 
 
schedule_test.go
schedule_test.go
 
 
sonar-project.properties
sonar-project.properties
 
 
state.go
state.go
 
 
state_internal_test.go
state_internal_test.go
 
 
state_test.go
state_test.go
 
 
status.go
status.go
 
 
status_internal_test.go
status_internal_test.go
 
 
step.go
step.go
 
 
step_internal_test.go
step_internal_test.go
 
 
store.go
store.go
 
 
testing.go
testing.go
 
 
testing_test.go
testing_test.go
 
 
timeout.go
timeout.go
 
 
timeout_internal_test.go
timeout_internal_test.go
 
 
topic.go
topic.go
 
 
trigger.go
trigger.go
 
 
trigger_internal_test.go
trigger_internal_test.go
 
 
unmarshal.go
unmarshal.go
 
 
update.go
update.go
 
 
update_internal_test.go
update_internal_test.go
 
 
visualiser.go
visualiser.go
 
 
visualiser_test.go
visualiser_test.go
 
 
workflow.go
workflow.go
 
 
workflow_internal_test.go
workflow_internal_test.go
 
 
workflow_test.go
workflow_test.go
 
 

Repository files navigation

Workflow Logo
Go Reference Mentioned in Awesome Go

Workflow

The type-safe, event-driven workflow orchestration library that scales with your business.

Build robust, distributed workflows in Go with compile-time safety, automatic retries, and horizontal scaling out of the box.

// Define your business logic as type-safe state machines
b := workflow.NewBuilder[Order, OrderStatus]("order-processing")
b.AddStep(OrderCreated, ProcessPayment, PaymentProcessed)
b.AddStep(PaymentProcessed, FulfillOrder, OrderCompleted)

wf := b.Build(kafkaStreamer, sqlStore, roleScheduler)

Why Choose Workflow?

🎯 Type-Safe by Design

Unlike other orchestrators, Workflow leverages Go generics for compile-time guarantees. Catch errors before deployment, not in production.

// Your IDE knows exactly what data flows where
func processPayment(ctx context.Context, r *workflow.Run[Order, OrderStatus]) (OrderStatus, error) {
    // r.Object is typed as *Order, OrderStatus is your enum
    // Compiler catches mismatches before they cause runtime errors
}

⚡ Event-Driven Architecture

Built for modern distributed systems. Steps communicate through durable events, enabling:

  • Loose coupling between workflow components
  • Automatic retries with exponential backoff
  • Horizontal scaling across multiple instances
  • Fault tolerance that survives network partitions

🔧 Infrastructure Agnostic

Your choice of database, message queue, and coordination service. Start simple, scale when needed:

// Development: Everything in-memory
wf := b.Build(memstreamer.New(), memrecordstore.New(), memrolescheduler.New())

// Production: Battle-tested infrastructure
wf := b.Build(kafkastreamer.New(), sqlstore.New(), rinkrolescheduler.New())

📊 Built-in Observability

Production-ready monitoring without the setup overhead:

  • Prometheus metrics for throughput, latency, and error rates
  • Web UI for real-time workflow visualization
  • Structured logging with correlation IDs
  • Distributed tracing support

Perfect For

  • Order Processing: Payment, inventory, fulfillment pipelines
  • User Onboarding: Multi-step verification and activation flows
  • Financial Operations: Transaction processing with compliance checks
  • Data Processing: ETL pipelines with validation and cleanup
  • Approval Workflows: Multi-stakeholder review processes

vs. The Alternatives

Feature Workflow Temporal Zeebe/Camunda
Type Safety ✅ Compile-time (Go generics) ❌ Runtime validation ❌ Runtime (BPMN)
Architecture ✅ Event-driven state machines ⚠️ RPC-based activities ⚠️ Token-based execution
Infrastructure ✅ Your choice (adapters) ❌ Requires Temporal cluster ❌ Requires external engine
Deployment ✅ Library in your app ❌ Separate server/workers ❌ Separate engine
Learning Curve ✅ Native Go patterns ⚠️ New concepts & SDKs ❌ BPMN modeling
Language ✅ Go-native ⚠️ Multi-language via gRPC ⚠️ Multi-language

Quick Start

go get github.com/luno/workflow
package main

import (
    "context"
    "fmt"
    "github.com/luno/workflow"
    "github.com/luno/workflow/adapters/memstreamer"
    "github.com/luno/workflow/adapters/memrecordstore"
    "github.com/luno/workflow/adapters/memrolescheduler"
)

type TaskStatus int
const (
    TaskStatusUnknown   TaskStatus = 0
    TaskStatusCreated   TaskStatus = 1
    TaskStatusProcessed TaskStatus = 2
    TaskStatusCompleted TaskStatus = 3
)

type Task struct {
    ID   string
    Name string
}

func main() {
    b := workflow.NewBuilder[Task, TaskStatus]("task-processor")

    b.AddStep(TaskStatusCreated, func(ctx context.Context, r *workflow.Run[Task, TaskStatus]) (TaskStatus, error) {
        fmt.Printf("Processing: %s\n", r.Object.Name)
        return TaskStatusProcessed, nil
    }, TaskStatusProcessed)

    b.AddStep(TaskStatusProcessed, func(ctx context.Context, r *workflow.Run[Task, TaskStatus]) (TaskStatus, error) {
        fmt.Printf("Completed: %s\n", r.Object.Name)
        return TaskStatusCompleted, nil
    }, TaskStatusCompleted)

    wf := b.Build(memstreamer.New(), memrecordstore.New(), memrolescheduler.New())

    ctx := context.Background()
    wf.Run(ctx)
    defer wf.Stop()

    // Trigger a workflow
    runID, _ := wf.Trigger(ctx, "task-1", workflow.WithInitialValue(&Task{
        ID: "task-1",
        Name: "Process Invoice",
    }))

    // Wait for completion
    wf.Await(ctx, "task-1", runID, TaskStatusCompleted)
    fmt.Println("✅ Workflow completed!")
}

Enterprise Ready

Workflow provides enterprise-grade features:

  • ✅ Exactly-once processing guarantees via transactional outbox pattern
  • ✅ Built-in error handling with pause and retry mechanisms
  • ✅ Comprehensive observability via Prometheus metrics and Web UI
  • ✅ Horizontal scaling through role-based scheduling
  • ✅ Infrastructure flexibility via pluggable adapters
  • ✅ Production deployment patterns for various scales

Documentation

Topic Description
Getting Started Install and build your first workflow
Core Concepts Understand Runs, Events, and State Machines
Architecture Deep dive into system design and components
Steps Build workflow logic with step functions
Adapters Infrastructure integration guide
Database Setup Complete MariaDB/MySQL & PostgreSQL setup guide
Callbacks Handle external events and webhooks
Timeouts Add time-based operations
Connectors Integrate with external event streams
Hooks React to workflow lifecycle changes
Configuration Tune performance and behaviour
Monitoring Observability and debugging

Examples & Tutorials

Example Description
Getting Started Your first workflow in 5 minutes
SQL Example Complete MariaDB/MySQL integration with Docker
Order Processing Complex e-commerce workflow with payments & fulfilment
Callbacks Handle external webhooks and events
Timeouts Schedule and timeout operations
Connectors Integrate with external event streams

Community & Support

  • 📚 Documentation - Comprehensive guides and examples
  • 🐛 Issues - Bug reports and feature requests
  • 💬 Discussions - Community Q&A

Installation

go get github.com/luno/workflow

# Production adapters (install as needed)
go get github.com/luno/workflow/adapters/kafkastreamer
go get github.com/luno/workflow/adapters/sqlstore
go get github.com/luno/workflow/adapters/rinkrolescheduler
go get github.com/luno/workflow/adapters/webui

License

MIT License


Ready to build reliable workflows? Get started in 5 minutes →

About

The type-safe, event-driven workflow orchestration library that scales with your business. Build robust, distributed workflows in Go with compile-time safety, automatic retries, and horizontal scaling out of the box. Integrate with your existing tech stack using adapters 🚀

Topics

durableedaeventdrivenarchitecturegogolanghacktoberfestidempotentkafkareflexstate-machinestatemachinetddworkflowworkflow-automationworkflow-engineworkflows

Resources

Readme
BSD-3-Clause license

Contributing

Contributing
Activity
Custom properties

Stars

264 stars

Watchers

6 watching

Forks

23 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.