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
1.`prep(shared)` returns a list of param dicts—e.g., `[{filename: "file1.txt"}, {filename: "file2.txt"}, ...]`.
106
-
2. The **BatchFlow** loops through each dict. For each one:
107
-
-It merges the dict with the BatchFlow's own `params`.
108
-
-It calls `flow.run(shared)` using the merged result.
109
-
3. This means the sub-Flow is run **repeatedly**, once for every param dict.
97
+
1.`prep(shared)` returns a list of param objects—e.g., `[{filename: "file1.txt"}, {filename: "file2.txt"}, ...]`.
98
+
2. The **BatchFlow** loops through each object and:
99
+
-Merges it with the BatchFlow's own `params`
100
+
-Calls `flow.run(shared)` using the merged result
101
+
3. This means the sub-Flow runs **repeatedly**, once for every param object.
110
102
111
103
---
112
104
113
-
## 3. Nested or Multi-Level Batches
114
-
115
-
You can nest a **BatchFlow** in another **BatchFlow**. For instance:
116
-
117
-
-**Outer** batch: returns a list of directory param dicts (e.g., `{"directory": "/pathA"}`, `{"directory": "/pathB"}`, ...).
118
-
-**Inner** batch: returning a list of per-file param dicts.
105
+
## 3. Nested Batches
119
106
120
-
At each level, **BatchFlow** merges its own param dict with the parent's. By the time you reach the **innermost** node, the final `params` is the merged result of **all** parents in the chain. This way, a nested structure can keep track of the entire context (e.g., directory + file name) at once.
107
+
You can nest BatchFlows to handle hierarchical data processing:
121
108
122
109
```typescript
123
-
// Define shared storage and parameter types
124
-
typeSharedStorage= {
125
-
[key:string]:any;
126
-
};
127
-
128
110
typeDirectoryParams= {
129
111
directory:string;
130
112
};
@@ -136,30 +118,28 @@ type FileParams = DirectoryParams & {
0 commit comments