How to Create a Filtered Salesforce CDC Channel with PlatformEventChannel
A Salesforce filtered CDC channel is configuration, not subscriber-side magic. The core model is a channel plus one or more members.
The Two Metadata Objects
PlatformEventChannel defines the channel. For Change Data Capture, its channel type is data.
A conceptual channel definition looks like:
FullName: CustomerUpdates__chn
ChannelType: data
PlatformEventChannelMember then associates a change-event entity with the channel and can add a filterExpression and CDC enrichedFields.
Conceptually:
CustomerUpdates__chn
|- AccountChangeEvent member
| `- filterExpression
`- ContactChangeEvent member
`- filterExpression
Salesforce documents Tooling API and Metadata API as configuration mechanisms for custom channels and channel members. The Salesforce Platform APIs Postman collection is also useful when learning the underlying requests.
Naming Details Matter
Salesforce's documented convention uses a channel API name ending in __chn, such as:
CustomerUpdates__chn
When creating a channel member, Salesforce notes that its FullName cannot contain double underscores. A common convention therefore changes the channel portion to _chn in the member name.
Add an Account CDC Member
A member selects a change-event entity such as:
selectedEntity: AccountChangeEvent
Then add a filter expression appropriate to the integration. For example, a customer synchronization stream might only want updates that meet a business-state condition.
Do not assume every SOQL expression is legal here. Salesforce states that event filters use SOQL-based expressions with a supported subset of operators and field types.
Add Multiple Objects When the Stream Represents a Domain
One benefit of a custom channel is grouping multiple compatible event entities. A CustomerUpdates__chn channel could contain Account and Contact CDC members, allowing the consumer to subscribe to one domain-oriented channel rather than managing independent subscriptions.
That does not mean every integration should create giant channels. Keep the channel aligned to a coherent consumer contract.
Deployment Strategy
Treat channel definitions like other integration metadata:
- keep the intended configuration under version control;
- deploy through controlled environments;
- validate filter behavior with representative changes;
- verify the subscriber topic/channel name;
- monitor event volume after rollout.
A filter that is syntactically valid but semantically too broad can quietly defeat the reason you created the channel.
Pub/Sub API Subscription
Salesforce Pub/Sub API lets a subscriber specify the topic for an individual event or a custom channel. Pub/Sub uses gRPC over HTTP/2 and delivers binary Avro event messages.
The subscriber should still implement replay/checkpoint and failure behavior. Channel configuration determines which events are delivered, not how safely the client processes them.