sf-integration-patterns

Designs and implements Salesforce integrations using named credentials, platform events, and REST APIs.

2|Updated Sep 12, 2026
One-click install
npx skills add https://github.com/grzmol/vibe-force --skill sf-integration-patterns-grzmol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-integration-patterns
Source: https://github.com/grzmol/vibe-force/tree/main/skills/sf-integration-patterns
Command: npx skills add https://github.com/grzmol/vibe-force --skill sf-integration-patterns-grzmol

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Choosing and implementing the right Salesforce integration pattern is error-prone: callouts fail after DML, secrets leak into code, retries loop forever, and inbound APIs get picked by familiarity instead of fit. This Skill provides pattern selection guidance, production-grade Apex implementations, and verification commands for both inbound and outbound integrations. ## Core Features & Use Cases - Pattern Selection: Decision tables map latency, volume, and transactionality requirements to the six official Salesforce integration patterns (Request-Reply, Fire and Forget, Batch Sync, Remote Call-In, UI Update, Data Virtualisation). - Outbound Integration: Named Credential and External Credential setup, Queueable callouts with Finalizer-based retry, exponential backoff, dead-letter queues, and idempotency keys. - Inbound APIs: REST, Composite, Composite Graph, sObject Collections, Bulk API 2.0, Apex REST, GraphQL, and Pub/Sub API with limits and curl/sf CLI examples. - Testing & Verification: HttpCalloutMock router mocks, platform event tests, and post-deploy smoke probes against real orgs. - Use Case: A story requires syncing orders to an external billing system. The Skill guides you to a fire-and-forget platform event pattern, provides the publisher Apex, a retryable subscriber with dead-lettering, and the sf CLI commands to verify the integration in a sandbox. ## Quick Start Ask the assistant to design an integration that calls an external billing API from Salesforce using a named credential with retry and dead-letter handling.

Frequently Asked Questions about sf-integration-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make an HTTP callout from Salesforce Apex?

Use HttpRequest with a Named Credential endpoint (callout:Name/path), set an explicit timeout, and check the status code before deserializing. Callouts are forbidden after DML or in synchronous trigger context, so enqueue a Queueable implementing Database.AllowsCallouts instead.

Which Salesforce integration pattern should I use?

Pick by latency, volume, and transactionality: Request-Reply for synchronous user-waiting calls, Fire and Forget with platform events for notifying unknown subscribers, Bulk API 2.0 for over 2,000 records, Composite for atomic multi-record inbound writes, and Salesforce Connect for data virtualization.

How do I retry a failed Apex callout?

Attach a Finalizer inside the Queueable with System.attachFinalizer; it runs even on unhandled exceptions. On retryable statuses (408, 429, 5xx), reschedule with exponential backoff via System.scheduleBatch, and dead-letter permanent failures after a bounded attempt count.

Why does my Apex callout fail with 'uncommitted work pending'?

Salesforce forbids callouts after DML in the same transaction. Perform the callout before any DML, or move it to a Queueable or @future(callout=true) method enqueued after the DML completes.

How do I test Apex callouts without hitting real endpoints?

Register an HttpCalloutMock with Test.setMock; real callouts are blocked in tests. Use a router mock keyed on endpoint and method for multi-endpoint flows, and wrap async jobs in Test.startTest/Test.stopTest so they execute before assertions.

When should I use Composite API versus Bulk API 2.0?

Use Composite (25 subrequests, optional allOrNone) or Composite Graph (500 nodes) for small related-record payloads needing atomicity. Use Bulk API 2.0 ingest for volumes over 2,000 records, noting it always processes in parallel with per-batch commits.