From 1e477af05f333aae2137abb92b4ea2ba9973fcc6 Mon Sep 17 00:00:00 2001 From: Harry Date: Wed, 29 Oct 2025 18:15:36 +0800 Subject: [PATCH] feat(trigger): add system variables to webhook node outputs Enhanced the TriggerWebhookNode to include system variables as outputs. This change allows for better accessibility of system variables during node execution, improving the overall functionality of the webhook trigger process. A TODO comment has been added to address future improvements for direct access to system variables. --- api/core/workflow/nodes/trigger_webhook/node.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/core/workflow/nodes/trigger_webhook/node.py b/api/core/workflow/nodes/trigger_webhook/node.py index aa49b3f3e2..58ccf5a3cc 100644 --- a/api/core/workflow/nodes/trigger_webhook/node.py +++ b/api/core/workflow/nodes/trigger_webhook/node.py @@ -1,6 +1,7 @@ from collections.abc import Mapping from typing import Any, Optional +from core.workflow.constants import SYSTEM_VARIABLE_NODE_ID from core.workflow.entities.workflow_node_execution import WorkflowNodeExecutionStatus from core.workflow.enums import ErrorStrategy, NodeExecutionType, NodeType from core.workflow.node_events import NodeRunResult @@ -71,7 +72,12 @@ class TriggerWebhookNode(Node): # Extract webhook-specific outputs based on node configuration outputs = self._extract_configured_outputs(webhook_inputs) + system_inputs = self.graph_runtime_state.variable_pool.system_variables.to_dict() + # TODO: System variables should be directly accessible, no need for special handling + # Set system variables as node outputs. + for var in system_inputs: + outputs[SYSTEM_VARIABLE_NODE_ID + "." + var] = system_inputs[var] return NodeRunResult( status=WorkflowNodeExecutionStatus.SUCCEEDED, inputs=webhook_inputs,