Skip to content

parseExecutionHistory

function parseExecutionHistory(params): ExecutionOverlay;

Defined in: src/execution.ts:811

Reduce a Step Functions execution’s event history into a render-agnostic ExecutionOverlay: per-state status, attempts, duration, and the set of transitions the run actually followed.

Pure and deterministic — any surface (SVG, Mermaid, React, Action) can consume it without rendering. States entered multiple times (Map iterations) are aggregated: status escalates to the worst outcome, durations sum, and attempts total. For the un-aggregated, ordered form use buildExecutionTimeline.

Object parameters

HistoryEvent[]

Ordered execution history events (from GetExecutionHistory)

ExecutionOverlay

The computed execution overlay model

import { parseExecutionHistory } from 'sfn-diagram';
const overlay = parseExecutionHistory({ events });
console.log(overlay.states['ProcessOrder'].status); // 'succeeded'