Skip to content

App Status ​

A label + color pair that workflows set to report their current phase. Displayed in the dashboard and stored in the database.

Setting Status from a Workflow ​

go
func OrderWorkflow(ctx turbine.Context, orderID string) (string, error) {
    ctx.SetAppStatus("validating", "yellow")
    // ... validation steps ...

    ctx.SetAppStatus("processing", "blue")
    // ... processing steps ...

    ctx.SetAppStatus("fulfilled", "green")
    return "done", nil
}

Setting Status from a Step ​

Use the standalone function with context.Context:

go
result, err := turbine.Do(ctx, func(stepCtx context.Context) (string, error) {
    turbine.SetAppStatus(stepCtx, "uploading", "blue")
    // ...
    return "done", nil
}, turbine.WithStepName("upload"))

Valid Colors ​

ColorTypical Use
greenSuccess, completed
redError, failed
yellowWarning, waiting
blueIn progress
grayIdle, inactive
limePositive, minor success
orangeCaution
purpleProcessing
pinkCustom
cyanCustom

Using an invalid color returns an error.

Reading Status ​

The current app status is included in the Status struct returned by handle.GetStatus():

go
status, err := handle.GetStatus()
fmt.Println(status.AppStatus, status.AppStatusColor)

Behavior During Recovery ​

INFO

Status updates are skipped during recovery replay to avoid unnecessary database writes. The status is restored to the last persisted value.