{
"schemaVersion": 1,
"id": "sample-wecom-contacts-foreach-log",
"name": "企业微信 · 遍历缓存联系人",
"description": "先在插件中心的企业微信设置中连接已登录的企业微信,再手动运行。搜索缓存联系人 query 留空会读取本机已加载的全部联系人缓存;可填写名字或完整 ID 筛选。contacts 数组连入遍历集合,body 子图中“当前联系人”的 item 输出直接连到日志 message 和结束 result,完整保留原始联系人内容,消息参数无需填写或修改;index 输出为从 0 开始的序号。completeRoster 为 false,当前接口不保证完整通讯录;模板只查询和输出,不发送消息。",
"enabled": false,
"priority": 0,
"kind": "Graph",
"graph": {
"nodes": [
{
"id": "array-start",
"capabilityId": "core.start",
"name": "开始",
"x": 160,
"y": 180,
"parameters": {}
},
{
"id": "contacts-query",
"capabilityId": "xfe.wecom.contacts",
"name": "读取本机缓存联系人",
"x": 620,
"y": 180,
"parameters": {
"query": ""
}
},
{
"id": "array-foreach",
"capabilityId": "core.foreach",
"name": "逐个遍历联系人",
"x": 1080,
"y": 180,
"parameters": {},
"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": 1540,
"y": 180,
"parameters": {}
}
],
"edges": [
{
"id": "array-execute-foreach",
"fromNode": "array-start",
"fromPort": "next",
"toNode": "contacts-query",
"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"
},
{
"id": "query-then-foreach",
"fromNode": "contacts-query",
"fromPort": "next",
"toNode": "array-foreach",
"toPort": "in",
"kind": "Execution"
},
{
"id": "query-contacts-array",
"fromNode": "contacts-query",
"fromPort": "contacts",
"toNode": "array-foreach",
"toPort": "items",
"kind": "Data"
},
{
"id": "query-complete-roster",
"fromNode": "contacts-query",
"fromPort": "completeRoster",
"toNode": "array-end",
"toPort": "completeRoster",
"kind": "Data"
}
]
},
"code": "",
"inputs": [],
"outputs": [
{
"name": "result",
"label": "全部迭代结果",
"type": "Array",
"description": "每轮 body 子图的输出对象,按输入数组顺序排列。"
},
{
"name": "completeRoster",
"label": "是否完整通讯录",
"type": "Boolean",
"description": "当前原生接口只提供已加载的缓存联系人,此值为 false。"
}
],
"inputDefaults": {},
"variables": {},
"pluginVersions": {
"xfe.wecom": "3.0.0"
},
"triggers": [],
"modifiedAt": "2026-10-13T00:00:00+08:00"
}
{
"schemaVersion": 1,
"id": "sample-wecom-contacts-foreach-log",
"name": "企业微信 · 遍历缓存联系人",
"description": "先在插件中心的企业微信设置中连接已登录的企业微信,再手动运行。搜索缓存联系人 query 留空会读取本机已加载的全部联系人缓存;可填写名字或完整 ID 筛选。contacts 数组连入遍历集合,body 子图中“当前联系人”的 item 输出直接连到日志 message 和结束 result,完整保留原始联系人内容,消息参数无需填写或修改;index 输出为从 0 开始的序号。completeRoster 为 false,当前接口不保证完整通讯录;模板只查询和输出,不发送消息。",
"enabled": false,
"priority": 0,
"kind": "Graph",
"graph": {
"nodes": [
{
"id": "array-start",
"capabilityId": "core.start",
"name": "开始",
"x": 160,
"y": 180,
"parameters": {}
},
{
"id": "contacts-query",
"capabilityId": "xfe.wecom.contacts",
"name": "读取本机缓存联系人",
"x": 620,
"y": 180,
"parameters": {
"query": ""
}
},
{
"id": "array-foreach",
"capabilityId": "core.foreach",
"name": "逐个遍历联系人",
"x": 1080,
"y": 180,
"parameters": {},
"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": 1540,
"y": 180,
"parameters": {}
}
],
"edges": [
{
"id": "array-execute-foreach",
"fromNode": "array-start",
"fromPort": "next",
"toNode": "contacts-query",
"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"
},
{
"id": "query-then-foreach",
"fromNode": "contacts-query",
"fromPort": "next",
"toNode": "array-foreach",
"toPort": "in",
"kind": "Execution"
},
{
"id": "query-contacts-array",
"fromNode": "contacts-query",
"fromPort": "contacts",
"toNode": "array-foreach",
"toPort": "items",
"kind": "Data"
},
{
"id": "query-complete-roster",
"fromNode": "contacts-query",
"fromPort": "completeRoster",
"toNode": "array-end",
"toPort": "completeRoster",
"kind": "Data"
}
]
},
"code": "",
"inputs": [],
"outputs": [
{
"name": "result",
"label": "全部迭代结果",
"type": "Array",
"description": "每轮 body 子图的输出对象,按输入数组顺序排列。"
},
{
"name": "completeRoster",
"label": "是否完整通讯录",
"type": "Boolean",
"description": "当前原生接口只提供已加载的缓存联系人,此值为 false。"
}
],
"inputDefaults": {},
"variables": {},
"pluginVersions": {
"xfe.wecom": "3.0.0"
},
"triggers": [],
"modifiedAt": "2026-10-13T00:00:00+08:00"
}