Node transfer {} #14961

Closed
opened 2026-02-21 19:19:32 -05:00 by yindo · 2 comments
Owner

Originally created by @meng0302 on GitHub (Jun 27, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.5.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image
The tool I customized,I don't know why it was passed over as {}?

{
	"openapi": "3.1.0",
	"info": {
		"title": "硅基流动文生图",
		"description": "使用硅基流动 API 生成图像(支持模型、提示词、尺寸等参数)",
		"version": "v1.0.0"
	},
	"servers": [
		{
			"url": "https://api.siliconflow.cn/v1"
		}
	],
	"paths": {
		"/images/generations": {
			"post": {
				"summary": "提示词生成图像",
				"description": "通过提示词使用指定模型生成图像。",
				"operationId": "generateImage",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ImageGenerationRequest"
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "图像生成成功",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ImageGenerationResponse"
								}
							}
						}
					},
					"401": {
						"description": "未授权(检查 Token)"
					},
					"429": {
						"description": "由于速率限制,请求被拒绝。已达到TPM限制。"
					},
					"500": {
						"description": "Internal Server Error"
					}
				},
				"security": [
					{
						"bearerAuth": []
					}
				]
			}
		}
	},
	"components": {
		"securitySchemes": {
			"bearerAuth": {
				"type": "http",
				"scheme": "bearer",
				"bearerFormat": "JWT"
			}
		},
		"schemas": {
			"ImageGenerationRequest": {
				"type": "object",
				"required": [],
				"properties": {
					"model": {
						"type": "string",
						"default": "Kwai-Kolors/Kolors",
						"description": "使用的模型名称"
					},
					"prompt": {
						"type": "string",
						"default": "an island near sea, with seagulls, moon shining over the sea, light house, boats in the background, fish flying",
						"description": "生成图像的提示词"
					},
					"image_size": {
						"type": "string",
						"enum": [
							"512x512",
							"768x768",
							"1024x1024"
						],
						"default": "1024x1024",
						"description": "生成图像的尺寸"
					},
					"batch_size": {
						"type": "integer",
						"default": 1,
						"description": "生成图像的数量"
					},
					"num_inference_steps": {
						"type": "integer",
						"default": 20,
						"description": "推理步数"
					},
					"guidance_scale": {
						"type": "number",
						"default": 7.5,
						"description": "引导系数(影响图像与提示词的一致性)"
					},
					"seed": {
						"type": "integer",
						"default": 0,
						"description": "种子"
					},
					"negative_prompt": {
						"type": "string",
						"default": "",
						"description": "负面提示词"
					}
				}
			},
			"ImageGenerationResponse": {
				"type": "object",
				"properties": {
					"id": {
						"type": "string"
					},
					"created": {
						"type": "integer"
					},
					"data": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"url": {
									"type": "string",
									"format": "uri",
									"description": "生成的图像 URL"
								}
							}
						}
					}
				}
			}
		}
	}
}

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @meng0302 on GitHub (Jun 27, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.5.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/5505563c-eab5-45e5-96d1-46c7989b8369) The tool I customized,I don't know why it was passed over as {}? ``` { "openapi": "3.1.0", "info": { "title": "硅基流动文生图", "description": "使用硅基流动 API 生成图像(支持模型、提示词、尺寸等参数)", "version": "v1.0.0" }, "servers": [ { "url": "https://api.siliconflow.cn/v1" } ], "paths": { "/images/generations": { "post": { "summary": "提示词生成图像", "description": "通过提示词使用指定模型生成图像。", "operationId": "generateImage", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageGenerationRequest" } } } }, "responses": { "200": { "description": "图像生成成功", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageGenerationResponse" } } } }, "401": { "description": "未授权(检查 Token)" }, "429": { "description": "由于速率限制,请求被拒绝。已达到TPM限制。" }, "500": { "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ] } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "schemas": { "ImageGenerationRequest": { "type": "object", "required": [], "properties": { "model": { "type": "string", "default": "Kwai-Kolors/Kolors", "description": "使用的模型名称" }, "prompt": { "type": "string", "default": "an island near sea, with seagulls, moon shining over the sea, light house, boats in the background, fish flying", "description": "生成图像的提示词" }, "image_size": { "type": "string", "enum": [ "512x512", "768x768", "1024x1024" ], "default": "1024x1024", "description": "生成图像的尺寸" }, "batch_size": { "type": "integer", "default": 1, "description": "生成图像的数量" }, "num_inference_steps": { "type": "integer", "default": 20, "description": "推理步数" }, "guidance_scale": { "type": "number", "default": 7.5, "description": "引导系数(影响图像与提示词的一致性)" }, "seed": { "type": "integer", "default": 0, "description": "种子" }, "negative_prompt": { "type": "string", "default": "", "description": "负面提示词" } } }, "ImageGenerationResponse": { "type": "object", "properties": { "id": { "type": "string" }, "created": { "type": "integer" }, "data": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "description": "生成的图像 URL" } } } } } } } } } ``` ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:19:32 -05:00
Author
Owner

