feat(core): Enable modules to append to workflow context (#18551)

This commit is contained in:
Iván Ovejero
2025-08-25 11:45:25 +02:00
committed by GitHub
parent fb97ec876c
commit 0488ea3e8d
5 changed files with 105 additions and 3 deletions

View File

@@ -384,7 +384,7 @@ export async function getBase(
)
: undefined;
return {
const additionalData: IWorkflowExecuteAdditionalData = {
dataStoreProxyProvider,
currentNodeExecutionIndex: 0,
credentialsHelper: Container.get(CredentialsHelper),
@@ -450,4 +450,12 @@ export async function getBase(
logAiEvent: (eventName: keyof AiEventMap, payload: AiEventPayload) =>
eventService.emit(eventName, payload),
};
for (const [moduleName, moduleContext] of Container.get(ModuleRegistry).context.entries()) {
// @ts-expect-error Adding an index signature `[key: string]: unknown`
// to `IWorkflowExecuteAdditionalData` triggers complex type errors for derived types.
additionalData[moduleName] = moduleContext;
}
return additionalData;
}