ago
Experimental — ago is under active development. API may change.
Orchestrates multi-step workflows through capitan event choreography.
The Problem
Event-driven workflows require coordination: one signal triggers the next, errors fork to recovery paths, and the full sequence needs visibility. Building this from raw listeners means reimplementing routing, error handling, and tracing for every workflow.
The Pipeline
workflow := ago.New("task-processing").
On(TaskCreated).
Then(ValidateTask, AssignWorker).
On(TaskCompleted).
Then(NotifyRequester, UpdateMetrics).
OnError(TaskFailed).
Then(RetryOrEscalate)
workflow.Attach(capitan.Default())
TaskCreated
│
├──▶ ValidateTask
└──▶ AssignWorker
│
TaskCompleted ├──▶ NotifyRequester
└──▶ UpdateMetrics
TaskFailed ──────▶ RetryOrEscalate
What Capitan Provides
| ago needs | Capitan provides |
|---|---|
| Trigger events | Signal definitions |
| Event routing | Hook(signal, callback) |
| Workflow branching | Multiple signals for success/error paths |
| Event emission | Emit(ctx, signal, fields...) |
| Trace correlation | Event.Context() propagation |
| Field forwarding | Event.Fields() passed through chain |