refactor: streamline trigger event node metadata handling and update async workflow service for JSON serialization

- Removed unnecessary input data from the TriggerEventNode's metadata.
- Updated AsyncWorkflowService to use model_dump_json() for trigger metadata serialization.
- Added a comment in WorkflowAppService to address the large size of the workflow_app_log table and the use of an additional details field.
This commit is contained in:
Harry
2025-10-28 13:54:44 +08:00
parent db352c0a18
commit 0d686fc6ae
9 changed files with 125 additions and 5 deletions

View File

@ -19,6 +19,12 @@ class AsyncTriggerStatus(StrEnum):
TIMEOUT = "timeout"
class TriggerMetadata(BaseModel):
"""Trigger metadata"""
pass
class TriggerData(BaseModel):
"""Base trigger data model for async workflow execution"""
@ -30,6 +36,7 @@ class TriggerData(BaseModel):
files: Sequence[Mapping[str, Any]] = Field(default_factory=list)
trigger_type: AppTriggerType
trigger_from: WorkflowRunTriggeredFrom
trigger_metadata: TriggerMetadata = Field(default_factory=TriggerMetadata)
model_config = ConfigDict(use_enum_values=True)
@ -48,6 +55,17 @@ class ScheduleTriggerData(TriggerData):
trigger_from: WorkflowRunTriggeredFrom = WorkflowRunTriggeredFrom.SCHEDULE
class PluginTriggerMetadata(TriggerMetadata):
"""Plugin trigger metadata"""
plugin_id: str
endpoint_id: str
plugin_unique_identifier: str
provider_id: str
icon_url: str
icon_dark_url: str
class PluginTriggerData(TriggerData):
"""Plugin webhook trigger data"""