triggerFound = false; } public function visitNode(Workflow $workflow, WorkflowNode $node): void { if ($node->getStep()->getType() === Step::TYPE_TRIGGER) { $this->triggerFound = true; } } public function complete(Workflow $workflow): void { if ($this->triggerFound) { return; } throw Exceptions::workflowStructureNotValid(__('There must be at least one trigger in the automation.', 'mailpoet'), self::RULE_ID); } }