๐ง D2X Workflow Patterns
Core Concepts
D2X workflows are built on two key principles:
- ๐งฉ Small, composable pieces that can be mixed and matched
- ๐ Security-first design with credential isolation
flowchart TB
subgraph "Workflow Architecture"
subgraph "Security Layer"
Auth["๐ Authentication"]
Session["๐ซ Session Management"]
end
subgraph "Core Components"
Validate["โ
Validation"]
Deploy["๐ Deployment"]
Test["๐งช Testing"]
Notify["๐ข Notification"]
end
subgraph "Outputs"
Results["๐ Results"]
Logs["๐ Logs"]
Artifacts["๐ฆ Artifacts"]
end
Auth --> Session
Session --> CoreOps["Core Operations"]
CoreOps --> Outputs
end
๐ Deployment Patterns
Feature Branch Deployment
sequenceDiagram
actor Dev
participant GH as GitHub
participant Auth as Auth Flow
participant SF as Salesforce
Dev->>GH: Create Feature Branch
Dev->>GH: Push Changes
GH->>Auth: Request Session
Auth->>SF: Create Scratch Org
Auth-->>GH: Return Session
GH->>SF: Deploy Changes
SF-->>GH: Validation Results
GH-->>Dev: Status Update
Production Deployment
sequenceDiagram
actor Lead
participant PR as Pull Request
participant GH as GitHub
participant Auth as Auth Flow
participant SF as Salesforce
Lead->>PR: Approve Changes
PR->>GH: Merge to Main
GH->>Auth: Request Prod Session
Auth->>GH: Require Approvals
Note over GH: Wait for Required Approvals
Auth-->>GH: Grant Session
GH->>SF: Deploy to Production
SF-->>GH: Deployment Results
Learn more about deployment patterns
๐งช Testing Frameworks
D2X provides reusable testing patterns that can be composed into comprehensive test suites:
flowchart TB
subgraph "Test Framework"
subgraph "Unit Tests"
Apex["Apex Tests"]
LWC["LWC Tests"]
end
subgraph "Integration Tests"
OrgConfig["Org Configuration"]
DataLoad["Test Data"]
Features["Feature Validation"]
end
subgraph "User Acceptance"
Sandbox["Sandbox Prep"]
UserFlow["User Flows"]
Validation["Acceptance Criteria"]
end
Unit["Unit Tests"] --> Integration["Integration Tests"]
Integration --> UAT["User Acceptance"]
UAT --> Release["Release Ready"]
end
Learn more about testing frameworks
๐ก๏ธ Security Workflows
Two-Stage Authentication
sequenceDiagram
participant Job as GitHub Job
participant Base as Base Environment
participant Session as Session Environment
participant SF as Salesforce
Job->>Base: Request Access
Base->>SF: Exchange Token
SF-->>Base: Access Token
Base->>Session: Store Token
Session-->>Job: Provide Access
Note over Session: Token Auto-Expires
Session->>Job: Revoke Access
Protected Deployments
sequenceDiagram
participant Dev as Developer
participant GH as GitHub
participant Env as Environment
participant SF as Salesforce
Dev->>GH: Request Deploy
GH->>Env: Check Protection Rules
alt Requires Approval
Env->>GH: Request Approvals
Note over GH: Wait for Approvers
end
GH->>SF: Execute Deploy
SF-->>GH: Results
Learn more about security workflows
๐ Change Management
Standard Change Flow
stateDiagram-v2
[*] --> FeatureBranch
FeatureBranch --> Development: Create PR
Development --> Review: Tests Pass
Review --> Staging: Approved
Staging --> Production: Final Approval
Production --> [*]: Deployed
Emergency Change Flow
stateDiagram-v2
[*] --> HotfixBranch
HotfixBranch --> Review: Critical Fix
Review --> Production: Emergency Approval
Production --> Development: Backport
Development --> [*]: Synced