mirror of
https://github.com/langgenius/dify.git
synced 2026-03-17 04:47:50 +08:00
feat(trigger): system variables for trigger nodes
Added a timestamp field to the SystemVariable model and updated the WorkflowAppRunner to include the current timestamp during execution. Enhanced node type checks to recognize trigger nodes in various services, ensuring proper handling of system variables and node outputs in TriggerEventNode and TriggerScheduleNode. This improves the overall workflow execution context and maintains consistency across node types.
This commit is contained in:
@ -28,6 +28,8 @@ class SystemVariable(BaseModel):
|
||||
app_id: str | None = None
|
||||
workflow_id: str | None = None
|
||||
|
||||
timestamp: int | None = None
|
||||
|
||||
files: Sequence[File] = Field(default_factory=list)
|
||||
|
||||
# NOTE: The `workflow_execution_id` field was previously named `workflow_run_id`.
|
||||
@ -107,4 +109,6 @@ class SystemVariable(BaseModel):
|
||||
d[SystemVariableKey.DATASOURCE_INFO] = self.datasource_info
|
||||
if self.invoke_from is not None:
|
||||
d[SystemVariableKey.INVOKE_FROM] = self.invoke_from
|
||||
if self.timestamp is not None:
|
||||
d[SystemVariableKey.TIMESTAMP] = self.timestamp
|
||||
return d
|
||||
|
||||
Reference in New Issue
Block a user