fix nested subflow error highlighting

This commit is contained in:
Vikhyath Mondreti
2026-02-05 15:08:31 -08:00
parent 9f1f77e2fb
commit 9f25a4893e
2 changed files with 16 additions and 1 deletions

View File

@@ -491,6 +491,13 @@ export function useWorkflowExecution() {
updateActiveBlocks(data.blockId, false)
setBlockRunStatus(data.blockId, 'error')
executedBlockIds.add(data.blockId)
accumulatedBlockStates.set(data.blockId, {
output: { error: data.error },
executed: true,
executionTime: data.durationMs || 0,
})
accumulatedBlockLogs.push(
createBlockLogEntry(data, { success: false, output: {}, error: data.error })
)

View File

@@ -349,7 +349,15 @@ export function PreviewWorkflow({
if (block.type === 'loop' || block.type === 'parallel') {
const isSelected = selectedBlockId === blockId
const dimensions = calculateContainerDimensions(blockId, workflowState.blocks)
const subflowExecutionStatus = getSubflowExecutionStatus(blockId)
// Check for direct error on the subflow block itself (e.g., loop resolution errors)
// before falling back to children-derived status
const directExecution = blockExecutionMap.get(blockId)
const subflowExecutionStatus: ExecutionStatus | undefined =
directExecution?.status === 'error'
? 'error'
: (getSubflowExecutionStatus(blockId) ??
(directExecution ? (directExecution.status as ExecutionStatus) : undefined))
nodeArray.push({
id: blockId,