From 8851beea1b6d95fec5c967f83cf15cd09dbd533a Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Wed, 5 Mar 2025 17:50:57 -0800 Subject: [PATCH] feat(logs): added block output to db --- app/w/[id]/hooks/use-workflow-execution.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/w/[id]/hooks/use-workflow-execution.ts b/app/w/[id]/hooks/use-workflow-execution.ts index c054e09035..5be5fecfdd 100644 --- a/app/w/[id]/hooks/use-workflow-execution.ts +++ b/app/w/[id]/hooks/use-workflow-execution.ts @@ -150,9 +150,9 @@ export function useWorkflowExecution() { // Prepare logs for persistence (moved after notification) const blockLogs = (result.logs || []).map((log) => ({ level: log.success ? 'info' : 'error', - message: `Block ${log.blockName || log.blockId} (${log.blockType}): ${ - log.error || 'Completed successfully' - }`, + message: log.success + ? `Block ${log.blockName || log.blockId} (${log.blockType}): ${JSON.stringify(log.output?.response || {})}` + : `Block ${log.blockName || log.blockId} (${log.blockType}): ${log.error || 'Failed'}`, duration: log.success ? `${log.durationMs}ms` : 'NA', createdAt: new Date(log.endedAt || log.startedAt).toISOString(), }))