sf-agent-framework
Version:
AI Agent Orchestration Framework for Salesforce Development - Two-phase architecture with 70% context reduction
104 lines (78 loc) • 3.59 kB
Markdown
# Flow Best Practices Checklist
## Purpose
Ensure Salesforce Flows follow best practices for performance, maintainability,
and governance.
## Checklist Items
### Design and Architecture
- [ ] Flow type matches use case (Screen, Record-Triggered, Scheduled, Platform
Event, Autolaunched)
- [ ] Flow solves a specific business problem with clear requirements
- [ ] Alternative declarative solutions evaluated (Validation Rules, Process
Builder, Workflow)
- [ ] Flow complexity justified over simpler solutions
- [ ] Flow documented with description and purpose
### Performance Optimization
- [ ] Bulkification implemented for record operations
- [ ] Queries and DML operations outside of loops
- [ ] Get Records elements use selective filters with indexed fields
- [ ] Record collection variables used for bulk operations
- [ ] Flow handles large data volumes efficiently
- [ ] Fast Field Updates used where applicable
- [ ] Unnecessary elements removed to improve performance
### Error Handling
- [ ] Fault paths configured for all elements that can fail
- [ ] Error messages are user-friendly and actionable
- [ ] Platform events or logging for critical errors
- [ ] Rollback strategy defined for partial failures
- [ ] Test coverage includes error scenarios
### Governor Limits
- [ ] SOQL query limits considered (100 queries per transaction)
- [ ] DML statement limits considered (150 DML operations)
- [ ] CPU time limits considered (10,000 ms for synchronous)
- [ ] Heap size limits considered (6 MB for synchronous)
- [ ] Flow element limits considered (2,000 elements executed)
### Security and Access
- [ ] Flow runs in appropriate context (System, User)
- [ ] Field-level security respected where needed
- [ ] Sharing rules enforced appropriately
- [ ] Profile and permission set access documented
- [ ] Sensitive data handling follows security guidelines
### Maintainability
- [ ] Naming conventions followed for elements and variables
- [ ] Flow logic is modular and reusable
- [ ] Subflows used for common functionality
- [ ] Variables and resources have descriptive names
- [ ] Complex logic includes inline documentation
- [ ] Version history maintained with meaningful descriptions
### Testing and Deployment
- [ ] Unit tests cover positive and negative scenarios
- [ ] Bulk testing performed with large data sets
- [ ] Integration testing with connected systems
- [ ] Regression testing on existing functionality
- [ ] Debug logs reviewed for optimization opportunities
- [ ] Deployment steps documented
### User Experience (Screen Flows)
- [ ] Screen layout is intuitive and user-friendly
- [ ] Progress indicators for multi-screen flows
- [ ] Validation messages are clear and helpful
- [ ] Navigation options (Previous, Pause, Finish) appropriate
- [ ] Accessibility standards met
- [ ] Mobile responsiveness tested
### Integration Patterns
- [ ] External callouts use appropriate error handling
- [ ] Asynchronous patterns used for long-running operations
- [ ] Platform events for system integration where needed
- [ ] API version compatibility verified
- [ ] Integration credentials stored securely
### Monitoring and Analytics
- [ ] Flow metrics and analytics configured
- [ ] Debug logs strategy defined
- [ ] Performance baselines established
- [ ] User adoption tracking planned
- [ ] Error rate monitoring in place
## Completion Criteria
- All applicable items checked
- Exceptions documented with justification
- Technical debt items logged
- Review completed by senior developer/architect
- Sign-off from business stakeholder