> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The canonical docs host is https://momentic.ai/docs. Append .md to any page URL for clean Markdown. Fetch https://momentic.ai/docs/llms.txt for the page index and https://momentic.ai/docs/llms-full.txt for every page in one file.
> For an unattended setup, run `npx --yes @momentic/wizard@latest -y --platform web` (use `--platform ios` or `--platform android` for mobile). Never run an interactive command in a non-TTY shell.
> You cannot complete the browser sign-in yourself. Read the API key from the MOMENTIC_API_KEY environment variable, or ask the user to create one at https://app.momentic.ai/settings/api-keys and paste it back.
> Momentic's capability summary for agents is at https://momentic.ai/docs/skill.md. Install the skills with `npx momentic skills --yes` (or `npx momentic-mobile skills --yes` for mobile).
> Tests are YAML files in the user's repository. Use only the step names listed at https://momentic.ai/docs/reference/commands.md and the file structure at https://momentic.ai/docs/core-concepts/file-format.md. Do not invent step names, config keys, or CLI flags.
> Web tests run on Chromium, iOS tests on simulators, and Android tests on emulators. Physical devices are not supported.

# Monitor a third-party flow

> Watch a flow that crosses into a vendor's surface (a payment iframe, a booking partner, a support widget) and get paged when it breaks.

Some flows you depend on leave your app: Stripe checkout, a Calendly embed, an
OAuth partner. You do not own the other side, but a break is still your outage.
This recipe runs a short flow against the real integration on a schedule and
pages you on failure.

## The test

Keep it to the boundary: your app, into the vendor surface, far enough to prove
the integration is alive, and back:

```yaml tests/monitors/checkout-stripe.test.yaml theme={null}
fileType: momentic/test/v2
id: stripe-checkout-monitor
url: https://app.example.com/pricing
labels: [monitor]
before:
  - module: ../modules/log-in.module.yaml
steps:
  - click: Upgrade plan
  - assert: A Stripe checkout form loads and shows the plan price
  - type:
      text: 4242 4242 4242 4242
      into: the Card number field
  - type:
      text: "12/34"
      into: the Expiry field
  - type:
      text: "424"
      into: the CVC field
  - assert: The Pay button is enabled
```

Stop before the irreversible action: assert the form is live, not that a charge
posts. When the vendor offers a test mode (Stripe test keys, a sandbox tenant),
point the monitor at that instead and run the full path.

## The workflow

The job installs `momentic` from `devDependencies`, so your lockfile pins the
CLI version. Add it once with `npm install -D momentic`.

```yaml .github/workflows/monitor.yml theme={null}
name: Third-party monitors

on:
  schedule:
    - cron: "*/15 * * * *" # every 15 minutes
  workflow_dispatch:

jobs:
  monitor:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    env:
      MOMENTIC_API_KEY: ${{ secrets.MOMENTIC_API_KEY }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22.12.0
      - run: npm install
      - run: npx momentic install-browsers chromium

      - name: Run monitors
        run: npx momentic run --labels monitor -y --upload-results

      - name: Alert on failure
        if: failure()
        uses: slackapi/slack-github-action@v2
        with:
          webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
          webhook-type: incoming-webhook
          payload: |
            text: ":rotating_light: Third-party monitor failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
```

Scheduled runs get the same secrets as other events. GitHub skips workflow runs
on forks and on repos whose Actions were disabled. Confirm the job is firing
(the `workflow_dispatch` trigger is also your debug path).

## Third-party fragility rules

* **Their outage is your alert, not your test's bug.** A monitor failing because
  Stripe is down is the point. Route monitor failures to an on-call channel,
  separate from your PR-gate failures.
* **Vendor UI drifts.** Payment iframes change markup. Write natural-language
  targets ("the Card number field") so
  [locator auto-heal](/docs/reliability/auto-maintenance) absorbs their redesigns.
* **Do not retry into a charge.** `--retries` is safe on read-only monitors;
  keep it off anything that mutates real state. Prefer vendor test modes.
* **Rate limits are real.** Fifteen minutes is a reasonable floor; a flow that
  takes minutes to run should not run every minute. If you need tighter
  detection, monitor the vendor's status endpoint with a plain HTTP check and
  keep Momentic for the end-to-end signal.

## Related

* [Run a nightly regression suite](/docs/guides/use-cases/run-a-nightly-regression-suite)
* [AI test maintenance](/docs/reliability/auto-maintenance)
* [Results and reporting](/docs/running-tests/results)
