Skip to content

Repository files navigation

πŸ—οΈ SmartOnboard: Enterprise Financial Services Multi-Cloud Onboarding & Customer 360 Platform

Salesforce MuleSoft OmniStudio Data Cloud GitHub Actions Build Status


πŸ“Œ Executive Summary & Architectural Overview

SmartOnboard is a multi-cloud financial services onboarding, automated risk assessment, and customer identity-stitching platform. Built across multi-org Salesforce environments and local MuleSoft runtimes, it solves critical enterprise challenges:

  • Fragmented Customer UI: Replaced manual intake forms with a responsive, multi-step OmniStudio OmniScript interface.
  • Siloed Legacy Data: Connected real-time CRM transactions with historical offline banking records using Salesforce Data Cloud deterministic Identity Resolution.
  • Complex Multi-System Underwriting: Orchestrated real-time credit bureau score lookups and automated risk tiering via a 3-Tier MuleSoft Anypoint ESB architecture.
  • Cross-Org Transactional Integrity: Leveraged declarative zero-Apex Integration Procedures utilizing Salesforce REST API v60.0 Composite requests (allOrNone: true) for idempotent upserts across distinct Salesforce organizations.
  • Automated CI/CD Governance: Implemented headless automated DevOps pipelines with GitHub Actions (deploy.yml) using Node.js v22 LTS and the Salesforce CLI (sf).

πŸ›οΈ Comprehensive Multi-Cloud Architecture

graph TB
    subgraph FSC_Org["FSC Trial Org (Experience & UI Hub - atrium32...)"]
        OS["OmniScript: SmartOnboard Loan Application<br>(4-Step Guided UI)"]
        IP["Integration Procedure: Evaluate_LoanRisk<br>(Zero-Apex Orchestrator)"]
        OS --> IP
    end

    subgraph MuleSoft_ESB["MuleSoft Anypoint 3-Tier ESB (Local Studio + ngrok Tunnel)"]
        EXP["Experience API :8083<br>Header Auth: client_id"]
        PROC["Process API :8082<br>Risk Categorization Logic"]
        SYS["System API :8081<br>Mock Credit Bureau DataWeave"]

        IP -- "1. HTTP POST loan-applications" --> EXP
        EXP --> PROC
        PROC --> SYS
    end

    subgraph Main_Dev_Org["Main Dev Org (System of Record & Data Cloud Hub - orgfarm...)"]
        CRMSchema["Salesforce CRM Schema<br>Applicant__c & Loan_Application__c"]
        ApexTrigger["LoanApplicationTrigger<br>(Debt-to-Income Risk Engine)"]
        LWCDash["LWC: loanApplicationDashboard<br>(Executive Underwriter View)"]

        IP -- "2. REST Composite v60.0<br>(Idempotent PATCH + Lookup Link)" --> CRMSchema
        CRMSchema --> ApexTrigger
        ApexTrigger --> LWCDash

        subgraph DataCloud_Layer["Salesforce Data Cloud Engine"]
            DLO["Data Lake Objects (DLOs)<br>15-Min Scheduled Upserts"]
            CSV["Legacy_Bank_Applicants.csv<br>(Offline Banking Data File)"]
            DMO["Harmonized DMOs<br>Individual, Contact Point, Party ID"]
            IR01["Identity Resolution Ruleset (IR01)<br>Exact PAN Number Match"]
            FlowCard["Screen Flow UI Widget<br>Applicant_Data_Cloud_360_Card"]

            CRMSchema --> DLO
            CSV --> DLO
            DLO --> DMO
            DMO --> IR01
            IR01 --> FlowCard
        end
    end

    subgraph DevOps_Layer["GitHub Actions CI/CD Pipeline"]
        Git["Push / PR to 'main'"] --> GHA["deploy.yml (Node v22 + SF CLI)"]
        GHA -- "sf project deploy start<br>(Encrypted SFDX_AUTH_URL)" --> Main_Dev_Org
    end
Loading

πŸ”„ End-to-End Transaction Sequence Diagram

