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
batch, err:= workflow.NewBatchFuture(ctx, 3, factories) // Limit to 3 concurrent
207
-
if err != nil {
208
-
return err
209
-
}
210
-
return batch.Get(ctx, nil)
211
-
```
186
+
#### The Challenge
187
+
Batch Future changes your workflow's execution pattern from individual activities to controlled batching. This creates non-deterministic changes that will break existing running workflows without proper versioning.
188
+
189
+
#### Migration Approaches
190
+
191
+
**Option A: Versioned Migration (Recommended for Production)**
192
+
- Use [workflow.GetVersion()](https://cadenceworkflow.io/docs/go-client/workflow-versioning) to support both old and new patterns
193
+
- Deploy code that handles both execution patterns
194
+
- Gradually transition new workflows to use Batch Future
195
+
- Clean up old code after all workflows complete
196
+
197
+
**Option B: New Workflow Type (Simpler but Requires Coordination)**
198
+
- Create a new workflow type specifically for Batch Future
199
+
- Update callers to use the new workflow type
200
+
- Deprecate the old workflow type after migration
201
+
202
+
**Option C: Gradual Migration (For Large Systems)**
203
+
- Use workflow signals to trigger batch processing for new items
204
+
- Keep existing workflows running with individual processing
205
+
- Migrate callers incrementally
206
+
207
+
#### Testing Strategy
208
+
Before deploying, use [Workflow Shadowing](https://cadenceworkflow.io/docs/go-client/workflow-replay-shadowing) to replay production workflow histories against your new code. This catches compatibility issues before they reach production.
209
+
210
+
#### Key Considerations
211
+
-**Timeline**: Plan for weeks, not days
212
+
-**Coordination**: Requires careful coordination between teams
213
+
-**Monitoring**: Essential during transition period
214
+
-**Rollback**: Always have a rollback plan ready
215
+
-**Testing**: Extensive testing in staging environment required
216
+
217
+
#### When NOT to Migrate
218
+
- If you have long-running workflows (weeks/months)
219
+
- If you can't coordinate a proper versioning strategy
220
+
- If the performance benefits don't justify the migration complexity
0 commit comments