# Flow And Platform Events

> Publish and subscribe to Platform Events from Flow for async decoupling, high-volume triggers, and cross-org signaling. NOT for regular DML-triggered flows.

- Skill: `banibratachatterjee/flow-and-platform-events` (Agent Skill, multi-file: 7 files)
- Install (CLI): `npx skillmds@latest add banibratachatterjee/flow-and-platform-events`
- Raw SKILL.md: https://api.skillmd.com/api/skills/banibratachatterjee/flow-and-platform-events/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: BanibrataChatterjee (https://skillmd.com/u/banibratachatterjee)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/banibratachatterjee/flow-and-platform-events

---


# Flow and Platform Events

Platform Events are the canonical async bus for Salesforce. Flow supports both publish (Create Records on the PE SObject) and subscribe (Platform Event-Triggered Flow). This skill covers high-volume PE vs standard-volume, replay, and the failure modes when a PE-triggered flow errors.

## When to Use

Decouple producer from consumer (reduce transaction size), fan-out to N subscribers, or cross-org signaling.

Typical trigger phrases that should route to this skill: `flow publish platform event`, `platform event triggered flow`, `async flow notification`, `flow publish high volume event`.

## Recommended Workflow

1. Define the PE with stable fields; prefer text fields for interoperability.
2. Publish: Create Records on the PE SObject in any flow (record-triggered, screen, scheduled).
3. Subscribe: Platform Event-Triggered Flow; select the PE; build actions.
4. Error handling: subscribed flows retry on failure with a visible 'Failed' status — instrument.
5. For high-volume PEs (>250k/day), choose High-Volume type; Monitor Setup → Platform Event Usage.

## Key Considerations

- PE-triggered flows run asynchronously — no rollback of the publishing transaction on subscriber failure.
- Retention: 72h for Standard, 72h for High-Volume (both).
- PE subscriber flows share daily limits with other subscribers.
- Replay via replay ID requires CometD/Pub-Sub client, not Flow.

## Worked Examples (see `references/examples.md`)

- *Decouple Opp → Billing* — Opportunity closed
- *Fan-out notification* — Case escalation

## Common Gotchas (see `references/gotchas.md`)

- **Assumed transactional** — Consumer failure rolls back producer — it doesn't.
- **Subscriber error silent** — Retries exhaust; no alert.
- **PE allocation exceeded** — Publish fails with LIMIT_EXCEEDED.

## Top LLM Anti-Patterns (full list in `references/llm-anti-patterns.md`)

- Treating PE as transactional
- One PE for too many different events
- Missing idempotency on subscribers

## Official Sources Used

- Flow Builder Guide — https://help.salesforce.com/s/articleView?id=sf.flow.htm
- Flow Best Practices — https://help.salesforce.com/s/articleView?id=sf.flow_best_practices.htm
- Reactive Screens — https://help.salesforce.com/s/articleView?id=sf.flow_ref_elements_screen_reactive.htm
- Flow HTTP Callout Action — https://help.salesforce.com/s/articleView?id=sf.flow_concepts_callout.htm

