mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user