feat(backend): batch & loop node fix get input
This commit is contained in:
@@ -199,21 +199,16 @@ func (l *Loop) Execute(ctx context.Context, in map[string]any, opts ...nodes.Nes
|
||||
currentKey := string(l.config.LoopNodeKey) + "#" + arrayKey
|
||||
|
||||
// Recursively expand map[string]any elements
|
||||
if m, ok := ele.(map[string]any); ok {
|
||||
var expand func(prefix string, val interface{})
|
||||
expand = func(prefix string, val interface{}) {
|
||||
if nestedMap, ok := val.(map[string]any); ok {
|
||||
for k, v := range nestedMap {
|
||||
expand(prefix+"#"+k, v)
|
||||
}
|
||||
} else {
|
||||
input[prefix] = val
|
||||
var expand func(prefix string, val interface{})
|
||||
expand = func(prefix string, val interface{}) {
|
||||
input[prefix] = val
|
||||
if nestedMap, ok := val.(map[string]any); ok {
|
||||
for k, v := range nestedMap {
|
||||
expand(prefix+"#"+k, v)
|
||||
}
|
||||
}
|
||||
expand(currentKey, m)
|
||||
} else {
|
||||
input[currentKey] = ele
|
||||
}
|
||||
expand(currentKey, ele)
|
||||
}
|
||||
|
||||
return input, items, nil
|
||||
|
||||
Reference in New Issue
Block a user