sequenceDiagram
    autonumber
    actor Customer as Applicant / Loan Agent
    participant OS as OmniScript (FSC Org)
    participant IP as Integration Procedure
    participant MEXP as MuleSoft Experience API
    participant MPROC as MuleSoft Process API
    participant MSYS as MuleSoft System API
    participant DevOrg as Main Dev Org (REST API v60.0)
    participant DataCloud as Salesforce Data Cloud

    Customer->>OS: 1. Submit Application (Name, PAN: ABCPR1234K, Income, Loan Amt)
    OS->>IP: 2. Trigger Evaluate_LoanRisk (Payload: PAN, Financials)
    IP->>MEXP: 3. HTTP POST /loan-applications (Header: client_id=smartonboard-secret-key-2026)
    MEXP->>MPROC: 4. HTTP GET /risk-assessment/ABCPR1234K
    MPROC->>MSYS: 5. HTTP GET /credit-report/ABCPR1234K
    MSYS-->>MPROC: 6. Return Mock Credit Report (Score: 720, DefaultHistory: false)
    MPROC-->>MEXP: 7. Apply Rules -> Risk: Low Risk, Advice: Auto-Approve
    MEXP-->>IP: 8. Return Enriched Evaluation JSON
    IP->>DevOrg: 9. HTTP POST /services/data/v60.0/composite (allOrNone: true)
    Note over DevOrg: Sub-Request 1: PATCH Applicant__c/PAN_Number__c/ABCPR1234K<br>Sub-Request 2: POST Loan_Application__c (Applicant__c = @{refApplicant.id})
    DevOrg-->>IP: 10. Commit Success (Idempotent Upsert + Child Insert)
    IP-->>OS: 11. Return Live Dashboard Summary
    OS-->>Customer: 12. Display Status, Credit Score (720), and Low Risk Badge
    Note over DevOrg,DataCloud: Asynchronous 15-Min Scheduled Sync
    DevOrg->>DataCloud: 13. Data Streams Ingest CRM + CSV Records into DLOs
    DataCloud->>DataCloud: 14. Execute Identity Resolution IR01 (Exact PAN Match)
    DataCloud-->>DevOrg: 15. Render Stitched Customer 360 UI Flow Widget on Applicant__c Page
Loading

πŸ—„οΈ Enterprise Data Model & Relational Schema (Main Dev Org)

