From e6308d938c54d13b0a36140e2996a94b9366e685 Mon Sep 17 00:00:00 2001 From: QuantumGhost Date: Fri, 6 Jun 2025 14:38:33 +0800 Subject: [PATCH] feat(api): Add `node_execution_id` column to `WorkflowDraftVariable` Introduce a `node_execution_id` column to the `WorkflowDraftVariable` table to enable efficient implementation of the "reset to last run value" functionality. This optimization avoids querying the potentially large `workflow_node_executions` table, which is particularly beneficial for scaling in our SaaS environment. --- api/models/workflow.py | 1 + 1 file changed, 1 insertion(+) diff --git a/api/models/workflow.py b/api/models/workflow.py index e868fb77a7..b64a689f03 100644 --- a/api/models/workflow.py +++ b/api/models/workflow.py @@ -892,6 +892,7 @@ class WorkflowDraftVariable(Base): # visible visible: Mapped[bool] = mapped_column(sa.Boolean, nullable=False, default=True) editable: Mapped[bool] = mapped_column(sa.Boolean, nullable=False, default=False) + node_execution_id: Mapped[str] = mapped_column(StringUUID, nullable=False) def get_selector(self) -> list[str]: selector = json.loads(self.selector)