fetchExecutionHistory
function fetchExecutionHistory(params): Promise<HistoryEvent[]>;Defined in: src/aws.ts:45
Fetches the complete history of a Step Functions execution, paginating through
every GetExecutionHistory page so callers don’t have to hand-roll the
nextToken loop.
The returned HistoryEvent[] can be passed straight to parseExecutionHistory,
generateExecution, or generateMermaidExecution from sfn-diagram.
Parameters
Section titled “Parameters”params
Section titled “params”The SFN client, execution ARN, and optional page size.
Returns
Section titled “Returns”Promise<HistoryEvent[]>
All history events for the execution, in chronological order.
Example
Section titled “Example”import { SFNClient } from '@aws-sdk/client-sfn';import { fetchExecutionHistory } from 'sfn-diagram/aws';import { generateExecution } from 'sfn-diagram';
const client = new SFNClient({ region: 'us-east-1' });const events = await fetchExecutionHistory({ client, executionArn });const { svg } = generateExecution({ aslDefinition: asl, history: events });