Skip to content

Commit b71153b

Browse files
hydrate block state on server side output
1 parent 9ae6209 commit b71153b

File tree

3 files changed

+28
-17
lines changed

3 files changed

+28
-17
lines changed

apps/sim/executor/execution/block-executor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ export class BlockExecutor {
110110
}
111111

112112
resolvedInputs = this.resolver.resolveInputs(ctx, node.id, block.config.params, block)
113-
resolvedInputs = await hydrateCacheReferences(resolvedInputs)
114113

115114
if (blockLog) {
116115
blockLog.input = this.sanitizeInputsForLog(resolvedInputs)
@@ -169,6 +168,10 @@ export class BlockExecutor {
169168
})) as NormalizedBlockOutput
170169
}
171170

171+
normalizedOutput = (await hydrateCacheReferences(
172+
normalizedOutput as Record<string, unknown>
173+
)) as NormalizedBlockOutput
174+
172175
const duration = performance.now() - startTime
173176

174177
if (blockLog) {

apps/sim/lib/workflows/executor/queued-workflow-execution.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,11 @@ export async function executeQueuedWorkflowJob(
330330
await eventWriter.close()
331331
}
332332

333-
await Promise.allSettled([
334-
cleanupExecutionBase64Cache(executionId),
335-
cleanupPaginatedCache(executionId),
336-
])
333+
void cleanupExecutionBase64Cache(executionId).catch((error) => {
334+
logger.error('Failed to cleanup base64 cache', { executionId, error })
335+
})
336+
void cleanupPaginatedCache(executionId).catch((error) => {
337+
logger.error('Failed to cleanup paginated cache', { executionId, error })
338+
})
337339
}
338340
}

apps/sim/lib/workflows/streaming/streaming.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,12 @@ export async function createStreamingResponse(
348348
controller.enqueue(encodeSSE('[DONE]'))
349349

350350
if (executionId) {
351-
await Promise.allSettled([
352-
cleanupExecutionBase64Cache(executionId),
353-
cleanupPaginatedCache(executionId),
354-
])
351+
void cleanupExecutionBase64Cache(executionId).catch((error) => {
352+
logger.error('Failed to cleanup base64 cache', { executionId, error })
353+
})
354+
void cleanupPaginatedCache(executionId).catch((error) => {
355+
logger.error('Failed to cleanup paginated cache', { executionId, error })
356+
})
355357
}
356358

357359
controller.close()
@@ -362,10 +364,12 @@ export async function createStreamingResponse(
362364
)
363365

364366
if (executionId) {
365-
await Promise.allSettled([
366-
cleanupExecutionBase64Cache(executionId),
367-
cleanupPaginatedCache(executionId),
368-
])
367+
void cleanupExecutionBase64Cache(executionId).catch((error) => {
368+
logger.error('Failed to cleanup base64 cache', { executionId, error })
369+
})
370+
void cleanupPaginatedCache(executionId).catch((error) => {
371+
logger.error('Failed to cleanup paginated cache', { executionId, error })
372+
})
369373
}
370374

371375
controller.close()
@@ -378,10 +382,12 @@ export async function createStreamingResponse(
378382
timeoutController.abort()
379383
timeoutController.cleanup()
380384
if (executionId) {
381-
await Promise.allSettled([
382-
cleanupExecutionBase64Cache(executionId),
383-
cleanupPaginatedCache(executionId),
384-
])
385+
void cleanupExecutionBase64Cache(executionId).catch((error) => {
386+
logger.error('Failed to cleanup base64 cache', { executionId, error })
387+
})
388+
void cleanupPaginatedCache(executionId).catch((error) => {
389+
logger.error('Failed to cleanup paginated cache', { executionId, error })
390+
})
385391
}
386392
},
387393
})

0 commit comments

Comments
 (0)