diff --git a/packages/plugins/@nocobase/plugin-workflow/src/server/triggers/CollectionTrigger.ts b/packages/plugins/@nocobase/plugin-workflow/src/server/triggers/CollectionTrigger.ts index bbeb82313..1faa2a0bc 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/server/triggers/CollectionTrigger.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/server/triggers/CollectionTrigger.ts @@ -85,17 +85,23 @@ async function handler(this: CollectionTrigger, workflow: WorkflowModel, data: M // TODO: `result.toJSON()` throws error const json = toJSON(result); - const promise = this.workflow.trigger( - workflow, - { data: json }, - { - context, - transaction, - }, - ); - if (workflow.sync) { - await promise; + await this.workflow.trigger( + workflow, + { data: json }, + { + context, + transaction, + }, + ); + } else { + this.workflow.trigger( + workflow, + { data: json }, + { + context, + }, + ); } }