Skip to content
OpenSmartRoute
Skillv1.0.0

flow-error-monitoring

Set up monitoring + alerting for Flow runtime errors at org scale: routing fault emails, Flow runtime error reports, custom centralized logging (Integration_Log__c), escalation thresholds, and trend d

by PranavNagrecha(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from PranavNagrecha/AwesomeSalesforceSkills (skills/flow/flow-error-monitoring/SKILL.md). Install upstream with npx skills add PranavNagrecha/AwesomeSalesforceSkills --skill flow-error-monitoring. Copyright stays with the author.

Flow Error Monitoring

Core concept — three error surfaces

Salesforce exposes flow errors through three independent surfaces. A mature monitoring setup uses all three.

Surface Source Best for
Fault emails Default Apex fault notifications Human notification at failure time
Flow Runtime Error report FlowInterviewLog / Reports tab Trend analysis, dashboard visualization
Custom log object (Integration_Log__c or similar) Emit from fault paths in each flow Centralized, queryable, exportable to external observability

Fault emails are the default; they're necessary but not sufficient. A monitoring-first org uses all three surfaces, routed by severity.

Recommended Workflow

  1. Inventory the flow portfolio. Use Flow Trigger Explorer + tooling_query('SELECT DeveloperName, Status FROM Flow WHERE Status IN (\'Active\')') to enumerate active flows.
  2. Decide default fault-email recipient policy. Most orgs default to the flow creator; route them instead to a shared ops alias or by domain (sales-ops, service-ops).
  3. Classify flows by severity. P0 (revenue-impacting), P1 (operational), P2 (convenience). Different surfaces + thresholds per severity.
  4. Design the central log object. Fields: severity, source, message, record Id context, timestamp, correlation Id.
  5. Wire every flow's fault connectors to write to the log AND (for P0) send a targeted alert. Existing flows: audit via a script that checks for missing fault paths.
  6. Build the runtime error report + dashboard. Group by flow, by day, by error type. Publish to the ops Slack channel or email.
  7. Set alerting thresholds, then review them quarterly. P0: 1 failure = immediate page. P1: 5/hour = email. P2: daily digest. Revisit the trend each quarter — declining P1 rates mean the flow portfolio is getting healthier; growing ones mean something is rotting.

Key patterns

Pattern 1 — Central log object design

Integration_Log__c
  - Source__c           (Text) — e.g. "Opportunity_StageChange_Flow"
  - Severity__c         (Picklist: CRITICAL, ERROR, WARNING, INFO)
  - Message__c          (Text Long)
  - Record_Id__c        (Text 18) — the record that triggered the failure
  - User_Id__c          (Lookup User)
  - Correlation_Id__c   (Text 64) — for grouping related failures
  - Flow_Name__c        (Text)
  - Flow_Version__c     (Number)
  - Stack_Trace__c      (Text Long)
  - Created_Date        (standard)

Index: Severity + Created_Date for the monitoring dashboard query.

Pattern 2 — Fault path template for every flow

Every flow should terminate every fault connector with the same skeleton:

[Critical element — e.g. Create Records]
        │
        fault path
        ▼
[Assignment — build log payload]
        │
        ▼
[Create Records — Integration_Log__c]
        │
        ▼
[Decision — severity = CRITICAL?]
        │
        ├── Yes  → [Send Email Alert] → [End]
        └── No   → [End]

Use templates/flow/FaultPath_Template.md as the baseline.

Pattern 3 — Runtime error report

Report type: Flow Interviews with Status = "Error"

  • Filter: Last 7 days
  • Group by: Flow Name
  • Summarize: Count of errors, Last error time
  • Subscribe: daily email to ops alias

Add a dashboard component showing weekly trend.

Pattern 4 — External observability bridge

For orgs with Splunk / Datadog:

Integration_Log__c (Create after Insert trigger)
     │
     ▼
[Apex trigger / flow → Platform Event: Integration_Error__e]
     │
     ▼
[Pub/Sub API subscriber in Splunk / Datadog]
     │
     ▼
Dashboards + alerting in external platform

Don't pull from Salesforce on a schedule (rate-limited, laggy); push via Platform Event instead.

Pattern 5 — Alerting thresholds

Severity Immediate Hourly rollup Daily digest
CRITICAL Page on-call
ERROR Email if > 5/hour Always
WARNING Always
INFO Only on trend anomaly

Bulk safety

  • The fault-path log write should be a Create Records (single record per failure), never a Create Records inside a Loop over the failing records — that would compound the failure.
  • Bulk-processed flows (record-triggered, scheduled) may log multiple records per transaction; ensure the log object is write-scalable (no required references to other objects that might be missing).

Error handling

  • The fault-path log write can itself fault. Don't infinite-loop: set a max-recursion boundary, or use a second-tier fault path that routes to a raw email.
  • If Integration_Log__c fills up, archive to BigObject or dump to external observability — don't delete.

Well-Architected mapping

  • Reliability — without monitoring, flow failures accumulate as unnoticed data corruption. Monitoring makes failure visible, which is the precondition for fixing it.
  • Operational Excellence — ops teams can't run flow portfolios by reading individual fault emails. Centralized logging + trend dashboards are the force multiplier.

Gotchas

See references/gotchas.md.

Testing

Test each flow's fault path by forcing a known failure in a test class:

@IsTest
static void testFaultPathLogsCorrectly() {
    // Force a DML failure.
    insertConflictingRecordBeforeFlow();

    Test.startTest();
    // Invoke flow; expect it to take the fault path.
    ...
    Test.stopTest();

    Integration_Log__c log = [SELECT Severity__c, Source__c FROM Integration_Log__c LIMIT 1];
    System.assertEquals('ERROR', log.Severity__c);
    System.assertEquals('Opportunity_StageChange_Flow', log.Source__c);
}

Official Sources Used

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/pranavnagrecha-awesomesalesforceskills-flow-error-monitoring/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

pranavnagrecha-awesomesalesforceskills-flow-error-monitoring.ocm.jsonjson
{
  "ocm": "1",
  "id": "pranavnagrecha-awesomesalesforceskills-flow-error-monitoring",
  "kind": "skill",
  "name": "flow-error-monitoring",
  "description": "Set up monitoring + alerting for Flow runtime errors at org scale: routing fault emails, Flow runtime error reports, custom centralized logging (Integration_Log__c), escalation thresholds, and trend detection. NOT for diagnosing a specific flow error — use flow/flow-runtime-error-diagnosis. NOT for debug-mode setup — use flow/flow-debugging.",
  "publisher": "PranavNagrecha",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding",
      "medical"
    ],
    "tags": [
      "skill-md",
      "flow",
      "monitoring",
      "alerting",
      "error-reports",
      "integration-log",
      "ops",
      "dashboards",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Set up monitoring + alerting for Flow runtime errors at org scale: routing fault emails, Flow runtime error reports, custom centralized logging (Integration_Log__c), escalation thresholds, and trend detection. NOT for diagnosing a specific flow error — use flow/flow-runtime-error-diagnosis. NOT for debug-mode setup — use flow/flow-debugging."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/PranavNagrecha/AwesomeSalesforceSkills",
      "path": "skills/flow/flow-error-monitoring/SKILL.md",
      "ref": "4af2a2ccdaf10f9271745d5ede28ccafd905018e",
      "url": "https://github.com/PranavNagrecha/AwesomeSalesforceSkills/blob/4af2a2ccdaf10f9271745d5ede28ccafd905018e/skills/flow/flow-error-monitoring/SKILL.md",
      "key": "PranavNagrecha/AwesomeSalesforceSkills/skills/flow/flow-error-monitoring/SKILL.md"
    }
  },
  "instructions": "# Flow Error Monitoring\n\n## Core concept — three error surfaces\n\nSalesforce exposes flow errors through three independent surfaces. A mature monitoring setup uses all three.\n\n| Surface | Source | Best for |\n|---|---|---|\n| **Fault emails** | Default Apex fault notifications | Human notification at failure time |\n| **Flow Runtime Error report** | `FlowInterviewLog` / Reports tab | Trend analysis, dashboard visualization |\n| **Custom log object** (`Integration_Log__c` or similar) | Emit from fault paths in each flow | Centralized, queryable, exportable to external observability |\n\nFault emails a",
  "cost": {
    "context_tokens": 1560
  }
}

Fetch it by URL: GET /api/v1/registry/pranavnagrecha-awesomesalesforceskills-flow-error-monitoring/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.