---
id: WF-PFM-INT-006
title: Check connection health and re-verify on schedule
trigger: The initiating scheduler starts this flow.
product_area: platform
module: integrations
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
implements:
  - CAP-PFM-INT-006
  - CAP-PFM-INT-004
moves:
  - STATE-PFM-INT-003
  - STATE-PFM-INT-006
crosses: []
idempotency: An existing open check job is reused when a schedule or person asks again.
concurrency: The pass saves workspace progress and account checks record only applicable status changes.
hops:
  - 'n': 1
    actor_or_service: Scheduler
    action: Invoke recent-failure health work every fifteen minutes and the daily verification pass.
    anchor: 'services-platform:modules/integrations/aws/logic/integrations-health.schedule.ts'
    seam: schedule
    on_failure: The next pass revisits due checks and silence alarms indicate prolonged gaps.
    left_inconsistent: Displayed check information can become stale.
    observer: Operations alarms
    provenance: documented
    source: 'services-platform:docs/integrations/README.md#Verification and health'
  - 'n': 2
    actor_or_service: Health pass
    action: >-
      Walk operational workspaces using a resume cursor and submit eligible health or verification jobs,
      reusing open jobs.
    anchor: 'services-platform:modules/integrations/services/health/health-pass.ts:runIntegrationsHealthPass'
    seam: sync
    on_failure: Log a workspace error and continue to later workspaces.
    left_inconsistent: Failed submissions can wait for a later pass.
    observer: Health pass logs
    provenance: observed
    source: 'services-platform:modules/integrations/services/health/health-pass.ts:runIntegrationsHealthPass'
  - 'n': 3
    actor_or_service: Health job
    action: >-
      Probe eligible active or degraded accounts and record degradation or recovery through the named
      transition helpers.
    anchor: 'services-platform:modules/integrations/services/connections/probe-connection-health.ts'
    seam: state_machine
    on_failure: A failed job is retained in job history; successful provider failures can still update account status.
    left_inconsistent: Account state can retain the previous check result when the job itself fails.
    observer: Connection page
    provenance: observed
    source: 'services-platform:modules/integrations/services/connections/probe-connection-health.ts'
  - 'n': 4
    actor_or_service: Verification job
    action: >-
      Reverify usable accounts and save feature changes, reassessing bindings and requesting feature-loss
      notices.
    anchor: 'services-platform:modules/integrations/services/connections/verify-connection.ts'
    seam: state_machine
    on_failure: A failed result-recording step leaves its prior database state.
    left_inconsistent: Dependent bindings cannot partially change outside that transaction.
    observer: Connection page and Needs Attention
    provenance: observed
    source: 'services-platform:modules/integrations/services/connections/verify-connection.ts'
  - 'n': 5
    actor_or_service: Health pass
    action: Compute last-hour success share and latency from eligible completed calls.
    anchor: 'services-platform:modules/integrations/services/health/health-pass.ts:foldExecutionFigures'
    seam: sync
    on_failure: Log processing failures and retry with later scheduled work.
    left_inconsistent: Displayed figures may remain older than recent calls.
    observer: Connection page
    provenance: observed
    source: 'services-platform:modules/integrations/services/health/health-pass.ts:foldExecutionFigures'
evidence:
  - >-
    services-platform at ad3f6a65: modules/integrations/aws/logic/integrations-health.schedule.ts;
    services/health/health-pass.ts, tenant-integration-health.ts; services/connections/health-workflow.ts,
    probe-connection-health.ts, verify-connection.ts
  - >-
    services-platform:modules/integrations/tests/integration/services/health/health-pass-walk.integration.spec.js#INT-ACC-0112
    step 4: after two invocations every tenant has had a health job (no starvation)
  - >-
    services-platform:modules/integrations/tests/integration/services/connections/connection-jobs.integration.spec.js#degrades
    an active connection whose provider is unhealthy
  - >-
    services-platform:modules/integrations/tests/integration/services/connections/connection-feature-changes.integration.spec.js#INT-ACC-0113
    step 3: the loss tells each administrator of the tenant once, two notices in all, each with the
    features-lost subject
  - >-
    services-platform:modules/integrations/tests/unit/services/connection-figures.spec.ts#does not count an
    execution refused before the adapter, whatever its status
controls: [TC-AVL-001, TC-AVL-004, TC-AVL-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-CRY-001, TC-CRY-002, TC-CRY-003, TC-CRY-004, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-MON-002, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-SEC-001, TC-SEC-002, TC-SEC-003, TC-SEC-004, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---

# Check connection health and re-verify on schedule

## What It Does

Scheduled checks revisit recent failures and periodically verify usable accounts. Durable jobs update health and supported features, and the pass maintains recent-call figures. Open-job reuse avoids duplicate check jobs for the same account.

## The Flow

```mermaid
sequenceDiagram
  participant P0 as Scheduler
  participant P1 as Health pass
  participant P2 as Health job
  participant P3 as Verification job
  P0->>P0: 1. Invoke recent-failure health work every fifteen minutes and the daily verification pass.
  P1->>P1: 2. Walk operational workspaces using a resume cursor and submit eligible health or verification jobs
  P2->>P2: 3. Probe eligible active or degraded accounts and record degradation or recovery through the named transition hel
  P3->>P3: 4. Reverify usable accounts and save feature changes
  P1->>P1: 5. Compute last-hour success share and latency from eligible completed calls.
```

## When Something Fails

The next pass revisits due checks and silence alarms indicate prolonged gaps. Displayed check information can become stale. Log a workspace error and continue to later workspaces. Failed submissions can wait for a later pass. A failed job is retained in job history; successful provider failures can still update account status. Account state can retain the previous check result when the job itself fails. A failed result-recording step leaves its prior database state. Dependent bindings cannot partially change outside that transaction. Log processing failures and retry with later scheduled work. Displayed figures may remain older than recent calls.

## Open Design Questions

Product must align deliberate suspension in the health summary and attention queue.
