diff --git a/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts b/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts index 19bccbe8f..28723b0c2 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts @@ -235,6 +235,10 @@ export default class WorkflowPlugin extends Plugin { toggle(workflow: WorkflowModel, enable?: boolean) { const type = workflow.get('type'); const trigger = this.triggers.get(type); + if (!trigger) { + this.getLogger(workflow.id).error(`trigger type ${workflow.type} of workflow ${workflow.id} is not implemented`); + return; + } if (typeof enable !== 'undefined' ? enable : workflow.get('enabled')) { // NOTE: remove previous listener if config updated const prev = workflow.previous();