mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
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:
@ -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"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user