# 批处理节点
通过设定批量运行数组,运行批处理体内的任务
# 数据结构定义
export interface BatchNodeDef {
id: INodeIDValue;
type: WorkflowNodeTypeEnum.Batch;
data: {
title: string;
inputsValues: {
concurrentSize: IFlowConstantValue; // 并行运行数量
batchSize: IFlowConstantValue; // 批处理次数上限
loop_params: { // 循环参数(批处理的数组,限定数组类型)
[key: string]: IFlowRefValue;
};
};
inputs: IJsonSchema; // 节点输入参数类型
outputs: { // 节点输出参数类型
type: 'object';
properties: Record<string, IFlowRefValue>; // 输出参数(选择节点的结果集合)
};
},
blocks: FlowNodeJSON[]; // 批处理块节点
edges: WorkflowEdgeJSON[]; // 批处理块节点连线
}
# 范例
{
id: {random(6)},
type: 'batch',
data: {
title: `批处理`,
inputsValues: {
concurrentSize: { // 并行运行数量
type: 'constant',
content: 10,
},
batchSize: { // 批处理次数上限
type: 'constant',
content: 100,
},
loop_params: { // 输入参数(批处理的数组,限定数组类型)
arg1: {
type: 'ref',
content: ['100001', 'array_obj'],
},
},
},
inputs: {
type: 'object',
required: [],
properties: {
concurrentSize: {
type: 'number',
},
batchSize: {
type: 'number',
},
input_params: {
type: 'object',
properties: {
arg1: {
type: 'array',
items: {
type: 'object',
properties: {
int: {
type: 'number',
},
str: {
type: 'string',
},
},
},
},
},
},
},
},
outputs: {
type: 'object',
properties: {
result: {
type: 'ref',
content: ['126288', 'result'],
schema: {
type: 'array',
items: {
type: 'string',
},
},
},
},
},
},
blocks: [
{
id: {random(6)},
type: 'block-start',
data: {},
},
{
id: {random(6)},
type: 'block-end',
data: {},
},
],
}
← 设置变量节点 循环/批处理开始节点 →