fix(core): Reload static data for queued executions (#39668)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
Mayank SIngh 2026-10-05 21:31:11 +00:00 committed by GitHub
parent 0280644e77
commit 439e8ba2e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 1 deletions

View File

@ -746,6 +746,35 @@ describe('processError', () => {
});
describe('run', () => {
it('reloads static data for a new queued execution', async () => {
globalConfig.executions.mode = 'queue';
try {
vi.spyOn(runner, 'establishContextForPersistence').mockResolvedValue(undefined);
vi.spyOn(runner, 'prepareNewExecution').mockResolvedValue(mock<Workflow>());
vi.spyOn(Container.get(CredentialsPermissionChecker), 'check').mockResolvedValueOnce();
vi.spyOn(Container.get(ActiveExecutions), 'add').mockResolvedValue('1');
const enqueueExecution = vi.spyOn(runner, 'enqueueExecution').mockResolvedValue();
const data = mock<IWorkflowExecutionDataProcess>({
executionMode: 'trigger',
workflowData: { id: 'workflow-id', nodes: [], staticData: {} },
});
await runner.run(data, true);
expect(enqueueExecution).toHaveBeenCalledWith(
'1',
'workflow-id',
data,
true,
undefined,
undefined,
);
} finally {
globalConfig.executions.mode = 'regular';
}
});
it('uses recreateNodeExecutionStack to create a partial execution if a triggerToStartFrom with data is sent', async () => {
// ARRANGE
const activeExecutions = Container.get(ActiveExecutions);

View File

@ -469,7 +469,7 @@ export class WorkflowRunner {
executionId,
workflowId,
data,
shouldReloadStaticData,
loadStaticData,
realtime,
existingExecution?.executionId,
);