@meng0302 commented on GitHub (Jun 27, 2025):

Only the initial input parameters were used here
Image

This parameter type is String, just like a custom tool type
Image

@meng0302 commented on GitHub (Jun 27, 2025): Only the initial input parameters were used here ![Image](https://github.com/user-attachments/assets/90000705-b791-4ada-af22-d99b39f76e26) This parameter type is String, just like a custom tool type ![Image](https://github.com/user-attachments/assets/f1a82337-a1cf-4336-90a4-9f4a6cf4063b)
Author
Owner

@dosubot[bot] commented on GitHub (Jun 27, 2025):

Hi @meng0302! I'm Dosu and I’m helping the dify team.

Based on the code and recent updates, Dify passes parameters to custom (OpenAPI) tools by mapping workflow node variables and constants to the tool's expected schema. If only the initial input parameters are being used and others are missing (resulting in {} being sent), it's usually due to a misconfiguration in the workflow editor: either the parameters are not correctly mapped, or their types/values don't match what the tool expects. This can also happen if a required variable is missing or the type is set incorrectly (e.g., using "variable" but not linking to a valid workflow variable).

The "Unknown error" at the node is likely a result of this failed parameter mapping or type validation. Dify's engine will pass an empty object if it can't resolve the parameters, and the error is surfaced in the workflow logs. Double-check in the workflow editor that each parameter for the custom tool node is mapped to a valid variable or constant, and that the types match the OpenAPI schema (string, integer, etc.). If you see a type mismatch or missing variable, fix it and re-run the workflow.

Recent fixes in Dify have improved error handling and parameter extraction, so if you are not on the latest patch of 1.5.x, consider updating, as some bugs (like parameter type typos and extraction issues) have been addressed in recent PRs (example, example).

If you still get an empty object, try checking the backend logs for more detailed error messages—they should indicate which parameter or type is causing the issue. If you need more help, sharing the exact parameter mapping configuration from your workflow editor would help pinpoint the problem.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 27, 2025): <!-- Greeting --> Hi @meng0302! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Based on the code and recent updates, Dify passes parameters to custom (OpenAPI) tools by mapping workflow node variables and constants to the tool's expected schema. If only the initial input parameters are being used and others are missing (resulting in `{}` being sent), it's usually due to a misconfiguration in the workflow editor: either the parameters are not correctly mapped, or their types/values don't match what the tool expects. This can also happen if a required variable is missing or the type is set incorrectly (e.g., using "variable" but not linking to a valid workflow variable). The "Unknown error" at the node is likely a result of this failed parameter mapping or type validation. Dify's engine will pass an empty object if it can't resolve the parameters, and the error is surfaced in the workflow logs. Double-check in the workflow editor that each parameter for the custom tool node is mapped to a valid variable or constant, and that the types match the OpenAPI schema (string, integer, etc.). If you see a type mismatch or missing variable, fix it and re-run the workflow. Recent fixes in Dify have improved error handling and parameter extraction, so if you are not on the latest patch of 1.5.x, consider updating, as some bugs (like parameter type typos and extraction issues) have been addressed in recent PRs ([example](https://github.com/langgenius/dify/pull/12075), [example](https://github.com/langgenius/dify/pull/21463)). If you still get an empty object, try checking the backend logs for more detailed error messages—they should indicate which parameter or type is causing the issue. If you need more help, sharing the exact parameter mapping configuration from your workflow editor would help pinpoint the problem. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/d9e59599-4a90-4d19-afea-dc9dea48689a?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d9e59599-4a90-4d19-afea-dc9dea48689a?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d9e59599-4a90-4d19-afea-dc9dea48689a?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d9e59599-4a90-4d19-afea-dc9dea48689a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d9e59599-4a90-4d19-afea-dc9dea48689a?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d9e59599-4a90-4d19-afea-dc9dea48689a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d9e59599-4a90-4d19-afea-dc9dea48689a?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/21641)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14961