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

# Automations and alerts

> Diagnose scheduled automations that did not run and missing run-completion alerts.

Automations run on schedule, and alerts fire when they finish. When neither happens, the issue is almost always in the setup — a credential, a schedule, a webhook URL, or the active tenant context. These checks walk through both failure modes.

## Automation did not run

An automation has a saved run, an input mode, and a schedule. If a scheduled run never fired, start by confirming all three are still correct.

**Check the automation record**

Open **Ask Darpan**, search for **Open Automations**, and open the result. Confirm the row shows the expected input mode, schedule, state, and next run.

**Check the input sources**

* If the automation uses **SFTP file inputs**: confirm the SFTP server is reachable and the remote file paths are populated. If no SFTP server appears, create or reactivate the required server from **Open SFTP Servers**.
* If the automation uses **API date-range extraction**: confirm the API source is reachable. If no source appears, confirm the relevant system setup from [Set up Shopify](/guides/setup-shopify) or [Set up HotWax](/guides/setup-hotwax).

**Check the saved run**

When the automation asks **Which saved run should this automation use?**, it points to a specific saved reconciliation run. If that run was deleted or its sources removed, the automation cannot execute. Confirm the saved run still exists and its sources, schemas, and primary IDs are intact. See [Set up a reconciliation run](/guides/setup-reconciliation-run) to recreate it if needed.

**If a run appears permanently stuck**

A JVM crash or container restart mid-run can leave a reconciliation run result in a running state, which blocks re-triggering. An internal scheduled reaper (`reconciliation.ReconciliationAutomationServices.sweep#StuckReconciliationRuns`) automatically flips run results that have been in a running or pending state for more than 120 minutes to failed with an explanatory status message. No user action is required — wait for the next reaper cycle, then trigger the automation again.

<Note>
  The stuck-run reaper is an internal service (`allow-remote="false"`) and does not expose a user-facing trigger. If a run appears stuck for longer than 120 minutes and is not swept, contact support.
</Note>

## Alert never arrived

Run-completion alerts post a Google Chat message to the tenant's configured webhook when any reconciliation run finishes — manual or automated. If no message arrived, check the following.

<Note>
  Notification delivery is best-effort. A run never fails because an alert could not be sent. The run result is always saved and viewable in the app regardless of whether the alert fired.
</Note>

| Symptom                                               | What to check                                                                                                                                |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| No message arrives after a run                        | Confirm the webhook status is active for the correct tenant, the run actually completed, and the Google Chat space allows incoming webhooks. |
| Save is rejected                                      | The webhook URL must be `https` on `chat.googleapis.com`, target a space messages endpoint, and include `key` and `token` query parameters.  |
| Message arrives but the link does not open the result | Confirm the run produced a saved result and that the app base URL for the environment is reachable.                                          |
| Alerts stopped after a tenant switch                  | Notification settings are per tenant. Confirm the active tenant matches the runs you expect alerts for.                                      |

**Run-result link points to the wrong URL**

The link in the alert derives its base URL from the `DARPAN_APP_BASE_URL` environment variable or the `darpan.app.baseUrl` property, falling back to the first allowed origin. If the link opens the wrong environment, verify these settings on the server side.

**Set up or update the webhook**

To configure or change the Google Chat webhook, go to [Run-completion alerts](/guides/run-completion-alerts). Notification settings are managed in **Tenant Settings** under **Operations → Notifications**. Only Tenant Admins can save changes there.
