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
fix: workflow_as_tool output files raise error (#12061)
非法操作b66c03dfe960
diff --git a/api/core/tools/tool/workflow_tool.py b/api/core/tools/tool/workflow_tool.pyindex edff4a2d07c..eea66ee4ed7 100644--- a/api/core/tools/tool/workflow_tool.py+++ b/api/core/tools/tool/workflow_tool.py@@ -1,12 +1,13 @@import jsonimport loggingfrom copy import deepcopy-from typing import Any, Optional, Union+from typing import Any, Optional, Union, castfrom core.file import FILE_MODEL_IDENTITY, File, FileTransferMethodfrom core.tools.entities.tool_entities import ToolInvokeMessage, ToolParameter, ToolProviderTypefrom core.tools.tool.tool import Toolfrom extensions.ext_database import db+from factories.file_factory import build_from_mappingfrom models.account import Accountfrom models.model import App, EndUserfrom models.workflow import Workflow@@ -194,10 +195,18 @@ class WorkflowTool(Tool):if isinstance(value, list):for item in value:if isinstance(item, dict) and item.get("dify_model_identity") == FILE_MODEL_IDENTITY:- file = File.model_validate(item)+ item["tool_file_id"] = item.get("related_id")+ file = build_from_mapping(+ mapping=item,+ tenant_id=str(cast(Tool.Runtime, self.runtime).tenant_id),+ )files.append(file)elif isinstance(value, dict) and value.get("dify_model_identity") == FILE_MODEL_IDENTITY:- file = File.model_validate(value)+ value["tool_file_id"] = value.get("related_id")+ file = build_from_mapping(+ mapping=value,+ tenant_id=str(cast(Tool.Runtime, self.runtime).tenant_id),+ )files.append(file)result[key] = value