erDiagram
    Applicant__c ||--o{ Loan_Application__c : "1 to Many (Lookup)"

    Applicant__c {
        Id Id PK
        String Name "Standard Text"
        Date Date_of_Birth__c "Required"
        String PAN_Number__c "Unique / External ID (Indexed)"
        Currency Monthly_Income__c "Required (16,2)"
        Phone Phone__c "Required"
        Email Email__c "Required"
    }

    Loan_Application__c {
        Id Id PK
        AutoNumber Name "Format: LA-{0000}"
        Lookup Applicant__c "Parent Lookup (Required)"
        Currency Loan_Amount__c "Required (18,0)"
        Number Tenure_Months__c "Required (3,0)"
        Picklist Loan_Type__c "Personal, Home, Vehicle, Insurance"
        Picklist Status__c "Submitted, Under Review, Approved, Rejected"
        String Risk_Category__c "MuleSoft Enriched (Low/Medium/High)"
        Number Credit_Score__c "MuleSoft Enriched FICO Score"
        Number Risk_Score__c "Apex Calculated Formula (0-100)"
    }
Loading

βœ… Verified Production/Test Dataset

Applicant Name PAN Number (External ID) Monthly Income Loan Application Loan Amount FICO Score Risk Category Risk Score
Rahul Sharma ABCPR1234K β‚Ή65,000 LA-0001 β‚Ή5,00,000 680 Medium Risk 12
Priya Verma XYZPV5678L β‚Ή40,000 LA-0002 β‚Ή1,50,000 650 Medium Risk 6
Ishan Jain ABCPR1234K β‚Ή6,50,000 LA-0003 β‚Ή50,000 720 Low Risk 1

πŸ› οΈ Programmatic Core Layer (Apex, Triggers & LWC)

1. Bulk-Safe Trigger Architecture (LoanApplicationTrigger.trigger)

  • Execution Events: before insert, before update on Loan_Application__c.
  • Bulkification Optimization: Prevents SOQL query limits inside loops by using a Set<Id> to collect parent Applicant__c reference IDs, executing a single query, and mapping records via Map<Id, Applicant__c>.
  • Debt-to-Income Mathematical Risk Engine:

$$\text{Risk_Score__c} = \min\left(\frac{\text{Loan Amount}}{\text{Annual Income}} \times 20,\ 100\right)$$

2. Secure Data Access Controller (LoanApplicationController.cls)

  • Security Enforcement: Declared with sharing at the class level to enforce org-wide default (OWD) sharing rules.
  • LWC Caching: Methods annotated with @AuraEnabled(cacheable=true) for instantaneous Lightning Web Component rendering.
  • Relationship Traversal: Queries Loan_Application__c along with parent attributes (Applicant__r.Name, Applicant__r.PAN_Number__c, Applicant__r.Monthly_Income__c).

3. Programmatic REST Callout Service (MuleSoftIntegrationService.cls)

  • Apex REST Client: Sends HTTP POST callouts via Named Credential bindings (callout:MuleSoft_Experience_API/loan-applications).
  • Error Handling: Inspects HTTP status codes (200 OK vs. 401 Unauthorized) and serializes Data Transfer Objects (DTOs).

4. Lightning Web Component Dashboard (loanApplicationDashboard)

  • Reactive Data Table: SLDS-compliant interactive dashboard rendering live application status, calculated risk scores, and MuleSoft credit metrics.
  • Page Deployment: Embedded on the enterprise App Builder layout at /lightning/n/Loan_Dashboard.

πŸ” Security & Access Control Model

Permission Set / Credential Target Users / Systems Access Scope & Security Enforcement
Loan_Agent_Permission_Set Loan Officers / Agents Read, Create, Edit on Applicant__c and Loan_Application__c. Field-Level Security (FLS) Read-Only enforcement on Risk_Score__c and Status__c to prevent unauthorized manual tampering.
Underwriter_Permission_Set Risk Underwriters Full Read, Create, Edit, Delete access across all objects. Full FLS edit rights on Status__c and Risk_Score__c for manual underwriting overrides.
MuleSoft_Auth (External Credential) FSC Org β†’ MuleSoft Custom header authentication policy inserting client_id = smartonboard-secret-key-2026.
Main_Dev_Org_EC (External Credential) FSC Org β†’ Dev Org OAuth 2.0 Client Credentials / Named Principal authentication granting cross-org S2S Composite REST access.

🌐 MuleSoft 3-Tier ESB Architecture (Anypoint Studio)

[ FSC Org: Integration Procedure ]
                 β”‚
                 β–Ό HTTP POST /loan-applications (client_id header)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ EXPERIENCE API (:8083) β€” smartonboard-experience-api-impl     β”‚
β”‚ β€’ Validates smartonboard-secret-key-2026 via Choice Router     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό HTTP GET /risk-assessment/{panNumber}
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PROCESS API (:8082) β€” loan-risk-assessment-process-api-impl   β”‚
β”‚ β€’ Maps Score -> Low (>=700), Medium (600-699), High            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό HTTP GET /credit-report/{panNumber}
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SYSTEM API (:8081) β€” credit-bureau-system-api-impl             β”‚
β”‚ β€’ DataWeave Mock Lookup (ABCPR1234K -> 720; Fallback -> 580)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

API Layer Breakdown

  • System API (Port 8081): Published RAML v1.0.0 specification (credit-bureau-system-api). DataWeave transforms incoming PAN identifiers into JSON FICO bureau responses (ABCPR1234K β†’ 720, hasDefaultHistory: false).
  • Process API (Port 8082): Applies business rules to classify applicants into risk tiers β€” Low Risk for scores β‰₯ 700; Medium Risk for 600–699; High Risk for < 600 or active default history.
  • Experience API (Port 8083): Exposed publicly via an ngrok secure HTTPS tunnel. Implements a Choice Router verifying the client_id header, returning 401 Unauthorized for invalid callers.

⚑ OmniStudio UI & Cross-Org Orchestration (FSC Org)

1. Guided UI (SmartOnboard Loan Application)

  • Step 1 (PersonalInfo): Full Name, DOB, Monthly Income, Phone, and unique PAN Number.
  • Step 2 (LoanDetails): Requested Loan Amount, Tenure (Months), and Loan Type selection.
  • Step 3 (DocumentUpload): Mandatory KYC and financial proof file upload handlers.
  • Step 4 (ReviewSubmit): Executes Evaluate_LoanRisk and displays live HTML results:
<h3>Application Summary</h3>
<p><b>Status:</b> Application Submitted & Saved Successfully!</p>
<p><b>Risk Category:</b> %RiskAssessmentResult:riskCategory%</p>
<p><b>Credit Score:</b> %RiskAssessmentResult:creditScore%</p>
<p><b>Recommendation:</b> %RiskAssessmentResult:recommendedAction%</p>

2. Declarative Integration Procedure (Evaluate_LoanRisk)

  • Step 1 (CallMuleSoftAPI – HTTP Action): Posts JSON payload to callout:MuleSoft_Experience_API/loan-applications.
  • Step 2 (BuildCompositePayload – Set Values): Constructs a Salesforce REST API v60.0 Composite request with "allOrNone": true.
  • Step 3 (SaveToMainOrg – HTTP Action): Posts to callout:Main_Dev_Org_NC/services/data/v60.0/composite:
    • Sub-Request 1 (refApplicant): Executes an idempotent PATCH upsert to /services/data/v60.0/sobjects/Applicant__c/PAN_Number__c/%PersonalInfo:PANNumber%, eliminating duplicates.
    • Sub-Request 2 (refLoanApp): Executes a POST insert to Loan_Application__c, linking the parent relationship dynamically via @referenceId: "Applicant__c": "@{refApplicant.id}".

☁️ Salesforce Data Cloud Customer 360 Pipeline (Main Dev Org)

graph LR
    subgraph Ingestion["Data Streams (15-Min Upserts)"]
        CRM_App["Applicant__c (CRM)"]
        CRM_Loan["Loan_Application__c (CRM)"]
        CSV_Bank["Legacy_Bank_Applicants.csv (File)"]
    end

    subgraph DMO_Harmonization["Data Model Objects (DMOs)"]
        Ind["Individual DMO"]
        Email["Contact Point Email DMO"]
        Phone["Contact Point Phone DMO"]
        PartyID["Party Identification DMO<br>(Identification Number = PAN)"]
    end

    subgraph Resolution["Identity Resolution Engine"]
        IR01["Ruleset: IR01 / R001<br>Exact Match: PAN Number<br>Reconciliation: Most Recent"]
    end

    subgraph UI_Surface["Custom CRM Record Layout"]
        ScreenFlow["Screen Flow Widget<br>Applicant_Data_Cloud_360_Card"]
    end

    CRM_App --> Ind & Email & Phone & PartyID
    CSV_Bank --> Ind & Email & Phone & PartyID
    Ind & PartyID --> IR01
    IR01 --> ScreenFlow
Loading

1. Ingestion & Harmonization Mapping

  • Data Streams: Active 15-minute scheduled upserts for CRM records (Applicant__c_Home, Loan_Application__c_Home) and synthetic offline banking CSV files (Legacy_Bank_Applicants.csv).
  • Primary Key Workarounds: Mapped email strings directly to Contact Point Email Id and phone strings directly to Contact Point Phone Id to resolve Data Cloud unique primary key constraints without creating surrogate keys.
Data Model Object (DMO) Ingestion Sources Key Attributes Identity Stitching Rule
Individual DMO CRM (Applicant__c), CSV (Legacy_ID) Individual Id, First Name, Last Name, Birth Date Root Profile Entity
Contact Point Email DMO CRM, CSV Email Address, Party (Foreign Key) Direct String Key Mapping
Contact Point Phone DMO CRM, CSV Telephone Number, Party (Foreign Key) Direct String Key Mapping
Party Identification DMO CRM (PAN_Number__c), CSV (PAN_Number) Identification Number, Party, Identification Name Exact Match Bridge (IR01)

2. Identity Resolution Engine (IR01 / R001)

  • Match Rule: Configured for an Exact Match on Party Identification - Identification Number (matching CRM PAN_Number__c against legacy CSV PAN_Number).
  • Reconciliation Rule: Set to Most Recently Updated, ensuring live OmniScript submissions overwrite stale legacy records.
  • Verified Stitching: Successfully unified legacy CSV record LEG-001 (Ishan Jain) with live CRM record 003... under a single Unified Individual ID (e76d1cb6...).

3. Native Customer 360 Custom Object UI Widget

Because standard Data Cloud Lightning components only render on standard CRM objects (Contact, Account), a dedicated Screen Flow (Applicant_Data_Cloud_360_Card) was deployed natively onto the Applicant__c record layout.

UI Card Display Text:

⚑ Unified Identity Status: Stitched & Verified (IR01_Active)
πŸ“₯ Ingestion Source: CRM Data Stream (Applicant__c_Home)
πŸ“Š Calculated Risk Evaluation: HIGH RISK APPLICANT
πŸš€ Automated Action Triggered: Platform Event DataObjectDataChgEvent βž” Underwriter Task Dispatched

πŸ€– Automated DevOps CI/CD Pipeline (deploy.yml)

Pipeline Workflow Configuration

  • Runner Environment: Ubuntu Latest (ubuntu-latest) running Node.js v22 LTS (resolving @salesforce/cli undici/webidl compatibility).
  • Headless Org Authentication: Uses an encrypted GitHub Repository Secret (SFDX_AUTH_URL) storing a headless force:// authorization token.
  • Pull Request Quality Gates: Executes sf project deploy validate --source-dir force-app --test-level RunLocalTests to prevent broken metadata merges.
  • Continuous Delivery: Merges to main automatically run sf project deploy start --source-dir force-app --ignore-conflicts.
name: Salesforce CI/CD Automated Pipeline

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  salesforce-devops:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Setup Node.js v22 LTS
        uses: actions/setup-node@v4
        with:
          node-version: '22'

      - name: Install Salesforce CLI
        run: npm install -g @salesforce/cli

      - name: Authenticate to Salesforce Org
        run: |
          echo "${{ secrets.SFDX_AUTH_URL }}" > ./SFDX_AUTH_URL.txt
          sf org login sfdx-url --sfdx-url-file ./SFDX_AUTH_URL.txt --alias CI_Org --set-default
          rm -f ./SFDX_AUTH_URL.txt

      - name: Validate Metadata (Pull Request Only)
        if: github.event_name == 'pull_request'
        run: sf project deploy validate --source-dir force-app --target-org CI_Org --test-level RunLocalTests

      - name: Deploy Metadata to Target Org (Push to Main)
        if: github.event_name == 'push'
        run: sf project deploy start --source-dir force-app --target-org CI_Org --ignore-conflicts

πŸ† Project Implementation Milestone Tracker

  • Phase 1: Salesforce Core Data Model, Security & Apex Triggers Built custom schema (Applicant__c, Loan_Application__c), unique external ID keys, bulk-safe triggers, and Permission Sets.
  • Phase 2: Lightning Web Component (LWC) Executive Dashboard Deployed loanApplicationDashboard table rendering real-time risk scores and credit metrics.
  • Phase 3: MuleSoft 3-Tier Enterprise ESB Architecture & Security Gate Deployed local System (8081), Process (8082), and Experience (8083) APIs with client_id header validation and ngrok tunneling.
  • Phase 4: OmniStudio UI, Integration Procedure & S2S Composite Pipeline Configured 4-step guided OmniScript and zero-Apex Integration Procedure executing cross-org REST Composite upserts.
  • Phase 5a: Data Cloud Multi-Stream Ingestion (CRM + CSV) Configured active data streams running 15-minute scheduled upserts for CRM entities and legacy banking CSV files.
  • Phase 5b: Data Cloud Harmonization & DMO Schema Mapping Complete field harmonization across Individual, Contact Point Email, Contact Point Phone, and Party Identification DMOs.
  • Phase 5c: Data Cloud Identity Resolution Setup & Verification Deployed ruleset IR01, verifying deterministic identity stitching across CRM and CSV records via PAN Number matching.
  • Phase 5d: Customer 360 UI Flow Widget on Custom CRM Layouts Deployed Applicant_Data_Cloud_360_Card Screen Flow widget natively onto Applicant__c Lightning Record Page layouts.
  • Phase 6: Automated DevOps & CI/CD Pipeline (deploy.yml) Configured GitHub Actions runner on Node.js v22 LTS with headless SFDX authentication and automated pull request validation.
  • Phase 7: Complete Documentation & Architecture Handover Delivered comprehensive ERD schemas, sequence diagrams, and multi-cloud integration guides.

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

About

Enterprise Multi-Cloud Financial Services Onboarding Platform featuring Salesforce CRM, OmniStudio, MuleSoft 3-Tier ESB, Data Cloud Customer 360, and automated GitHub Actions CI/CD.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages