feat(logs): added block output to db

This commit is contained in:
Emir Karabeg
2025-03-05 17:50:57 -08:00
parent 3810db2b03
commit 8851beea1b
+3 -3
View File
@@ -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(),
}))