dify_canvas_patch
Patch existing Dify canvas draft nodes by ID to merge or replace data and update coordinates. Preview changes as a diff by default, then write back after validation and backup.
Instructions
修改草稿中的已有节点(按 id 合并 data、整块替换 data、改坐标)。默认 dry-run 只返回 diff;apply=true 才写回。写回前自动备份并自检(悬空边、自环、default_value 类型、Code 节点参数一致),写后刷新页面并核对渲染。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"app": "<app>",
"changes": "<changes>"
},
"name": "dify_canvas_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | 应用名称或 id。 | |
| alias | No | 可选。实例别名。 | |
| apply | No | 默认 false(dry-run);true 才写回。 | |
| changes | Yes | 改动数组:[{ "id": "节点id", "data": {字段补丁}, "replaceData": {整块替换}, "position": {"x":0,"y":0} }] | |
| expectedHash | No | 可选。乐观锁:草稿 hash 不一致时拒绝写入。 |