refactor(trigger): Unify the Trigger Debug interface and event handling and enhance error management

- Updated `DraftWorkflowTriggerNodeApi` to utilize the new `TriggerDebugEvent` and `TriggerDebugEventPoller` for improved event polling.
- Removed deprecated `poll_debug_event` methods from `TriggerService`, `ScheduleService`, and `WebhookService`, consolidating functionality into the new event structure.
- Enhanced error handling in `invoke_trigger_event` to utilize `TriggerPluginInvokeError` for better clarity on invocation issues.
- Updated frontend API routes to reflect changes in trigger event handling, ensuring consistency across the application.
This commit is contained in:
Harry
2025-10-15 14:41:53 +08:00
parent dab4e521af
commit 06c91fbcbd
23 changed files with 622 additions and 753 deletions

View File

@ -6,7 +6,7 @@ from core.workflow.enums import ErrorStrategy
from core.workflow.nodes.base.entities import BaseNodeData, RetryConfig
class PluginTriggerData(BaseNodeData):
class PluginTriggerNodeData(BaseNodeData):
"""Plugin trigger node data"""
title: str

View File

@ -7,17 +7,17 @@ from core.workflow.node_events import NodeRunResult
from core.workflow.nodes.base.entities import BaseNodeData, RetryConfig
from core.workflow.nodes.base.node import Node
from .entities import PluginTriggerData
from .entities import PluginTriggerNodeData
class TriggerPluginNode(Node):
node_type = NodeType.TRIGGER_PLUGIN
execution_type = NodeExecutionType.ROOT
_node_data: PluginTriggerData
_node_data: PluginTriggerNodeData
def init_node_data(self, data: Mapping[str, Any]) -> None:
self._node_data = PluginTriggerData.model_validate(data)
self._node_data = PluginTriggerNodeData.model_validate(data)
def _get_error_strategy(self) -> Optional[ErrorStrategy]:
return self._node_data.error_strategy