mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
refactor(trigger): streamline workflow argument handling in DraftWorkflowTriggerNodeApi
- Simplified retrieval of workflow arguments by directly accessing event.workflow_args. - Removed unnecessary conditional checks for user inputs, ensuring cleaner code. - Enhanced TriggerEventNode to use deepcopy for user inputs to prevent unintended mutations.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from collections.abc import Mapping
|
||||
from copy import deepcopy
|
||||
from typing import Any, Optional
|
||||
|
||||
from core.workflow.entities.workflow_node_execution import WorkflowNodeExecutionMetadataKey, WorkflowNodeExecutionStatus
|
||||
@ -65,7 +66,7 @@ class TriggerEventNode(Node):
|
||||
"""
|
||||
|
||||
# Get trigger data passed when workflow was triggered
|
||||
inputs = dict(self.graph_runtime_state.variable_pool.user_inputs)
|
||||
inputs = deepcopy(self.graph_runtime_state.variable_pool.user_inputs)
|
||||
metadata = {
|
||||
WorkflowNodeExecutionMetadataKey.TRIGGER_INFO: {
|
||||
"provider_id": self._node_data.provider_id,
|
||||
|
||||
Reference in New Issue
Block a user