Skip to content

Commit 53cf1b8

Browse files
committed
fix(preview): show actual nested workflow name in log snapshots
1 parent fa181f0 commit 53cf1b8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

apps/sim/app/workspace/[workspaceId]/w/components/preview/preview.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ export function Preview({
197197
const childTraceSpans = extractChildTraceSpans(blockExecution)
198198
const childBlockExecutions = buildBlockExecutions(childTraceSpans)
199199

200-
const workflowName = childWorkflowState.metadata?.name || 'Nested Workflow'
200+
const workflowName =
201+
childWorkflowState.metadata?.name ||
202+
(blockExecution?.output as { childWorkflowName?: string } | undefined)
203+
?.childWorkflowName ||
204+
'Nested Workflow'
201205

202206
setWorkflowStack((prev) => [
203207
...prev,

apps/sim/executor/handlers/workflow/workflow-handler.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,18 @@ export class WorkflowBlockHandler implements BlockHandler {
444444
)
445445

446446
const workflowVariables = (wfData?.variables as Record<string, any>) || {}
447+
const childName = wfData?.name || DEFAULTS.WORKFLOW_NAME
447448
const workflowStateWithVariables = {
448449
...deployedState,
449450
variables: workflowVariables,
451+
metadata: {
452+
...(deployedState.metadata || {}),
453+
name: childName,
454+
},
450455
}
451456

452457
return {
453-
name: wfData?.name || DEFAULTS.WORKFLOW_NAME,
458+
name: childName,
454459
serializedState: serializedWorkflow,
455460
variables: workflowVariables,
456461
workflowState: workflowStateWithVariables,

0 commit comments

Comments
 (0)