{
"schemaVersion": 1,
"id": "sample-array-foreach-log",
"name": "数组遍历 · 逐项输出日志",
"description": "使用内置节点顺序遍历数组,并将每个元素原样输出到 XFE 运行日志。选中“遍历数组”,在“集合 · items”中修改数组;点击“编辑子图:body”查看逐项处理。“当前循环项”的 item 输出已连接日志的 message 和结束的 result,消息参数无需填写或修改;index 输出是从 0 开始的序号。主图 next 在遍历完成后执行,results 收集每轮子图的输出。无需插件、凭据或外部服务,导入后可直接手动运行。",
"enabled": false,
"priority": 0,
"kind": "Graph",
"graph": {
"nodes": [
{
"id": "array-start",
"capabilityId": "core.start",
"name": "开始",
"x": 160,
"y": 180,
"parameters": {}
},
{
"id": "array-foreach",
"capabilityId": "core.foreach",
"name": "遍历数组",
"x": 620,
"y": 180,
"parameters": {
"items": ["苹果", "香蕉", "橙子"]
},
"children": {
"body": {
"nodes": [
{
"id": "item-start",
"capabilityId": "core.start",
"name": "本轮开始",
"x": 160,
"y": 180,
"parameters": {}
},
{
"id": "item-current",
"capabilityId": "core.foreach.current",
"name": "当前循环项",
"x": 620,
"y": 180,
"parameters": {}
},
{
"id": "item-log",
"capabilityId": "core.log",
"name": "输出当前项",
"x": 1080,
"y": 180,
"parameters": {}
},
{
"id": "item-end",
"capabilityId": "core.end",
"name": "返回当前项",
"x": 1540,
"y": 180,
"parameters": {}
}
],
"edges": [
{
"id": "item-execute-current",
"fromNode": "item-start",
"fromPort": "next",
"toNode": "item-current",
"toPort": "in",
"kind": "Execution"
},
{
"id": "item-execute-log",
"fromNode": "item-current",
"fromPort": "next",
"toNode": "item-log",
"toPort": "in",
"kind": "Execution"
},
{
"id": "item-execute-end",
"fromNode": "item-log",
"fromPort": "next",
"toNode": "item-end",
"toPort": "in",
"kind": "Execution"
},
{
"id": "item-log-value",
"fromNode": "item-current",
"fromPort": "item",
"toNode": "item-log",
"toPort": "message",
"kind": "Data"
},
{
"id": "item-return-value",
"fromNode": "item-current",
"fromPort": "item",
"toNode": "item-end",
"toPort": "result",
"kind": "Data"
}
]
}
}
},
{
"id": "array-end",
"capabilityId": "core.end",
"name": "返回全部迭代结果",
"x": 1080,
"y": 180,
"parameters": {}
}
],
"edges": [
{
"id": "array-execute-foreach",
"fromNode": "array-start",
"fromPort": "next",
"toNode": "array-foreach",
"toPort": "in",
"kind": "Execution"
},
{
"id": "array-execute-end",
"fromNode": "array-foreach",
"fromPort": "next",
"toNode": "array-end",
"toPort": "in",
"kind": "Execution"
},
{
"id": "array-collect-results",
"fromNode": "array-foreach",
"fromPort": "results",
"toNode": "array-end",
"toPort": "result",
"kind": "Data"
}
]
},
"code": "",
"inputs": [],
"outputs": [
{
"name": "result",
"label": "全部迭代结果",
"type": "Array",
"description": "每轮 body 子图的输出对象,按输入数组顺序排列。"
}
],
"inputDefaults": {},
"variables": {},
"pluginVersions": {},
"triggers": [],
"modifiedAt": "2026-10-13T00:00:00+08:00"
}
{
"schemaVersion": 1,
"id": "sample-array-foreach-log",
"name": "数组遍历 · 逐项输出日志",
"description": "使用内置节点顺序遍历数组,并将每个元素原样输出到 XFE 运行日志。选中“遍历数组”,在“集合 · items”中修改数组;点击“编辑子图:body”查看逐项处理。“当前循环项”的 item 输出已连接日志的 message 和结束的 result,消息参数无需填写或修改;index 输出是从 0 开始的序号。主图 next 在遍历完成后执行,results 收集每轮子图的输出。无需插件、凭据或外部服务,导入后可直接手动运行。",
"enabled": false,
"priority": 0,
"kind": "Graph",
"graph": {
"nodes": [
{
"id": "array-start",
"capabilityId": "core.start",
"name": "开始",
"x": 160,
"y": 180,
"parameters": {}
},
{
"id": "array-foreach",
"capabilityId": "core.foreach",
"name": "遍历数组",
"x": 620,
"y": 180,
"parameters": {
"items": ["苹果", "香蕉", "橙子"]
},
"children": {
"body": {
"nodes": [
{
"id": "item-start",
"capabilityId": "core.start",
"name": "本轮开始",
"x": 160,
"y": 180,
"parameters": {}
},
{
"id": "item-current",
"capabilityId": "core.foreach.current",
"name": "当前循环项",
"x": 620,
"y": 180,
"parameters": {}
},
{
"id": "item-log",
"capabilityId": "core.log",
"name": "输出当前项",
"x": 1080,
"y": 180,
"parameters": {}
},
{
"id": "item-end",
"capabilityId": "core.end",
"name": "返回当前项",
"x": 1540,
"y": 180,
"parameters": {}
}
],
"edges": [
{
"id": "item-execute-current",
"fromNode": "item-start",
"fromPort": "next",
"toNode": "item-current",
"toPort": "in",
"kind": "Execution"
},
{
"id": "item-execute-log",
"fromNode": "item-current",
"fromPort": "next",
"toNode": "item-log",
"toPort": "in",
"kind": "Execution"
},
{
"id": "item-execute-end",
"fromNode": "item-log",
"fromPort": "next",
"toNode": "item-end",
"toPort": "in",
"kind": "Execution"
},
{
"id": "item-log-value",
"fromNode": "item-current",
"fromPort": "item",
"toNode": "item-log",
"toPort": "message",
"kind": "Data"
},
{
"id": "item-return-value",
"fromNode": "item-current",
"fromPort": "item",
"toNode": "item-end",
"toPort": "result",
"kind": "Data"
}
]
}
}
},
{
"id": "array-end",
"capabilityId": "core.end",
"name": "返回全部迭代结果",
"x": 1080,
"y": 180,
"parameters": {}
}
],
"edges": [
{
"id": "array-execute-foreach",
"fromNode": "array-start",
"fromPort": "next",
"toNode": "array-foreach",
"toPort": "in",
"kind": "Execution"
},
{
"id": "array-execute-end",
"fromNode": "array-foreach",
"fromPort": "next",
"toNode": "array-end",
"toPort": "in",
"kind": "Execution"
},
{
"id": "array-collect-results",
"fromNode": "array-foreach",
"fromPort": "results",
"toNode": "array-end",
"toPort": "result",
"kind": "Data"
}
]
},
"code": "",
"inputs": [],
"outputs": [
{
"name": "result",
"label": "全部迭代结果",
"type": "Array",
"description": "每轮 body 子图的输出对象,按输入数组顺序排列。"
}
],
"inputDefaults": {},
"variables": {},
"pluginVersions": {},
"triggers": [],
"modifiedAt": "2026-10-13T00:00:00+08:00"
}