convertRecordingToFlow function exported

Last updated: 2026-03-05T10:53:28.863Z

Metrics

LOC: 27 Complexity: 3 Params: 3

Signature

convertRecordingToFlow( session: RecordingSession, options: ConvertOptions = {}, ): : FlowScript

Summary

Convert a RecordingSession into a FlowScript. Filters out steps that cannot be mapped and computes timing deltas from the original timestamps.

Source Code

export function convertRecordingToFlow(
  session: RecordingSession,
  options: ConvertOptions = {},
): FlowScript {
  _resetIdCounter();

  const steps = convertSteps(session.steps);

  const now = Date.now();
  const metadata: FlowMetadata = {
    name: options.name ?? "Recorded Flow",
    description: options.description,
    baseUrl: session.startUrl,
    seed: options.seed ?? generateRandomSeed(),
    createdAt: now,
    updatedAt: now,
    version: FLOW_SCRIPT_VERSION,
    tags: options.tags,
  };

  return {
    id: generateFlowId(),
    metadata,
    replayConfig: { ...DEFAULT_REPLAY_CONFIG },
    steps,
  };
}

Dependencies (Outgoing)

graph LR convertRecordingToFlow["convertRecordingToFlow"] _resetIdCounter["_resetIdCounter"] convertSteps["convertSteps"] generateRandomSeed["generateRandomSeed"] generateFlowId["generateFlowId"] convertRecordingToFlow -->|calls| _resetIdCounter convertRecordingToFlow -->|calls| convertSteps convertRecordingToFlow -->|calls| generateRandomSeed convertRecordingToFlow -->|calls| generateFlowId style convertRecordingToFlow fill:#dbeafe,stroke:#2563eb,stroke-width:2px click convertRecordingToFlow "757a5ffbc62eadcc.html" click _resetIdCounter "66adb029029661b7.html" click convertSteps "9420198414a645f6.html" click generateRandomSeed "5413ae835026dc30.html" click generateFlowId "1cb137866728c1e8.html"
TargetType
_resetIdCounter calls
convertSteps calls
generateRandomSeed calls
generateFlowId calls

Impact (Incoming)

graph LR convertRecordingToFlow["convertRecordingToFlow"] handle["handle"] makeSession["makeSession"] handle -->|uses| convertRecordingToFlow makeSession -->|uses| convertRecordingToFlow style convertRecordingToFlow fill:#dbeafe,stroke:#2563eb,stroke-width:2px click convertRecordingToFlow "757a5ffbc62eadcc.html" click handle "3b3925f07e1ac5c3.html" click makeSession "5a9b47b0cc679d94.html"
SourceType
handle uses
makeSession uses