Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
chore(api): improve type hints for BaseNode and its subclasses (#15826)
QuantumGhost23ed3a520b66
diff --git a/api/core/workflow/nodes/base/node.py b/api/core/workflow/nodes/base/node.pyindex b799e742661..e5667708700 100644--- a/api/core/workflow/nodes/base/node.py+++ b/api/core/workflow/nodes/base/node.py@@ -22,7 +22,7 @@ GenericNodeData = TypeVar("GenericNodeData", bound=BaseNodeData)class BaseNode(Generic[GenericNodeData]):- _node_data_cls: type[BaseNodeData]+ _node_data_cls: type[GenericNodeData]_node_type: NodeTypedef __init__(@@ -57,7 +57,7 @@ class BaseNode(Generic[GenericNodeData]):self.node_id = node_idnode_data = self._node_data_cls.model_validate(config.get("data", {}))- self.node_data = cast(GenericNodeData, node_data)+ self.node_data = node_data@abstractmethoddef _run(self) -> NodeRunResult | Generator[Union[NodeEvent, "InNodeEvent"], None, None]:diff --git a/api/core/workflow/nodes/iteration/iteration_start_node.py b/api/core/workflow/nodes/iteration/iteration_start_node.pyindex deb5066a143..fe955e47d17 100644--- a/api/core/workflow/nodes/iteration/iteration_start_node.py+++ b/api/core/workflow/nodes/iteration/iteration_start_node.py@@ -5,7 +5,7 @@ from core.workflow.nodes.iteration.entities import IterationStartNodeDatafrom models.workflow import WorkflowNodeExecutionStatus-class IterationStartNode(BaseNode):+class IterationStartNode(BaseNode[IterationStartNodeData]):"""Iteration Start Node."""diff --git a/api/core/workflow/nodes/loop/loop_start_node.py b/api/core/workflow/nodes/loop/loop_start_node.pyindex 7fd06273f83..7cf145e4e57 100644--- a/api/core/workflow/nodes/loop/loop_start_node.py+++ b/api/core/workflow/nodes/loop/loop_start_node.py@@ -5,7 +5,7 @@ from core.workflow.nodes.loop.entities import LoopStartNodeDatafrom models.workflow import WorkflowNodeExecutionStatus-class LoopStartNode(BaseNode):+class LoopStartNode(BaseNode[LoopStartNodeData]):"""Loop Start Node."""diff --git a/api/core/workflow/nodes/variable_assigner/v1/node.py b/api/core/workflow/nodes/variable_assigner/v1/node.pyindex 9acc76f326e..7c7f14c0b85 100644--- a/api/core/workflow/nodes/variable_assigner/v1/node.py+++ b/api/core/workflow/nodes/variable_assigner/v1/node.py@@ -1,6 +1,6 @@from core.variables import SegmentType, Variablefrom core.workflow.entities.node_entities import NodeRunResult-from core.workflow.nodes.base import BaseNode, BaseNodeData+from core.workflow.nodes.base import BaseNodefrom core.workflow.nodes.enums import NodeTypefrom core.workflow.nodes.variable_assigner.common import helpers as common_helpersfrom core.workflow.nodes.variable_assigner.common.exc import VariableOperatorNodeError@@ -11,7 +11,7 @@ from .node_data import VariableAssignerData, WriteModeclass VariableAssignerNode(BaseNode[VariableAssignerData]):- _node_data_cls: type[BaseNodeData] = VariableAssignerData+ _node_data_cls = VariableAssignerData_node_type = NodeType.VARIABLE_ASSIGNERdef _run(self) -> NodeRunResult: