Skip to content

Commit 1fd99e3

Browse files
committed
hitl fallback case
1 parent 384062e commit 1fd99e3

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,17 @@ function updateResumeOutputInAggregationBuffers(
6464
if (!isRecord(scope) || !isRecord(scope.currentIterationOutputs)) continue
6565

6666
const outputs = scope.currentIterationOutputs
67-
if (outputs[stateBlockKey] !== undefined || outputs[pauseBlockId] !== undefined) {
68-
delete outputs[pauseBlockId]
67+
const pausedEntry =
68+
outputs[stateBlockKey] !== undefined
69+
? stateBlockKey
70+
: outputs[pauseBlockId] !== undefined
71+
? pauseBlockId
72+
: undefined
73+
74+
if (pausedEntry !== undefined && isPausedOutputForContext(outputs[pausedEntry], contextId)) {
75+
if (pausedEntry !== stateBlockKey) {
76+
delete outputs[pausedEntry]
77+
}
6978
outputs[stateBlockKey] = mergedOutput
7079
}
7180
}

0 commit comments

Comments
 (0)