fix(preview): show actual nested workflow name in log snapshots (#3689)

* fix(preview): show actual nested workflow name in log snapshots

* fix(preview): ensure metadata.name in non-deployed child workflow path

* style(preview): fix line formatting
This commit is contained in:
Waleed
2026-03-19 23:42:51 -07:00
committed by GitHub
parent 0be9303345
commit 1eb85dd66f
2 changed files with 14 additions and 2 deletions

View File

@@ -197,7 +197,10 @@ export function Preview({
const childTraceSpans = extractChildTraceSpans(blockExecution)
const childBlockExecutions = buildBlockExecutions(childTraceSpans)
const workflowName = childWorkflowState.metadata?.name || 'Nested Workflow'
const workflowName =
childWorkflowState.metadata?.name ||
(blockExecution?.output as { childWorkflowName?: string } | undefined)?.childWorkflowName ||
'Nested Workflow'
setWorkflowStack((prev) => [
...prev,

View File

@@ -363,6 +363,10 @@ export class WorkflowBlockHandler implements BlockHandler {
const workflowStateWithVariables = {
...workflowState,
variables: workflowVariables,
metadata: {
...(workflowState.metadata || {}),
name: workflowData.name || DEFAULTS.WORKFLOW_NAME,
},
}
if (Object.keys(workflowVariables).length > 0) {
@@ -444,13 +448,18 @@ export class WorkflowBlockHandler implements BlockHandler {
)
const workflowVariables = (wfData?.variables as Record<string, any>) || {}
const childName = wfData?.name || DEFAULTS.WORKFLOW_NAME
const workflowStateWithVariables = {
...deployedState,
variables: workflowVariables,
metadata: {
...(deployedState.metadata || {}),
name: childName,
},
}
return {
name: wfData?.name || DEFAULTS.WORKFLOW_NAME,
name: childName,
serializedState: serializedWorkflow,
variables: workflowVariables,
workflowState: workflowStateWithVariables,