improvement(preview): nested workflow snapshots/preview when not executed

This commit is contained in:
Vikhyath Mondreti
2026-02-06 10:14:41 -08:00
parent ed5ed97c07
commit 8a10e9fc93

View File

@@ -31,6 +31,7 @@ interface BlockExecutionData {
/** Child trace spans for nested workflow blocks */
children?: TraceSpan[]
childWorkflowSnapshotId?: string
childWorkflowName?: string
}
/** Represents a level in the workflow navigation stack */
@@ -87,6 +88,7 @@ export function buildBlockExecutions(spans: TraceSpan[]): Record<string, BlockEx
for (const span of allBlockSpans) {
if (span.blockId && !blockExecutionMap[span.blockId]) {
const output = span.output as Record<string, unknown> | undefined
blockExecutionMap[span.blockId] = {
input: redactApiKeys(span.input || {}),
output: redactApiKeys(span.output || {}),
@@ -94,6 +96,8 @@ export function buildBlockExecutions(spans: TraceSpan[]): Record<string, BlockEx
durationMs: span.duration || 0,
children: span.children,
childWorkflowSnapshotId: span.childWorkflowSnapshotId,
childWorkflowName:
typeof output?.childWorkflowName === 'string' ? output.childWorkflowName : undefined,
}
}
}
@@ -192,7 +196,7 @@ export function Preview({
const childTraceSpans = extractChildTraceSpans(blockExecution)
const childBlockExecutions = buildBlockExecutions(childTraceSpans)
const workflowName = childWorkflowState.metadata?.name || 'Nested Workflow'
const workflowName = blockExecution?.childWorkflowName || 'Nested Workflow'
setWorkflowStack((prev) => [
...prev,