RunHistory
A runs list with status filter and search beside a run detail showing per-step state, timings, input, output, logs and screenshots, the failing step, a span timeline with attributes, and the raw payload.
Code
import { RunHistory, type RunRecord } from "@fadymondy/nasaq/web";export function Runs({ runs }: { runs: RunRecord[] }) { return <RunHistory runs={runs} onRetry={async (run) => { await rerun(run.id); }} />;}Workflow · beta
Live examples and controls: RunHistory in the lab.
Install
npx shadcn@latest add https://docs.nasaqui.com/r/run-history.jsonAnswers "what happened when it ran?". Runs are listed newest first with a status filter and search. Choosing one shows
its steps on a shared time axis, each expandable to its input, output, logs and screenshots; the step that failed is
called out and opened for you. A Trace tab lays the spans out as a waterfall with attributes, and a Raw tab shows the
payload. RunDetail is exported on its own for a page that already knows which run to show.
When to use
- The execution log of a workflow, job or automation.
- A detail page for one run reached from an alert or a list.
When not to use
- Live request tracing across services with sampling and percentiles: use
apm-panels. - Editing the workflow itself: use
workflow-canvasorstep-editor.
Import
import { RunHistory, RunDetail } from "@fadymondy/nasaq/web";
// inside this monorepo: "@nasaq/web"Quick start
import { RunHistory, type RunRecord } from "@fadymondy/nasaq/web";
export function Runs({ runs }: { runs: RunRecord[] }) {
return <RunHistory runs={runs} onRetry={async (run) => { await rerun(run.id); }} />;
}Anatomy
RunHistory data-slot="run-history"
├─ list section search, status ToggleGroup with counts, run rows (data-run-row)
└─ detail section
└─ RunDetail data-slot="run-detail"
├─ header status, id, started, duration, trigger, Run again / Cancel
├─ Alert failing step with a "Show the step" button
└─ Tabs Steps (data-step rows) | Trace (run-trace, run-span-detail) | RawAPI
RunHistory
| Prop | Type | Default | Description |
|---|---|---|---|
runs | readonly RunRecord[] | required | Any order; shown newest first. |
selectedId / defaultSelectedId | string | null | null | Controlled or initial selection. |
onSelect | (run | null) => void | none | Selection changed. |
onRetry | (run) => Promise<void | { error?: string }> | none | Shows "Run again" on finished runs. |
onCancel | (run) => Promise<void | { error?: string }> | none | Shows "Cancel run" on running ones. |
loading | boolean | false | Skeleton list. |
labels | Partial<RunHistoryLabels> | none | Override any string. |
RunDetail
run, onRetry, onCancel, defaultTab ("steps" | "trace" | "raw"), leading, labels.
RunRecord
{ id, name?, status, startedAt, durationMs?, trigger?, steps: RunStep[], spans?: RunSpan[], payload?, error? }.
RunStep has startedAtMs?, durationMs?, depth? (for nested steps), input?, output?, error?, logs?, screenshots?, attempt?.
RunSpan has id, parentId?, name, service?, startMs, durationMs, error?, attributes?.
Statuses are the workflow ones: idle, running, success, error, waiting, skipped.
Examples
Start on the trace of one run:
<RunDetail run={run} defaultTab="trace" />Accessibility
| Key | Action |
|---|---|
| Tab | Moves through search, filters, runs, tabs and step rows. |
| Enter / Space | Selects a run, expands a step, selects a span, enlarges a screenshot. |
| Arrow keys | Move between tabs and filter toggles. |
Status is an icon plus a word. Step rows are buttons with aria-expanded. Span bars carry a text alternative with the duration. The span detail is a polite live region. Screenshots open in a dialog with their alt text.
RTL & i18n
- The layout mirrors: bars grow from the start edge, the back arrow flips, nesting indents on the start side.
- Ids, span names, attributes, durations and code stay left-to-right.
- English and Arabic strings ship; pass
labelsto change any.
Styling & tokens
- Uses
--nq-danger-soft,--nq-selected,--nq-hoverand border tokens. Extend withclassName; never pass raw hex.
Do / Don't
- Do record
startedAtMson steps so the bars show real overlap. - Do keep screenshots small or served by URL.
- Don't put secrets in
input,outputorpayload; they are displayed.
Related
Lab
https://docs.nasaqui.com/?path=/docs/components-workflow-run-history--docs
RuleBuilder
An IFTTT style rule editor with an event trigger, nested all-of and any-of condition groups, and an ordered list of actions, read back as a plain-language sentence with the missing pieces listed.
StepEditor
A linear, sortable, nestable step list with forms generated from each step type, continue-on-failure, a parameters editor with secret values, a node picker for adding steps, problem checking and a test-run panel.