Why Versioning?
Workflows can run for extended periods (days, weeks, or months). During this time, you may need to:- Fix bugs in workflow logic
- Add new features
- Optimize performance
- Change business rules
- Existing workflow instances complete with their original logic
- New workflow instances use the latest implementation
- No breaking changes affect running workflows
How Versioning Works
Infinitic uses a simple naming convention for workflow versions:- Create your workflow interface (unchanged)
- Implement multiple versions with
_Nsuffix (where N is the version number) - New workflows automatically use the highest version number
- Running workflows continue with their original version
Creating Versioned Workflows
Version Selection
Infinitic automatically selects the version:- New workflows: Use the highest version number available
- Running workflows: Continue with their original version
Naming Convention
The version suffix must follow this pattern:Base implementation (no suffix)
Base implementation (no suffix)
Version 1
Version 1
Version 2
Version 2
Version N
Version N
Version Lifecycle
Practical Example
Here’s a complete example showing workflow evolution:Initial Implementation
Version 1: Add Notification
Version 2: Add Fraud Check
Migration Strategies
Strategy 1: Wait for Natural Completion
Allow old workflows to complete naturally:Strategy 2: Graceful Deprecation
Mark old versions but keep them available:Strategy 3: Feature Flags
Use inline logic to enable features conditionally:Testing Different Versions
You can test specific versions by creating instances directly:Version Cleanup
Once all workflows of an old version have completed:Best Practices
Keep version history
Keep version history
Don’t delete old versions while any instances are running:
Document version changes
Document version changes
Add comments explaining what changed in each version:
Test version compatibility
Test version compatibility
Ensure new versions maintain interface compatibility:
Use incremental version numbers
Use incremental version numbers
Always increment from the highest existing version:
Monitoring Versions
Track which versions are in use:Common Pitfalls
Next Steps
Workflow Overview
Learn more about workflow fundamentals
Defining Workflows
Create new workflows
Testing
Test your workflows and versions
Deployment
Deploy workflow versions