@@ -28,6 +28,7 @@ import { createLightweightSummary } from './utils/component-output';
2828import { buildActionPayload } from './input-resolver' ;
2929import { isComponentFailure , extractFailureMessage } from './workflows/workflow-helpers' ;
3030import type { ArtifactServiceFactory } from './artifact-factory' ;
31+ import { workflowDiagnosticLog } from './workflow-diagnostics' ;
3132
3233export interface ExecuteWorkflowOptions {
3334 runId ?: string ;
@@ -52,9 +53,9 @@ export async function executeWorkflow(
5253 options : ExecuteWorkflowOptions = { } ,
5354) : Promise < WorkflowRunResult > {
5455 const runId = options . runId ?? randomUUID ( ) ;
55- console . log ( `🏃 [WORKFLOW RUNNER] executeWorkflow called for runId: ${ runId } ` ) ;
56- console . log ( `📋 [WORKFLOW RUNNER] Definition has ${ definition . actions . length } actions` ) ;
57- console . log ( `📋 [WORKFLOW RUNNER] Entrypoint ref: ${ definition . entrypoint . ref } ` ) ;
56+ workflowDiagnosticLog ( `🏃 [WORKFLOW RUNNER] executeWorkflow called for runId: ${ runId } ` ) ;
57+ workflowDiagnosticLog ( `📋 [WORKFLOW RUNNER] Definition has ${ definition . actions . length } actions` ) ;
58+ workflowDiagnosticLog ( `📋 [WORKFLOW RUNNER] Entrypoint ref: ${ definition . entrypoint . ref } ` ) ;
5859
5960 const results = new Map < string , unknown > ( ) ;
6061 const actionsByRef = new Map < string , ( typeof definition . actions ) [ number ] > (
@@ -85,7 +86,7 @@ export async function executeWorkflow(
8586 actionRef : string ,
8687 schedulerContext : WorkflowSchedulerRunContext ,
8788 ) : Promise < { activePorts ?: string [ ] | undefined } | null > => {
88- console . log (
89+ workflowDiagnosticLog (
8990 `🎯 [WORKFLOW RUNNER] runAction called for: ${ actionRef } (triggered by: ${ schedulerContext . triggeredBy || 'root' } )` ,
9091 ) ;
9192
@@ -242,7 +243,7 @@ export async function executeWorkflow(
242243 if ( isEntrypointRef && request . inputs ) {
243244 // Only apply inputs to the actual entrypoint component, not just any node matching the entrypoint ref
244245 if ( isEntrypointComponent ) {
245- console . log (
246+ workflowDiagnosticLog (
246247 `[WorkflowRunner] Applying inputs to entrypoint component '${ action . ref } ' (${ action . componentId } )` ,
247248 ) ;
248249 inputs . __runtimeData = request . inputs ;
@@ -311,14 +312,14 @@ export async function executeWorkflow(
311312 } ) ;
312313
313314 try {
314- console . log (
315+ workflowDiagnosticLog (
315316 `⚡️ [WORKFLOW RUNNER] Executing component: ${ action . componentId } for action: ${ actionRef } ` ,
316317 ) ;
317318 const rawOutput = await component . execute (
318319 { inputs : parsedInputs , params : parsedParams } ,
319320 context ,
320321 ) ;
321- console . log (
322+ workflowDiagnosticLog (
322323 `✅ [WORKFLOW RUNNER] Component execution completed: ${ action . componentId } for action: ${ actionRef } ` ,
323324 ) ;
324325 let output = component . outputs . parse ( rawOutput ) ;
@@ -351,7 +352,7 @@ export async function executeWorkflow(
351352 }
352353 }
353354 results . set ( action . ref , output ) ;
354- console . log ( `💾 [WORKFLOW RUNNER] Result stored for: ${ actionRef } ` ) ;
355+ workflowDiagnosticLog ( `💾 [WORKFLOW RUNNER] Result stored for: ${ actionRef } ` ) ;
355356 // Record node I/O completion
356357 await options . nodeIO ?. recordCompletion ( {
357358 runId,
@@ -460,8 +461,8 @@ export async function executeWorkflow(
460461 run : runAction ,
461462 } ) ;
462463
463- console . log ( `📊 [WORKFLOW RUNNER] runWorkflowWithScheduler completed for ${ runId } ` ) ;
464- console . log ( `📊 [WORKFLOW RUNNER] Total results stored: ${ results . size } ` ) ;
464+ workflowDiagnosticLog ( `📊 [WORKFLOW RUNNER] runWorkflowWithScheduler completed for ${ runId } ` ) ;
465+ workflowDiagnosticLog ( `📊 [WORKFLOW RUNNER] Total results stored: ${ results . size } ` ) ;
465466
466467 const outputsObject : Record < string , unknown > = { } ;
467468 let reportedFailure = false ;
@@ -476,8 +477,10 @@ export async function executeWorkflow(
476477 }
477478 } ) ;
478479
479- console . log ( `📊 [WORKFLOW RUNNER] Output keys: ${ Object . keys ( outputsObject ) . join ( ', ' ) } ` ) ;
480- console . log ( `📊 [WORKFLOW RUNNER] Reported failure: ${ reportedFailure } ` ) ;
480+ workflowDiagnosticLog (
481+ `📊 [WORKFLOW RUNNER] Output keys: ${ Object . keys ( outputsObject ) . join ( ', ' ) } ` ,
482+ ) ;
483+ workflowDiagnosticLog ( `📊 [WORKFLOW RUNNER] Reported failure: ${ reportedFailure } ` ) ;
481484
482485 if ( reportedFailure ) {
483486 const baseMessage = 'One or more workflow actions failed' ;
@@ -492,7 +495,7 @@ export async function executeWorkflow(
492495 } ;
493496 }
494497
495- console . log ( `✅ [WORKFLOW RUNNER] Workflow completed successfully for ${ runId } ` ) ;
498+ workflowDiagnosticLog ( `✅ [WORKFLOW RUNNER] Workflow completed successfully for ${ runId } ` ) ;
496499 return { outputs : outputsObject , success : true } ;
497500 } catch ( error : unknown ) {
498501 console . error ( `❌ [WORKFLOW RUNNER] Workflow threw exception for ${ runId } :` , error ) ;
0 commit comments