agentsclimarketplace

Salesforce architecture variants

Skill jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/salesforce-pack/skills/salesforce-architecture-variants

425 plugins, 2,810 skills, 200 agents for Claude Code. Open-source marketplace at tonsofskills.com with the ccpi CLI package manager.

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill salesforce-architecture-variants

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

'Choose and implement Salesforce integration architecture patterns for different scales.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

8.7 KB, as published. Nobody here has run it

Salesforce Architecture Variants

Overview

Three validated architecture blueprints for Salesforce integrations: Direct API (simple), Event-Driven (scalable), and Middleware/iPaaS (enterprise). Each pattern addresses different scale, latency, and complexity requirements.

Prerequisites

  • Understanding of your data volume and sync frequency requirements
  • Decision on unidirectional vs bidirectional data flow
  • Knowledge of Salesforce edition (affects available features like CDC)

Variant A: Direct API Integration (Simple)

Best for: MVPs, < 50K records/day, single-direction sync

┌─────────────┐     jsforce       ┌─────────────┐
│   Your App  │ ──── REST API ──▶ │  Salesforce  │
│ (Node.js)   │ ◀── SOQL/SOSL ── │     Org      │
└─────────────┘                   └─────────────┘

Data flow:
- App queries SF via SOQL (polling or on-demand)
- App writes to SF via sObject CRUD
- Scheduled cron for periodic sync

Key Characteristics

  • Single jsforce connection per process
  • Polling-based reads (cron schedule)
  • Direct REST writes
  • In-memory or Redis caching for describe/metadata
  • Suitable for: internal tools, admin dashboards, simple data sync

Code Pattern

// Cron-based sync — runs every 15 minutes
import cron from 'node-cron';

cron.schedule('*/15 * * * *', async () => {
  const conn = await getConnection();

  // Fetch recently modified accounts
  const accounts = await conn.query(`
    SELECT Id, Name, Industry, AnnualRevenue
    FROM Account
    WHERE LastModifiedDate >= ${fifteenMinutesAgo}
  `);

  // Sync to local database
  for (const account of accounts.records) {
    await localDb.upsert('accounts', mapFromSalesforce(account));
  }
});

Variant B: Event-Driven Integration (Scalable)

Best for: Real-time sync, 50K-5M records/day, bidirectional flow

┌─────────────┐                      ┌─────────────┐
│   Your App  │ ◀─── CDC Events ───  │  Salesforce  │
│  (listener) │   Change Data Capture │     Org      │
│             │                      │              │
│             │ ── Bulk API 2.0 ──▶  │              │
│             │    (write-back)      │              │
└──────┬──────┘                      └─────────────┘
       │
  ┌────▼────┐
  │  Queue  │  (Redis/SQS/Pub-Sub)
  │  (async │
  │  writes)│
  └─────────┘

Key Characteristics

  • CDC for real-time change notifications (no polling waste)
  • Bulk API 2.0 for high-volume writes
  • Queue-based async processing for write-back
  • ReplayId tracking for event resumption
  • Suitable for: CRM sync, data warehouse ETL, real-time dashboards

Code Pattern

// Event-driven — near-real-time sync
import { getConnection } from './salesforce/connection';

const conn = await getConnection();

// Subscribe to Account changes via CDC
conn.streaming.topic('/data/AccountChangeEvent').subscribe(async (event) => {
  const { changeType, recordIds, changedFields } = event.payload.ChangeEventHeader;

  switch (changeType) {
    case 'CREATE':
      await localDb.insert('accounts', mapFromSalesforce(event.payload));
      break;
    case 'UPDATE':
      await localDb.update('accounts', recordIds[0], mapChangedFields(event.payload, changedFields));
      break;
    case 'DELETE':
      await localDb.delete('accounts', recordIds[0]);
      break;
  }
});

// Write-back via queue (async, decoupled)
queue.process('sync-to-salesforce', async (job) => {
  const conn = await getConnection();
  await conn.sobject(job.data.objectType).upsert(
    job.data.records,
    'External_ID__c'
  );
});

Required Salesforce Features

  • Change Data Capture (Enterprise Edition+)
  • Platform Events (all editions)
  • Bulk API 2.0 (all editions with API access)

Variant C: Middleware/iPaaS Integration (Enterprise)

Best for: Multi-system integration, 5M+ records/day, complex transformations

┌─────────────┐                ┌─────────────┐               ┌─────────────┐
│   Your App  │ ── API ──────▶ │  Middleware  │ ── REST ────▶ │  Salesforce  │
│             │                │ (MuleSoft/   │               │     Org      │
│             │                │  Workato/    │ ◀─ CDC ──────│              │
│             │ ◀─ Webhooks ── │  Zapier)     │               │              │
└─────────────┘                └──────┬───────┘               └─────────────┘
                                      │
                                ┌─────▼──────┐
                                │  Other      │
                                │  Systems    │
                                │ (ERP, DW,   │
                                │  Marketing) │
                                └─────────────┘

Key Characteristics

  • Middleware handles transformation, routing, error handling
  • Pre-built Salesforce connectors (no custom code for basic sync)
  • Visual flow builders for business users
  • Enterprise monitoring and audit trails
  • Suitable for: multi-system integration, complex business rules, compliance-heavy

iPaaS Options

PlatformSalesforce IntegrationBest For
MuleSoftNative (Salesforce owns it)Enterprise, complex flows
Heroku ConnectBi-directional auto-syncSimple sync to Postgres
WorkatoPre-built recipesBusiness user automation
ZapierTrigger-basedSimple 1:1 integrations
Dell BoomiEnterprise iPaaSLegacy system integration

Decision Matrix

FactorDirect API (A)Event-Driven (B)Middleware (C)
Records/day< 50K50K-5M5M+
LatencyMinutes (polling)Seconds (CDC)Depends on config
DirectionUsually one-wayBidirectionalMulti-directional
API call efficiencyMediumHigh (no polling)High (batched)
ComplexityLowMediumLow (config-driven)
Costjsforce onlyjsforce + queue infraiPaaS license ($$$)
SF Edition requiredAny with APIEnterprise+ (CDC)Any
Team skillsNode.js developersNode.js + streamingBusiness analysts OK

Migration Path

Variant A (Direct API)
    │
    │  Growing data volume / need real-time sync
    ▼
Variant B (Event-Driven)
    │
    │  Multiple systems / compliance / no-code needed
    ▼
Variant C (Middleware/iPaaS)

Output

  • Architecture variant selected based on requirements
  • Integration pattern implemented
  • Data flow documented
  • Scaling path planned

Error Handling

IssueCauseSolution
Polling misses changesInterval too longSwitch to CDC (Variant B)
CDC events lostNo replay trackingPersist last replayId
API limits exhaustedPolling too frequentlyBatch with Collections/Bulk API
Middleware cost too highOver-engineeredStart with Variant A or B

Resources

Next Steps

For common anti-patterns, see salesforce-known-pitfalls.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.