Loading...
Loading...
Create, read, update, and delete ManagedEventSubscription metadata in Salesforce. Use this skill for any work involving managed event subscriptions, platform event subscriptions, event channel subscribers, or .managedEventSubscription-meta.xml files. TRIGGER when: user asks to subscribe to a platform event, create a managed subscription, set up event replay, configure an event channel subscriber, update replay preset, activate or deactivate a subscription, delete a subscription, or manage ManagedEventSubscription metadata. SKIP when: user needs to create the platform event channel itself (use generating-platform-event skill) or needs Flow-based event subscriptions (use generating-flow skill).
npx skill4agent add forcedotcom/sf-skills managing-managed-event-subscriptionManagedEventSubscription.managedEventSubscription-meta.xml__e.managedEventSubscription-meta.xmlreferences/topic-name-formats.mdIdLATESTEARLIESTLATESTEARLIESTRUNSTOPRUNIdreferences/topic-name-formats.mdLATESTEARLIESTLATESTLATESTEARLIESTLATESTRUNSTOPRUNPAUSEINVALID_INPUT67.0generating-platform-eventassets/managed-event-subscription-template.xmlmanagedEventSubscriptions/<DeveloperName>.managedEventSubscription-meta.xmlManagedSubscribeDeveloperNameIdIdSELECT Id, DeveloperName FROM ManagedEventSubscription WHERE DeveloperName='<DeveloperName>'IdDeveloperNameIdmanagedEventSubscriptions/<DeveloperName>.managedEventSubscription-meta.xmlIdDeveloperNameIdreferences/update-constraints.mdIdDeveloperNamedestructiveChanges.xmlreferences/delete-guide.md| Constraint | Rationale |
|---|---|
| Platform events use |
| These are the only valid enum values; any other value fails metadata validation |
| |
| All six required elements must be present | |
| DeveloperName must be unique within the org | Duplicate names cause |
Do not include | Read-only platform fields; including them causes deployment failures in unpackaged orgs |
| Issue | Resolution |
|---|---|
| Wrong format or the event doesn't exist in the org — read |
| Replay state lost after delete + recreate | Deleting discards stored replay position; recreating starts from |
| ManagedEventSubscription is only queryable via Tooling API, not standard SOQL |
| Can trigger up to 72 hours of backlog replay on activation; always confirm with the user |
| Metadata not supported in older orgs | ManagedEventSubscription requires API v60.0+; check org API version |
| These are wrong field names — use |
| |
| User unsure how to identify subscription for Pub/Sub API | Both |
| Changes not reflected immediately in Pub/Sub API | After create/update/delete, the Pub/Sub API can take up to ~2 minutes to reflect the new config; if ManagedSubscribe returns NOT_FOUND, wait and retry |
<topicName>references/topic-name-formats.md/event/Name__e/data/NameChangeEvent/data/ChangeEvents/event/Name__chn/data/Name__chn<defaultReplay>LATESTEARLIEST<errorRecoveryReplay>LATESTEARLIEST<state>RUNSTOPPAUSE<label><version>67.0<id><createdDate><namespacePrefix>managedEventSubscriptions/<DeveloperName>.managedEventSubscription-meta.xmldestructiveChanges.xml| Need | Delegate to |
|---|---|
Create the platform event channel ( | |
| Subscribe via Flow (Process Automation) | |
| Deploy metadata to org | |
| File | When to read |
|---|---|
| Before generating any new subscription — use as starting structure |
| When setting |
| During Update workflow — to check which fields are immutable post-creation |
| During Delete workflow — for destructive change deployment procedure |