Skip to content
Audit logging for Azure/go-workflow

See every step.
Track every retry.

Records every step execution event — attempts, retries, durations, errors, dependencies — with timestamped events and export to JSON, NDJSON, diagrams, and an interactive HTML dashboard.

12+
Export formats
244
Tests
~94%
Coverage
MIT
License
main.go
package main

import (
    "context"

    flow "github.com/Azure/go-workflow"

    auditlog "github.com/larsartmann/go-workflow-auditlog"
)

func main() {
    audit, _ := auditlog.New(auditlog.Config{
        Enabled:    true,
        WorkflowID: "data-pipeline",
    })

    w := &flow.Workflow{}
    // add your steps...

    audit.Attach(w)                      // 1. Inject callbacks
    _ = w.Do(context.Background())       // 2. Run workflow
    audit.Snapshot(w)                    // 3. Capture final state

    _ = audit.ExportHTML("report.html")  // Interactive dashboard
}
Features

Full visibility into every workflow run.

Every decision optimized for observability — from per-attempt events to interactive dashboards.

Per-Attempt Events

Every retry, every duration, every error — captured as timestamped events with attempt numbers and phases.

Full DAG Structure

Dependency graph, retry/timeout config, step types, skipped and canceled statuses — all captured automatically.

Interactive Dashboard

Self-contained HTML report with DAG graph engine, sortable tables, Gantt timeline, and collapsible tree — zero dependencies.

12+ Export Formats

JSON, NDJSON, Mermaid, PlantUML, Graphviz DOT, D2, tables (16 sub-formats), ASCII tree, HTML tree, and interactive HTML.

Report Diffing

Compare two runs for regression detection — added, removed, and changed steps with duration deltas and status changes.

Cross-System Correlation

128-bit crypto-random RunID stamped on every event for trace/log correlation across distributed systems.

How it works

Three calls. Full audit trail.

Attach, run, snapshot. The library handles the rest — callbacks fire per-attempt, capturing everything automatically.

1

Attach

Inject BeforeStep / AfterStep callbacks into every step via State.MergeConfig. Call before Do.

audit.Attach(w)
2

Execute

During w.Do(ctx), callbacks fire per-attempt, recording timestamped events with duration and error.

w.Do(ctx)
3

Snapshot

Read post-execution state to capture DAG structure, retry config, and skipped/canceled statuses.

audit.Snapshot(w)
Comparison

Why go-workflow-auditlog?

Manual logging is high-boilerplate and easy to forget. This library captures everything automatically.

No audit Manual logging go-workflow-auditlog
Per-attempt events ~
DAG structure
Skipped/canceled detection
Retry & timeout config
HTML dashboard
Diagram export
Report diffing
RunID correlation
Lines of boilerplate 0 ~50 3
Use Cases

Built for real workflows.

Drop it into any go-workflow pipeline for instant observability.

CI/CD Pipelines

Audit every step execution, retry, and failure for post-mortem analysis

Data Pipelines

Track transform chain timing for bottleneck detection and regression alerts

Microservice Orchestration

Correlate workflow runs with distributed traces via 128-bit RunID

Compliance & Audit Trails

Immutable event stream for regulated workflows and SOC2/HIPAA evidence

Get Started

Start auditing in minutes.

Three calls. Zero boilerplate. Full visibility.