Flyt: A Zero-Dependency Workflow Framework Brings Norwegian Simplicity to Go
Share this article
In a landscape dominated by orchestration behemoths, Flyt offers Go developers a refreshingly minimalist approach to workflow management. Pronounced "fleet," this new open-source framework strips away dependencies while delivering sophisticated capabilities for building resilient, composable processes—from simple linear tasks to complex branching workflows.
The Anatomy of Flow
At Flyt's core lies a simple yet powerful triad:
- Nodes: Building blocks with three-phase execution:
node := flyt.NewNode(
flyt.WithPrepFunc(func(ctx context.Context, shared *flyt.SharedStore) (any, error) {
data, _ := shared.Get("input")
return data, nil
}),
flyt.WithExecFunc(func(ctx context.Context, prepResult any) (any, error) {
return transform(prepResult), nil
}),
)
Actions: Dynamic routing between nodes via string-based decisions (e.g.,
"success","retry","fallback")Shared Store: Thread-safe data passing with merge capabilities:
shared.Merge(map[string]any{
"user_id": 123,
"config": map[string]any{"timeout": 30},
})
Resilience by Design
Flyt bakes in production-grade patterns:
- Automatic Retries: Configurable backoff strategies
- Fallback Mechanisms: Graceful degradation via the
FallbackNodeinterface - Rate Limiting: Custom node implementations with token buckets
Scaling Patterns
For complex workloads, Flyt offers:
// Concurrent batch processing
batchNode := flyt.NewBatchNode(processFunc, true)
// Nested flows as composable units
validationFlow := createValidationFlow()
mainFlow.Connect(fetchNode, "validate", validationFlow)
// Worker pools for custom concurrency
pool := flyt.NewWorkerPool(10)
pool.Submit(func() { /* ... */ })
Why Minimalism Matters
In contrast to dependency-heavy alternatives, Flyt's zero-external-dependency philosophy reduces:
- Security vulnerabilities
- Version conflicts
- Binary bloat
This makes it ideal for embedded systems, lightweight microservices, and environments with strict compliance requirements.
Real-World Implementations
The framework shines in AI/ML pipelines, showcased in included examples:
- LLM Streaming: Real-time OpenAI responses with Server-Sent Events
- Agent Systems: AI agents with web search capabilities
- Distributed Tracing: Langfuse integration for workflow observability
As distributed systems grow increasingly complex, Flyt offers a compelling blend of simplicity and power—proving that sometimes, the most effective flows come from the lightest currents.
Source: Flyt GitHub Repository