diff --git a/packages/plugins/@nocobase/plugin-workflow/src/server/Processor.ts b/packages/plugins/@nocobase/plugin-workflow/src/server/Processor.ts index 3c09be7678..40a2403133 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/server/Processor.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/server/Processor.ts @@ -112,14 +112,16 @@ export default class Processor { execution, options: { plugin }, } = this; - if (!execution.workflow) { - execution.workflow = plugin.enabledCache.get(execution.workflowId); - } this.mainTransaction = plugin.useDataSourceTransaction('main', this.transaction); const transaction = this.mainTransaction; + if (!execution.workflow) { + execution.workflow = + plugin.enabledCache.get(execution.workflowId) || (await execution.getWorkflow({ transaction })); + } + const nodes = await execution.workflow.getNodes({ transaction }); this.makeNodes(nodes);