You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/content/docs/de/yaml/blocks/loop.mdx
+79-17Lines changed: 79 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,6 @@ type: object
10
10
required:
11
11
- type
12
12
- name
13
-
- inputs
14
13
- connections
15
14
properties:
16
15
type:
@@ -22,21 +21,23 @@ properties:
22
21
description: Display name for this loop block
23
22
inputs:
24
23
type: object
25
-
required:
26
-
- loopType
24
+
description: Optional. If omitted, defaults will be applied.
27
25
properties:
28
26
loopType:
29
27
type: string
30
28
enum: [for, forEach]
31
29
description: Type of loop to execute
30
+
default: for
32
31
iterations:
33
32
type: number
34
33
description: Number of iterations (for 'for' loops)
34
+
default: 5
35
35
minimum: 1
36
36
maximum: 1000
37
37
collection:
38
38
type: string
39
39
description: Collection to iterate over (for 'forEach' loops)
40
+
default: ""
40
41
maxConcurrency:
41
42
type: number
42
43
description: Maximum concurrent executions
@@ -45,40 +46,48 @@ properties:
45
46
maximum: 10
46
47
connections:
47
48
type: object
48
-
required:
49
-
- loop
50
49
properties:
50
+
# Nested format (recommended)
51
51
loop:
52
52
type: object
53
-
required:
54
-
- start
55
53
properties:
56
54
start:
57
55
type: string
58
56
description: Target block ID to execute inside the loop
59
57
end:
60
58
type: string
61
59
description: Target block ID for loop completion (optional)
60
+
# Direct handle format (alternative)
61
+
loop-start-source:
62
+
type: string | string[]
63
+
description: Target block ID to execute inside the loop (direct format)
64
+
loop-end-source:
65
+
type: string | string[]
66
+
description: Target block ID for loop completion (direct format, optional)
62
67
error:
63
68
type: string
64
69
description: Target block ID for error handling
70
+
note: Use either the nested 'loop' format OR the direct 'loop-start-source' format, not both
65
71
```
66
72
67
73
## Verbindungskonfiguration
68
74
69
-
Loop-Blöcke verwenden ein spezielles Verbindungsformat mit einem `loop`Abschnitt:
75
+
Loop-Blöcke unterstützen zwei Verbindungsformate:
76
+
77
+
### Direktes Handle-Format (Alternative)
70
78
71
79
```yaml
72
80
connections:
73
-
loop:
74
-
start: <string> # Target block ID to execute inside the loop
75
-
end: <string> # Target block ID after loop completion (optional)
81
+
loop-start-source: <string> # Target block ID to execute inside the loop
82
+
loop-end-source: <string> # Target block ID after loop completion (optional)
76
83
error: <string> # Target block ID for error handling (optional)
77
84
```
78
85
86
+
Beide Formate funktionieren identisch. Verwenden Sie das Format, das Ihnen besser gefällt.
87
+
79
88
## Konfiguration von untergeordneten Blöcken
80
89
81
-
Blöcke innerhalb einer Schleife müssen ihre `parentId` auf die Loop-Block-ID setzen:
90
+
Blöcke innerhalb einer Schleife müssen ihre `parentId` auf die Loop-Block-ID gesetzt haben. Die Eigenschaft `extent` wird automatisch auf `'parent'` gesetzt und muss nicht angegeben werden:
82
91
83
92
```yaml
84
93
loop-1:
@@ -106,7 +115,7 @@ process-item:
106
115
107
116
## Beispiele
108
117
109
-
### For-Schleife (feste Iterationen)
118
+
### For-Schleife (feste Anzahl von Iterationen)
110
119
111
120
```yaml
112
121
countdown-loop:
@@ -227,7 +236,7 @@ store-analysis:
227
236
};
228
237
```
229
238
230
-
### Schleife mit paralleler Verarbeitung
239
+
### Schleife für parallele Verarbeitung
231
240
232
241
```yaml
233
242
parallel-processing-loop:
@@ -261,9 +270,62 @@ process-task:
261
270
success: task-completed
262
271
```
263
272
273
+
### Beispiel für direktes Handle-Format
274
+
275
+
Dieselbe Schleife kann mit dem direkten Handle-Format geschrieben werden:
276
+
277
+
```yaml
278
+
my-loop:
279
+
type: loop
280
+
name: "Process Items"
281
+
inputs:
282
+
loopType: forEach
283
+
collection: <start.items>
284
+
connections:
285
+
loop-start-source: process-item # Direct handle format
286
+
loop-end-source: final-results # Direct handle format
Copy file name to clipboardExpand all lines: apps/docs/content/docs/es/yaml/blocks/loop.mdx
+76-14Lines changed: 76 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,6 @@ type: object
10
10
required:
11
11
- type
12
12
- name
13
-
- inputs
14
13
- connections
15
14
properties:
16
15
type:
@@ -22,21 +21,23 @@ properties:
22
21
description: Display name for this loop block
23
22
inputs:
24
23
type: object
25
-
required:
26
-
- loopType
24
+
description: Optional. If omitted, defaults will be applied.
27
25
properties:
28
26
loopType:
29
27
type: string
30
28
enum: [for, forEach]
31
29
description: Type of loop to execute
30
+
default: for
32
31
iterations:
33
32
type: number
34
33
description: Number of iterations (for 'for' loops)
34
+
default: 5
35
35
minimum: 1
36
36
maximum: 1000
37
37
collection:
38
38
type: string
39
39
description: Collection to iterate over (for 'forEach' loops)
40
+
default: ""
40
41
maxConcurrency:
41
42
type: number
42
43
description: Maximum concurrent executions
@@ -45,40 +46,48 @@ properties:
45
46
maximum: 10
46
47
connections:
47
48
type: object
48
-
required:
49
-
- loop
50
49
properties:
50
+
# Nested format (recommended)
51
51
loop:
52
52
type: object
53
-
required:
54
-
- start
55
53
properties:
56
54
start:
57
55
type: string
58
56
description: Target block ID to execute inside the loop
59
57
end:
60
58
type: string
61
59
description: Target block ID for loop completion (optional)
60
+
# Direct handle format (alternative)
61
+
loop-start-source:
62
+
type: string | string[]
63
+
description: Target block ID to execute inside the loop (direct format)
64
+
loop-end-source:
65
+
type: string | string[]
66
+
description: Target block ID for loop completion (direct format, optional)
62
67
error:
63
68
type: string
64
69
description: Target block ID for error handling
70
+
note: Use either the nested 'loop' format OR the direct 'loop-start-source' format, not both
65
71
```
66
72
67
73
## Configuración de conexión
68
74
69
-
Los bloques Loop utilizan un formato de conexión especial con una sección `loop`:
75
+
Los bloques de bucle admiten dos formatos de conexión:
76
+
77
+
### Formato de manejador directo (alternativo)
70
78
71
79
```yaml
72
80
connections:
73
-
loop:
74
-
start: <string> # Target block ID to execute inside the loop
75
-
end: <string> # Target block ID after loop completion (optional)
81
+
loop-start-source: <string> # Target block ID to execute inside the loop
82
+
loop-end-source: <string> # Target block ID after loop completion (optional)
76
83
error: <string> # Target block ID for error handling (optional)
77
84
```
78
85
86
+
Ambos formatos funcionan de manera idéntica. Usa el que prefieras.
87
+
79
88
## Configuración de bloques secundarios
80
89
81
-
Los bloques dentro de un bucle deben tener su `parentId` configurado con el ID del bloque loop:
90
+
Los bloques dentro de un bucle deben tener su `parentId` configurado con el ID del bloque de bucle. La propiedad `extent` se establece automáticamente como `'parent'` y no necesita ser especificada:
82
91
83
92
```yaml
84
93
loop-1:
@@ -261,6 +270,59 @@ process-task:
261
270
success: task-completed
262
271
```
263
272
273
+
### Ejemplo de formato de manejador directo
274
+
275
+
El mismo bucle puede escribirse usando el formato de manejador directo:
276
+
277
+
```yaml
278
+
my-loop:
279
+
type: loop
280
+
name: "Process Items"
281
+
inputs:
282
+
loopType: forEach
283
+
collection: <start.items>
284
+
connections:
285
+
loop-start-source: process-item # Direct handle format
286
+
loop-end-source: final-results # Direct handle format
287
+
error: handle-error
288
+
289
+
process-item:
290
+
type: agent
291
+
name: "Process Item"
292
+
parentId: my-loop
293
+
inputs:
294
+
systemPrompt: "Process this item"
295
+
userPrompt: <loop.currentItem>
296
+
model: gpt-4o
297
+
apiKey: '{{OPENAI_API_KEY}}'
298
+
```
299
+
300
+
### Ejemplo de bucle mínimo (usando valores predeterminados)
301
+
302
+
Puedes omitir completamente la sección `inputs`, y se aplicarán los valores predeterminados:
303
+
304
+
```yaml
305
+
simple-loop:
306
+
type: loop
307
+
name: "Simple Loop"
308
+
# No inputs section - defaults to loopType: 'for', iterations: 5
309
+
connections:
310
+
loop-start-source: process-step
311
+
loop-end-source: complete
312
+
313
+
process-step:
314
+
type: agent
315
+
name: "Process Step"
316
+
parentId: simple-loop
317
+
inputs:
318
+
systemPrompt: "Execute step"
319
+
userPrompt: "Step <loop.index>"
320
+
model: gpt-4o
321
+
apiKey: '{{OPENAI_API_KEY}}'
322
+
```
323
+
324
+
Este bucle ejecutará 5 iteraciones por defecto.
325
+
264
326
## Variables de bucle
265
327
266
328
Dentro de los bloques secundarios del bucle, estas variables especiales están disponibles:
@@ -286,10 +348,10 @@ final-processor:
286
348
287
349
## Mejores prácticas
288
350
289
-
- Establece límites razonables de iteración para evitar tiempos de ejecución prolongados
351
+
- Establece límites de iteración razonables para evitar tiempos de ejecución largos
290
352
- Usa forEach para procesar colecciones, bucles for para iteraciones fijas
291
353
- Considera usar maxConcurrency para operaciones limitadas por E/S
292
-
- Incluye manejo de errores para una ejecución robusta de bucles
354
+
- Incluye manejo de errores para una ejecución robusta del bucle
293
355
- Usa nombres descriptivos para los bloques secundarios del bucle
294
356
- Prueba primero con colecciones pequeñas
295
357
- Monitorea el tiempo de ejecución para colecciones grandes
0 commit comments