(
actionRef: string,
schedulerContext: WorkflowSchedulerRunContext,
)
| 81 | |
| 82 | try { |
| 83 | const runAction = async ( |
| 84 | actionRef: string, |
| 85 | schedulerContext: WorkflowSchedulerRunContext, |
| 86 | ): Promise<{ activePorts?: string[] | undefined } | null> => { |
| 87 | console.log( |
| 88 | `🎯 [WORKFLOW RUNNER] runAction called for: ${actionRef} (triggered by: ${schedulerContext.triggeredBy || 'root'})`, |
| 89 | ); |
| 90 | |
| 91 | const action = actionsByRef.get(actionRef); |
| 92 | if (!action) { |
| 93 | throw new NotFoundError(`Action not found: ${actionRef}`, { |
| 94 | resourceType: 'action', |
| 95 | resourceId: actionRef, |
| 96 | details: { runId }, |
| 97 | }); |
| 98 | } |
| 99 | |
| 100 | const { triggeredBy, failure } = schedulerContext; |
| 101 | |
| 102 | const entry = componentRegistry.getMetadata(action.componentId); |
| 103 | if (!entry) { |
| 104 | throw new NotFoundError(`Component not registered: ${action.componentId}`, { |
| 105 | resourceType: 'component', |
| 106 | resourceId: action.componentId, |
| 107 | details: { actionRef, runId }, |
| 108 | }); |
| 109 | } |
| 110 | const component = entry.definition; |
| 111 | const inputPorts = entry.inputs ?? []; |
| 112 | const outputPorts = entry.outputs ?? []; |
| 113 | |
| 114 | const nodeMetadata = definition.nodes?.[action.ref]; |
| 115 | const streamId = nodeMetadata?.streamId ?? nodeMetadata?.groupId ?? action.ref; |
| 116 | const joinStrategy = nodeMetadata?.joinStrategy ?? schedulerContext.joinStrategy; |
| 117 | |
| 118 | // Record trace event |
| 119 | options.trace?.record({ |
| 120 | type: 'NODE_STARTED', |
| 121 | runId, |
| 122 | nodeRef: action.ref, |
| 123 | timestamp: new Date().toISOString(), |
| 124 | level: 'info', |
| 125 | context: { |
| 126 | runId, |
| 127 | componentRef: action.ref, |
| 128 | streamId, |
| 129 | joinStrategy, |
| 130 | triggeredBy, |
| 131 | failure, |
| 132 | }, |
| 133 | }); |
| 134 | |
| 135 | const { inputs, params, warnings, manualOverrides } = buildActionPayload(action, results, { |
| 136 | componentMetadata: { inputs: inputPorts }, |
| 137 | }); |
| 138 | |
| 139 | for (const override of manualOverrides) { |
| 140 | options.trace?.record({ |
nothing calls this directly
no test coverage detected