omnistudio-error-handling-patterns
Use when designing fault behavior across Integration Procedures, DataRaptors, OmniScripts, and FlexCards — error routing, user-facing messaging, retry semantics, and idempotency. Triggers: 'omnistudio error', 'integration procedure fault', 'dataraptor error handling', 'omniscript retry', 'flexcard action failure'. NOT for general Apex exception design or Flow fault paths.
Best use case
omnistudio-error-handling-patterns is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when designing fault behavior across Integration Procedures, DataRaptors, OmniScripts, and FlexCards — error routing, user-facing messaging, retry semantics, and idempotency. Triggers: 'omnistudio error', 'integration procedure fault', 'dataraptor error handling', 'omniscript retry', 'flexcard action failure'. NOT for general Apex exception design or Flow fault paths.
Teams using omnistudio-error-handling-patterns should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/omnistudio-error-handling-patterns/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How omnistudio-error-handling-patterns Compares
| Feature / Agent | omnistudio-error-handling-patterns | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when designing fault behavior across Integration Procedures, DataRaptors, OmniScripts, and FlexCards — error routing, user-facing messaging, retry semantics, and idempotency. Triggers: 'omnistudio error', 'integration procedure fault', 'dataraptor error handling', 'omniscript retry', 'flexcard action failure'. NOT for general Apex exception design or Flow fault paths.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# OmniStudio Error Handling Patterns OmniStudio components fail in more ways than they succeed — callouts time out, DataRaptors hit governor limits, OmniScripts abandon mid-flow, FlexCard actions return errors the card ignores. The default behavior across these tools is to surface a generic "An error occurred" or — worse — to silently complete with empty data. Good error handling across OmniStudio means naming each failure boundary, deciding who catches it, and deciding what the user sees. Integration Procedures are the first and most important error boundary. They compose Apex, DataRaptors, HTTP actions, and conditional steps, and every one of those can fail. IP steps have a `Fail On Step Error` flag and a `Response Action` branch — both must be set deliberately. An IP that leaves these defaults often swallows downstream failures and returns a 200 with incomplete data. DataRaptors are the second boundary. Extract operations that hit SOQL governor limits will throw; Load operations that violate validation rules surface field-level errors. Unless the caller inspects the response, these are lost. OmniScripts sit closest to the user. They should translate technical errors into business-readable messages, let the user retry where safe, and preserve filled-in data so the user is not punished for a transient failure. --- ## Before Starting - Map each OmniScript/FlexCard action to the Integration Procedure or DataRaptor it invokes. - List the downstream systems and their realistic failure modes (timeout, 4xx, 5xx, partial success). - Decide which failures are user-recoverable (retry) and which require escalation. ## Core Concepts ### Failure Boundaries 1. **HTTP Action** — callout failures, timeouts, non-2xx responses. 2. **DataRaptor** — governor limits, validation errors, mapping failures. 3. **Integration Procedure** — any step can bubble; IP-level `Response Action` decides routing. 4. **OmniScript step** — action returns an error; step can branch to a fault screen or loop back. 5. **FlexCard action** — action handler returns a fault; card decides whether to show error state or silently fail. ### Response Action Routing Every IP step has four relevant controls: - `Fail On Step Error` — if false, step error is ignored and IP continues. - `Response Action` — "Cache Then Ignore" / "Terminate IP" / "Continue on Error". - `Send JSON Node` — controls what response payload is returned on failure. - `Send JSON Path` — controls partial result shape. Setting these to "Terminate on Error" for downstream-critical steps and explicit continue for best-effort steps is the difference between a resilient IP and a silent one. ### Idempotency Contract Any IP that writes must be idempotent at the callout or the caller must track attempts. Use an external ID, a correlation ID in the payload, or a DataRaptor load that treats upsert + external ID as its signature. --- ## Common Patterns ### Pattern 1: Fail-Fast IP With User-Facing Fault Screen Critical write steps terminate the IP on error. The OmniScript inspects the IP response envelope and branches to a fault screen that summarizes what failed, what was saved, and what the user should do next. ### Pattern 2: Best-Effort Enrichment Step An enrichment step (e.g. fetching a nice-to-have third-party score) is marked `Continue on Error` with a default value. The consumer treats missing enrichment as normal. ### Pattern 3: Retry With Correlation ID HTTP actions write a correlation ID into the payload. On a retryable failure (timeout, 502, 503), the OmniScript allows the user to retry — the downstream system deduplicates by correlation ID. ### Pattern 4: Compensating DataRaptor Load A multi-step write that can partially succeed uses a compensating DataRaptor load on failure to roll back committed records, or flags them for async cleanup. ### Pattern 5: Explicit User Messages Every recoverable failure maps to a business-readable message and an action the user can take. Unrecoverable failures go to a support pathway (case creation, hotline, Slack channel) with enough diagnostic data attached. --- ## Decision Guidance | Situation | Recommended Approach | Reason | |---|---|---| | Step is critical to downstream data integrity | `Terminate on Error` + fault screen | Avoid half-written records | | Step is enrichment only | `Continue on Error` + default value | Do not block user for nice-to-have | | Downstream system is idempotent-by-external-id | Retry enabled, correlation ID in payload | Safe user-initiated retry | | Write spans multiple systems | Compensating DataRaptor or async cleanup | Partial success is the default | | User reaches unrecoverable state | Fault screen + support escalation | Do not strand the user | ## Review Checklist - [ ] Every IP step has deliberate `Fail On Step Error` and `Response Action` settings. - [ ] Critical writes terminate the IP on failure. - [ ] User-facing surfaces render a fault screen, not a generic alert. - [ ] Every retry path is idempotent (external ID or correlation ID). - [ ] Partial-success paths have a compensating action. - [ ] Errors are logged with correlation IDs. ## Recommended Workflow 1. Inventory components — IPs, DRs, OmniScripts, FlexCard actions. 2. Classify each step as critical or best-effort. 3. Set `Fail On Step Error` and `Response Action` accordingly. 4. Write the user-facing fault surface and the support escalation path. 5. Add correlation IDs and idempotency checks to every writable callout. 6. Validate with negative-path test runs. --- ## Salesforce-Specific Gotchas 1. IP step defaults silently swallow failures — unset defaults must be corrected per step. 2. DataRaptor Extract returns empty-but-OK on row-level failures. 3. OmniScript navigation to "fault step" does not preserve user-entered data unless you wire it. 4. FlexCard `On Failure` branches are often left empty in auto-generated actions. 5. Retried HTTP actions without correlation IDs produce duplicate writes downstream. ## Proactive Triggers - Step with `Fail On Step Error = false` writing to a record → Flag Critical. - No `On Failure` branch on a FlexCard save action → Flag High. - Retry-enabled action without correlation ID → Flag High. - OmniScript with no fault step in a multi-callout flow → Flag High. - IP returns 200 with `errors` array the caller ignores → Flag High. ## Output Artifacts | Artifact | Description | |---|---| | Fault routing table | Per-step `Fail On` + `Response Action` + user message | | Retry and idempotency design | Correlation ID strategy | | Compensating action plan | Rollback or async cleanup per partial-success scenario | ## Related Skills - `omnistudio/integration-procedures` — IP step design. - `omnistudio/dataraptor-patterns` — DR error modes. - `omnistudio/omnistudio-debugging` — tracing faults end to end. - `integration/retry-and-backoff-patterns` — retry semantics for downstream systems.
Related Skills
mfa-enforcement-patterns
Design MFA enforcement: auto-enablement, Salesforce Authenticator rollout, exceptions, service accounts, API-only users, SSO interop, and audit. Trigger keywords: MFA, multi-factor, two-factor, Salesforce Authenticator, MFA exception, MFA SSO, api-only MFA. Does NOT cover: end-user password policies, device-trust posture, or non-Salesforce IdP configuration.
encrypted-field-query-patterns
Design SOQL, filters, reporting, and indexes against Shield Platform Encryption fields. Trigger keywords: Shield Platform Encryption, encrypted field query, probabilistic vs deterministic encryption, encrypted SOQL filter, encrypted field index. Does NOT cover: Classic Encryption (deprecated), field-level security policy, or tenant secret key rotation.
apex-managed-sharing-patterns
Grant row-level access programmatically via __Share records when declarative sharing rules cannot express the policy. NOT for OWD, role hierarchy, or criteria-based sharing rule design.
vlocity-to-native-omnistudio-migration
Use when migrating an org from the Vlocity managed package (vlocity_ins, vlocity_cmt, vlocity_ps) to native OmniStudio. Trigger keywords: Vlocity to OmniStudio migration, namespace migration, vlocity_ins to omnistudio, OmniStudio Migration Tool, DataRaptor namespace update, OmniScript JSON export, managed package to native. NOT for new OmniStudio setup in greenfield orgs, nor for migrating between OmniStudio-native orgs, nor for Salesforce CPQ to Industries CPQ migration.
omnistudio-vs-flow-decision
Use when choosing between OmniStudio (OmniScript / Integration Procedure / FlexCard / DataRaptor) and Flow / Screen Flow / Apex for a given capability. Triggers: 'omnistudio or flow', 'omniscript vs screen flow', 'integration procedure vs subflow', 'flexcard vs lightning page'. NOT for general automation selection across Workflow/Process Builder/Apex (see automation-selection tree).
omnistudio-testing-patterns
Use when testing or validating OmniStudio components — OmniScript preview, Integration Procedure step debugging, DataRaptor field-mapping validation, and end-to-end UTAM-based automation. NOT for Apex unit testing or standard Flow debugging.
omnistudio-security
Use when designing or reviewing OmniStudio security across OmniScripts, Integration Procedures, DataRaptors, custom LWCs, Apex actions, guest-user exposure, and outbound HTTP actions. Triggers: 'OmniStudio security', 'guest user omniscript', 'DataRaptor CRUD FLS', 'OmniStudio Apex security', 'HTTP action data exposure'. NOT for general portal identity architecture or generic Apex security reviews when OmniStudio is not the main surface.
omnistudio-remote-actions
Use when configuring, troubleshooting, or choosing between Remote Action types in OmniScript or FlexCard. Triggers: 'remote action', 'OmniScript action', 'IP action', 'Apex action element', 'VlocityOpenInterface2', 'Send/Response JSON Path'. NOT for Integration Procedure internal design (use integration-procedures) or generic Apex callout patterns (use apex integration skills).
omnistudio-performance
Use when diagnosing or improving runtime performance in OmniStudio assets: slow OmniScripts, Integration Procedures with high latency, DataRaptor caching, excessive API call counts, FlexCard rendering delays, or async IP fire-and-forget patterns. Triggers: 'OmniScript slow', 'Integration Procedure timeout', 'DataRaptor cache', 'FlexCard loading too long', 'reduce API calls OmniStudio'. NOT for LWC performance outside of OmniScript runtime (use lwc-performance skill). NOT for OmniScript step design or journey UX (use omniscript-design-patterns skill).
omnistudio-multi-language
Localize OmniScripts, FlexCards, and DataRaptors using Label-based translation, multi-language JSON, and locale-aware number/date formatting. NOT for Salesforce Translation Workbench alone.
omnistudio-lwc-omniscript-migration
Migrate classic Visualforce-based OmniScripts to LWC-based runtime with feature parity and regression testing. NOT for new OmniScript design.
omnistudio-lwc-integration
Use when embedding OmniScripts in Lightning Web Components, registering custom LWC elements inside OmniScript screens, or calling OmniScript/Integration Procedures from LWC. Triggers: embed omniscript in LWC, custom LWC element in OmniScript, call OmniScript from Lightning page, omnistudio-omni-script tag, seed data JSON, OmniScript launch from LWC. NOT for standalone LWC development, standard Flow embedding, or OmniScript-to-OmniScript embedding.