Skip to content

armgit / dify

Public Imported from GitHub
0

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.

fix: _model_to_insertion_dict missing id (#30603)

wangxiaolei4f74e90f514e
diff --git a/api/models/workflow.py b/api/models/workflow.py
index 853d5afefc0..c04e4e9762b 100644
--- a/api/models/workflow.py
+++ b/api/models/workflow.py
@@ -1506,6 +1506,7 @@ class WorkflowDraftVariable(Base):
file_id: str | None = None,
) -> "WorkflowDraftVariable":
variable = WorkflowDraftVariable()
+ variable.id = str(uuid4())
variable.created_at = naive_utc_now()
variable.updated_at = naive_utc_now()
variable.description = description
diff --git a/api/services/workflow_draft_variable_service.py b/api/services/workflow_draft_variable_service.py
index f299ce3baa4..9407a2b3f04 100644
--- a/api/services/workflow_draft_variable_service.py
+++ b/api/services/workflow_draft_variable_service.py
@@ -679,6 +679,7 @@ def _batch_upsert_draft_variable(
def _model_to_insertion_dict(model: WorkflowDraftVariable) -> dict[str, Any]:
d: dict[str, Any] = {
+ "id": model.id,
"app_id": model.app_id,
"last_edited_at": None,
"node_id": model.node_id,