| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import { NodeConnectionTypes, type INodeType, type INodeDataBaseSchema } from '../Interface'
- export type IterationData = INodeDataBaseSchema & {
- /**
- * 错误处理模式
- * terminated: 终止
- * continue-on-error: 出错继续
- * remove-abnormal-output: 移除异常输出
- */
- error_handle_mode: 'terminated' | 'continue-on-error' | 'remove-abnormal-output'
- /**
- * 是否并行
- */
- is_parallel: boolean
- /**
- * 并行数量
- */
- parallel_nums: number
- /**
- * 扁平化输出
- */
- flatten_output: boolean
- /**
- * 开始节点id
- */
- start_node_id: string
- /**
- * 迭代输出变量
- */
- output_iteration_variable: Array<{
- name: string
- describe: string
- type:
- | 'string'
- | 'number'
- | 'boolean'
- | 'object'
- | 'array[string]'
- | 'array[number]'
- | 'array[boolean]'
- | 'array[object]'
- value: any
- value_type?: 'constant' | 'variable'
- }>
- }
- export const iterationNode: INodeType = {
- version: ['1'],
- displayName: '迭代',
- name: 'iteration',
- description: '迭代节点',
- group: '业务逻辑',
- icon: 'lucide:repeat-2',
- iconColor: '#9373ee',
- inputs: [NodeConnectionTypes.main],
- outputs: [NodeConnectionTypes.main],
- // 业务数据
- schema: {
- appAgentId: '',
- parentId: '',
- position: {
- x: 20,
- y: 30
- },
- width: 96,
- height: 96,
- selected: false,
- nodeType: 'iteration',
- zIndex: 1,
- data: {}
- }
- }
|