diff --git a/api/services/workflow_draft_variable_service.py b/api/services/workflow_draft_variable_service.py index 59db1475768..af25edd2bdc 100644 --- a/api/services/workflow_draft_variable_service.py +++ b/api/services/workflow_draft_variable_service.py @@ -1,7 +1,7 @@ import dataclasses import json import logging -from collections.abc import Mapping, Sequence +from collections.abc import Mapping, Sequence, Set from concurrent.futures import ThreadPoolExecutor from datetime import datetime from enum import StrEnum @@ -271,12 +271,20 @@ class WorkflowDraftVariableService: ) def list_variables_without_values( - self, app_id: str, page: int, limit: int, user_id: str + self, + app_id: str, + page: int, + limit: int, + user_id: str, + *, + exclude_node_ids: Set[str] | None = None, ) -> WorkflowDraftVariableList: criteria = [ WorkflowDraftVariable.app_id == app_id, WorkflowDraftVariable.user_id == user_id, ] + if exclude_node_ids: + criteria.append(WorkflowDraftVariable.node_id.notin_(list(exclude_node_ids))) total = None base_stmt = select(WorkflowDraftVariable).where(*criteria) if page == 1: