sf-agent-framework
Version:
AI Agent Orchestration Framework for Salesforce Development - Two-phase architecture with 70% context reduction
614 lines (502 loc) • 11.7 kB
Markdown
**Task**: Build OmniScript for business process
**Complexity**: High
**Duration**: 1-3 days
**Output**: Functional OmniScript with full documentation
- [ ] Process flow documented
- [ ] Data requirements defined
- [ ] Integration points identified
- [ ] User stories approved
- [ ] Test scenarios prepared
```yaml
OmniScript Properties:
Name: OS_[Process]_[Type]_v1
Type: [Category]
SubType: [Specific Process]
Language: English
Settings:
- Allow Save for Later: Yes
- Allow Cancel: Yes
- Show Progress Bar: Yes
- Enable Knowledge: Yes
- Mobile Compatible: Yes
```
```json
{
"properties": {
"elementTypeToHTMLTemplateList": [],
"errorMessage": {
"custom": true,
"default": "An error occurred. Please try again."
},
"trackingCustomData": {
"source": "Web",
"campaign": "Q1-2024"
}
}
}
```
```yaml
Step Structure:
1. Introduction:
Type: Step
Elements:
- Text Block (welcome message)
- Disclosure (terms)
2. Customer Information:
Type: Step
Elements:
- Text Input (firstName)
- Text Input (lastName)
- Email (emailAddress)
- Telephone (phoneNumber)
3. Service Selection:
Type: StepGroup
Child Steps: 3.1 Product Choice 3.2 Configuration 3.3 Add-ons
4. Review & Confirm:
Type: Review Step
Show Previous Values: Yes
5. Submit:
Type: Step
Elements:
- Integration Procedure Action
- Navigate Action
```
#### Navigation Logic
```javascript
// Conditional navigation example
{
"conditions": {
"expression": "%customerType% == 'Enterprise'",
"true": {
"nextStep": "EnterpriseOptions"
},
"false": {
"nextStep": "StandardOptions"
}
}
}
```
```json
{
"name": "FirstName",
"propSetMap": {
"label": "First Name",
"required": true,
"maxLength": 50,
"pattern": "^[a-zA-Z\\s]+$",
"patternErrText": "Please enter a valid name",
"placeholder": "Enter your first name"
}
}
```
```json
{
"name": "ProductType",
"propSetMap": {
"label": "Select Product",
"required": true,
"options": [
{ "name": "Basic", "value": "basic" },
{ "name": "Professional", "value": "pro" },
{ "name": "Enterprise", "value": "enterprise" }
],
"controlWidth": 6
}
}
```
```json
{
"name": "PreferredContact",
"propSetMap": {
"label": "Preferred Contact Method",
"options": [
{ "name": "Email", "value": "email" },
{ "name": "Phone", "value": "phone" },
{ "name": "SMS", "value": "sms" }
],
"horizontalMode": true
}
}
```
```json
{
"name": "Instructions",
"propSetMap": {
"text": "Please complete all required fields. Your information is secure and will not be shared.",
"textKey": "InstructionsText",
"HTMLTemplateId": "custom-text-template"
}
}
```
```json
{
"name": "TotalCalculation",
"propSetMap": {
"formula": "(%BasePrice% * %Quantity%) * (1 - %DiscountPercent%/100)",
"outputType": "Currency",
"label": "Total Price"
}
}
```
```javascript
// Email validation
{
"name": "EmailValidation",
"expression": "REGEX(%Email%, '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$')",
"message": "Please enter a valid email address"
}
// Date range validation
{
"name": "DateValidation",
"expression": "%StartDate% >= TODAY() && %StartDate% <= TODAY() + 90",
"message": "Please select a date within the next 90 days"
}
```
```javascript
// Dependent field validation
{
"name": "DependentValidation",
"expression": "IF(%HasDependents% == true, %NumberOfDependents% > 0, true)",
"message": "Please specify number of dependents"
}
```
```json
{
"name": "ConditionalSection",
"propSetMap": {
"show": {
"expression": "%CustomerType% == 'Business' && %AnnualRevenue% > 1000000"
}
}
}
```
```json
{
"name": "SetDefaultValues",
"propSetMap": {
"elementValueMap": {
"Country": "United States",
"Currency": "USD",
"Language": "English"
}
}
}
```
```json
{
"name": "LoadCustomerData",
"type": "DataRaptor Extract",
"propSetMap": {
"bundle": "DR_CustomerData_Extract",
"inputMap": {
"customerId": "%ContextId%"
},
"outputPath": "CustomerInfo"
}
}
```
```json
{
"name": "ProcessOrder",
"type": "Integration Procedure Action",
"propSetMap": {
"bundle": "IP_ProcessOrder_v1",
"inputMap": {
"customerData": "%CustomerInfo%",
"orderDetails": "%OrderInfo%",
"preferences": "%Preferences%"
},
"outputPath": "ProcessResult",
"postMessage": "Processing your order...",
"completeMessage": "Order processed successfully!"
}
}
```
```json
{
"name": "ValidateAddress",
"type": "Remote Action",
"propSetMap": {
"remoteClass": "AddressValidationService",
"remoteMethod": "validateAddress",
"inputMap": {
"street": "%Street%",
"city": "%City%",
"state": "%State%",
"zipCode": "%ZipCode%"
},
"outputPath": "ValidationResult"
}
}
```
```json
{
"progressIndicator": {
"type": "path",
"showLabels": true,
"completedColor": "#4bca81",
"currentColor": "#0070d2",
"incompleteColor": "#dddbda"
}
}
```
```javascript
// Success messages
{
"messages": {
"success": {
"title": "Success!",
"description": "Your request has been submitted successfully.",
"variant": "success"
},
"error": {
"title": "Error",
"description": "An error occurred. Please try again.",
"variant": "error"
}
}
}
```
```json
{
"loadingIndicator": {
"message": "Loading your information...",
"spinnerSize": "medium",
"showOverlay": true
}
}
```
```yaml
Test Cases:
Step 1 - Introduction:
- Verify text displays correctly
- Check disclosure acceptance required
- Test navigation to next step
Step 2 - Data Collection:
- Test all field validations
- Verify required fields
- Check field dependencies
- Test error messages
Step 3 - Integration:
- Mock integration responses
- Test error scenarios
- Verify data mapping
- Check timeout handling
```
```javascript
// Test script example
describe('Customer Onboarding OmniScript', () => {
it('should complete full flow successfully', () => {
// Step 1: Introduction
clickNext();
// Step 2: Enter customer data
fillField('FirstName', 'John');
fillField('LastName', 'Doe');
fillField('Email', 'john.doe@example.com');
clickNext();
// Step 3: Select services
selectOption('ServiceType', 'Premium');
clickNext();
// Step 4: Review
verifyReviewData();
clickSubmit();
// Verify success
expectSuccessMessage();
});
});
```
```yaml
Performance Metrics:
- Initial Load: < 2 seconds
- Step Transition: < 500ms
- Data Save: < 1 second
- Integration Call: < 3 seconds
Load Testing:
- Single User: Baseline performance
- 10 Concurrent: < 10% degradation
- 50 Concurrent: < 25% degradation
```
```json
{
"languageConfig": {
"supportedLanguages": ["en_US", "es_ES", "fr_FR"],
"defaultLanguage": "en_US",
"customLabels": {
"NextButton": {
"en_US": "Next",
"es_ES": "Siguiente",
"fr_FR": "Suivant"
}
}
}
}
```
```json
{
"name": "GeneratePDF",
"type": "DocuSign Action",
"propSetMap": {
"templateId": "contract-template-v1",
"inputMap": {
"customerName": "%FirstName% %LastName%",
"contractDetails": "%OrderSummary%"
},
"outputPath": "GeneratedDocument"
}
}
```
```json
{
"name": "SendConfirmationEmail",
"type": "Email Action",
"propSetMap": {
"emailTemplate": "OrderConfirmation",
"recipients": ["%Email%"],
"mergeFields": {
"CustomerName": "%FirstName%",
"OrderNumber": "%OrderNumber%",
"TotalAmount": "%TotalPrice%"
}
}
}
```
```javascript
// Comprehensive error handling
{
"errorHandling": {
"step": {
"onError": "showMessage",
"allowRetry": true,
"logError": true
},
"integration": {
"timeout": 30000,
"retryCount": 3,
"fallbackAction": "showManualProcess"
}
}
}
```
```json
{
"saveForLater": {
"enabled": true,
"autoSave": true,
"autoSaveInterval": 60,
"expirationDays": 30
}
}
```
```html
<!-- Accessibility enhancements -->
<div role="form" aria-label="Customer Information Form">
<label for="firstName" class="slds-required">
First Name
<abbr title="required" aria-label="required">*</abbr>
</label>
<input id="firstName" type="text" required aria-required="true" aria-describedby="firstName-error" />
<div id="firstName-error" role="alert" aria-live="polite"></div>
</div>
```
```markdown
Multi-step process for onboarding new customers with service selection and
account setup.
1. **Introduction** - Welcome and terms acceptance
2. **Customer Info** - Basic information collection
3. **Service Selection** - Product and configuration choices
4. **Review** - Summary and confirmation
5. **Submit** - Process order and create records
- DR_CustomerData_Extract - Pre-populate existing data
- IP_ProcessOrder_v1 - Submit order for processing
- Email Service - Send confirmation
- Email validation required
- Phone number format: (xxx) xxx-xxxx
- Minimum order value: $100
- Maximum discount: 20%
- Average completion time: 5 minutes
- Success rate: 95%
- Most common drop-off: Step 3 (Service Selection)
```
- [ ] All testing completed
- [ ] Performance validated
- [ ] Documentation updated
- [ ] Permissions configured
- [ ] Training materials ready
1. Export OmniScript package
2. Deploy to production
3. Activate OmniScript
4. Configure permissions
5. Test in production
- [ ] Smoke test completed
- [ ] Monitoring enabled
- [ ] Support team briefed
- [ ] User feedback collected
- [ ] KPIs tracking
- Requirements coverage: 100%
- Test pass rate: > 95%
- Performance SLA met: Yes
- Zero critical bugs
- On-time delivery
- User adoption rate
- Completion rate
- Average time to complete
- Error rate
- Customer satisfaction