sf-platform-events-cdc

Design Salesforce Platform Events and Change Data Capture integrations with replay and checkpointing.

13|2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/jiten-singh-shahi/salesforce-claude-code --skill sf-platform-events-cdc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-platform-events-cdc
Source: https://github.com/jiten-singh-shahi/salesforce-claude-code/tree/main/.cursor/skills/sf-platform-events-cdc
Command: npx skills add https://github.com/jiten-singh-shahi/salesforce-claude-code --skill sf-platform-events-cdc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Platform Events and Change Data Capture reduce coupling and replace fragile polling and ad-hoc syncs with reliable, replayable, and testable event-driven flows so teams can build real-time integrations that tolerate failures and scale.

Core Features & Use Cases

  • Publish & Subscribe Patterns: Guidance for Apex publishers, trigger and Flow subscribers, and external consumers (CometD / Pub/Sub API).
  • Replay, Checkpointing & Retries: Patterns for managing ReplayId, setting resume checkpoints, idempotent processing, and handling gap/overflow events.
  • Testing & Monitoring: Test harness examples for event delivery in Apex and monitoring queries for EventBusSubscriber to troubleshoot retries and suspensions.
  • Use Case: Implement an order-fulfillment pipeline that publishes Order_Completed__e events, processes them with idempotent subscribers, and uses checkpoints to resume after transient failures.

Quick Start

Design an Apex platform event publisher and a replay-safe subscriber for Order_Completed__e that uses checkpoints, idempotent processing, and unit tests to verify delivery and retry behavior.

Frequently Asked Questions about sf-platform-events-cdc

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

FAQPage Schema
How do I handle Salesforce platform event replay and recovery after a subscriber failure?

Salesforce platform event replay uses ReplayId to resume processing after failures. You implement checkpointing to store the last processed ReplayId, enabling subscribers to recover missed events and handle transient failures without data loss or duplicate processing.

How does Change Data Capture in Salesforce work for real-time integrations?

Change Data Capture in Salesforce emits events for record changes, replacing fragile polling with decoupled, real-time integrations. It allows external Pub/Sub or CometD consumers and internal Apex subscribers to reliably process data modifications as they occur.

How do I write Apex unit tests for platform event delivery and subscriber logic?

Apex unit tests for platform event delivery use test harness examples to verify event publishing and subscriber behavior. You validate idempotent processing and retry logic by simulating event triggers and asserting successful delivery within the test context.

How do I make Salesforce event-driven subscribers idempotent for retry scenarios?

Idempotent Salesforce event subscribers process duplicate events safely by tracking processed event IDs or using database state checks. This ensures retry scenarios during gap or overflow events do not cause duplicate side effects in your integration pipeline.

Can I use Salesforce Flow to subscribe to platform events and trigger integrations?

Yes, Salesforce Flow can subscribe to platform events to trigger automated integrations. You configure Flow subscribers to process incoming events, working alongside Apex triggers or external CometD consumers for comprehensive event-driven architecture.

What are the limitations of Salesforce platform event retention and overflow handling?

Salesforce platform event retention limits how long events remain accessible via ReplayId. When limits are exceeded, overflow handling drops older events, requiring robust checkpointing and continuous subscriber monitoring to prevent permanent data loss.