From ad7fb6e57554075d17599b31b6ca45cc361de134 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Sat, 24 Jan 2026 02:14:46 -0800 Subject: [PATCH 1/3] Fix hitl --- .../handlers/condition/condition-handler.ts | 14 +++++++++- .../executor/human-in-the-loop-manager.ts | 26 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/apps/sim/executor/handlers/condition/condition-handler.ts b/apps/sim/executor/handlers/condition/condition-handler.ts index 2954b06d89..6039562f63 100644 --- a/apps/sim/executor/handlers/condition/condition-handler.ts +++ b/apps/sim/executor/handlers/condition/condition-handler.ts @@ -85,7 +85,11 @@ export class ConditionBlockHandler implements BlockHandler { const sourceBlockId = ctx.workflow?.connections.find((conn) => conn.target === block.id)?.source const evalContext = this.buildEvaluationContext(ctx, sourceBlockId) - const sourceOutput = sourceBlockId ? ctx.blockStates.get(sourceBlockId)?.output : null + const rawSourceOutput = sourceBlockId ? ctx.blockStates.get(sourceBlockId)?.output : null + + // Filter out _pauseMetadata from source output to prevent the engine from + // thinking this block is pausing (it was already resumed by the HITL block) + const sourceOutput = this.filterPauseMetadata(rawSourceOutput) const outgoingConnections = ctx.workflow?.connections.filter((conn) => conn.source === block.id) @@ -125,6 +129,14 @@ export class ConditionBlockHandler implements BlockHandler { } } + private filterPauseMetadata(output: any): any { + if (!output || typeof output !== 'object') { + return output + } + const { _pauseMetadata, ...rest } = output + return rest + } + private parseConditions(input: any): Array<{ id: string; title: string; value: string }> { try { const conditions = Array.isArray(input) ? input : JSON.parse(input || '[]') diff --git a/apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts b/apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts index 936f7cd298..fe936920e5 100644 --- a/apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts +++ b/apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts @@ -567,6 +567,32 @@ export class PauseResumeManager { stateCopy.blockStates[stateBlockKey] = pauseBlockState + // Update the block log entry with the merged output so logs show the submission data + if (Array.isArray(stateCopy.blockLogs)) { + const blockLogIndex = stateCopy.blockLogs.findIndex( + (log: { blockId: string }) => + log.blockId === stateBlockKey || + log.blockId === pauseBlockId || + log.blockId === contextId + ) + if (blockLogIndex !== -1) { + // Filter output for logging (exclude internal fields and response) + const filteredOutput: Record = {} + for (const [key, value] of Object.entries(mergedOutput)) { + if (key.startsWith('_')) continue + if (key === 'response') continue + filteredOutput[key] = value + } + stateCopy.blockLogs[blockLogIndex] = { + ...stateCopy.blockLogs[blockLogIndex], + blockId: stateBlockKey, + output: filteredOutput, + durationMs: pauseDurationMs, + endedAt: new Date().toISOString(), + } + } + } + if (Array.isArray(stateCopy.executedBlocks)) { const filtered = stateCopy.executedBlocks.filter( (id: string) => id !== pauseBlockId && id !== contextId From 8a0156a578e767d26844e9f819c6519b1a40f3d4 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Sat, 24 Jan 2026 02:15:09 -0800 Subject: [PATCH 2/3] Fix lint --- .../components/deploy/components/deploy-modal/deploy-modal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx index e90fbee6bd..c011207e8a 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx @@ -496,7 +496,7 @@ export function DeployModal({ )} {apiDeployWarnings.length > 0 && ( -
+
Deployment Warning
{apiDeployWarnings.map((warning, index) => (
{warning}
From e4835817ee0ed6aab5326430c87124547c94ee09 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Sat, 24 Jan 2026 02:16:52 -0800 Subject: [PATCH 3/3] Reset --- .../components/deploy/components/deploy-modal/deploy-modal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx index c011207e8a..e90fbee6bd 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx @@ -496,7 +496,7 @@ export function DeployModal({
)} {apiDeployWarnings.length > 0 && ( -
+
Deployment Warning
{apiDeployWarnings.map((warning, index) => (
{warning}