zoobzio December 8, 2025 Edit this page

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 needsCapitan provides
Trigger eventsSignal definitions
Event routingHook(signal, callback)
Workflow branchingMultiple signals for success/error paths
Event emissionEmit(ctx, signal, fields...)
Trace correlationEvent.Context() propagation
Field forwardingEvent.Fields() passed through chain

Learn More