fix(core): Ensure that 'workflow-post-execute' event has userId whenever it's available (#13326)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-02-18 10:23:57 +01:00
committed by GitHub
parent e3b7243377
commit f41e353887
4 changed files with 49 additions and 63 deletions

View File

@@ -345,14 +345,7 @@ export class WorkflowRunner {
try {
job = await this.scalingService.addJob(jobData, { priority: realtime ? 50 : 100 });
lifecycleHooks = getLifecycleHooksForScalingMain(
data.executionMode,
executionId,
data.workflowData,
{
retryOf: data.retryOf ?? undefined,
},
);
lifecycleHooks = getLifecycleHooksForScalingMain(data, executionId);
// Normally also workflow should be supplied here but as it only used for sending
// data to editor-UI is not needed.
@@ -360,12 +353,7 @@ export class WorkflowRunner {
} catch (error) {
// We use "getLifecycleHooksForScalingWorker" as "getLifecycleHooksForScalingMain" does not contain the
// "workflowExecuteAfter" which we require.
const lifecycleHooks = getLifecycleHooksForScalingWorker(
data.executionMode,
executionId,
data.workflowData,
{ retryOf: data.retryOf ?? undefined },
);
const lifecycleHooks = getLifecycleHooksForScalingWorker(data, executionId);
await this.processError(error, new Date(), data.executionMode, executionId, lifecycleHooks);
throw error;
}
@@ -378,13 +366,7 @@ export class WorkflowRunner {
// We use "getLifecycleHooksForScalingWorker" as "getLifecycleHooksForScalingMain" does not contain the
// "workflowExecuteAfter" which we require.
const lifecycleHooks = getLifecycleHooksForScalingWorker(
data.executionMode,
executionId,
data.workflowData,
{ retryOf: data.retryOf ?? undefined },
);
const lifecycleHooks = getLifecycleHooksForScalingWorker(data, executionId);
const error = new ExecutionCancelledError(executionId);
await this.processError(
error,
@@ -409,12 +391,7 @@ export class WorkflowRunner {
// We use "getLifecycleHooksForScalingWorker" as "getLifecycleHooksForScalingMain" does not contain the
// "workflowExecuteAfter" which we require.
const lifecycleHooks = getLifecycleHooksForScalingWorker(
data.executionMode,
executionId,
data.workflowData,
{ retryOf: data.retryOf ?? undefined },
);
const lifecycleHooks = getLifecycleHooksForScalingWorker(data, executionId);
await this.processError(
error,