# Usage Controls, Alerts & Recovery

> How to configure automated usage safeguards, email and webhook alerts, manage payment grace periods, and restore paused workflows.

Glow provides granular operational controls to help engineering leads and financial administrators prevent runaway usage, receive proactive alerts before allowances deplete, and quickly recover workflows if a limit or payment issue occurs.

---

## Managing budgets, caps, and alerts

Workspace Admins can configure custom usage thresholds and notification channels from **Billing & Usage → Controls** by selecting **Manage budgets, caps and alerts**.

| Setting Field               | Example Configuration            | Purpose                                                                   |
| :-------------------------- | :------------------------------- | :------------------------------------------------------------------------ |
| **AI-token safeguard**      | `5,000,000 tokens`               | Custom ceiling for hosted Glow AI token consumption in the active period. |
| **Retained-storage cap**    | `25.0 GB`                        | Disk volume cap for stored and generated workspace files.                 |
| **Alert thresholds**        | `80, 90, 100 %`                  | Percentage milestones that trigger email and webhook alerts.              |
| **Additional email alerts** | `ops@company.com`                | Extra notification recipients alongside workspace Admins.                 |
| **Billing webhook URL**     | `https://api.example.com/alerts` | Webhook destination for signed real-time alert JSON payloads.             |

> **Immediate Enforcement:** Lowering a safeguard or hard cap below current
> usage blocks new applicable operations immediately. Work that has already been
> admitted to the execution queue completes normally.

### Available safeguards

| Control                       | Function                                                                                    | What happens when reached                                                                       |
| :---------------------------- | :------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------- |
| **AI-token safeguard**        | Sets a custom ceiling on hosted Glow AI token consumption for the current period.           | Hosted AI steps pause with `glow_ai_token_limit`. Standard non-AI steps continue executing.     |
| **Retained-storage cap (GB)** | Restricts the maximum disk volume allocated to uploaded and generated files.                | New file uploads and file-creation steps pause. Existing files remain available and accessible. |
| **Alert thresholds (%)**      | Defines percentage marks (defaults: **80%**, **90%**, **100%**) that trigger notifications. | Dispatches email alerts and webhook payloads as consumption crosses each threshold.             |

---

## Notification channels

When consumption reaches configured thresholds or an account event occurs, Glow dispatches notifications across two channels:

### 1. Email notifications

- **Automatic recipients:** All workspace **Admins** and the verified **billing contact** are always notified.
- **Additional recipients:** Admins can specify extra team distribution lists (such as `finops@example.com` or `devops@example.com`) in the controls dialog.

### 2. Billing webhooks

You can connect an automated monitoring pipeline by supplying a **Billing webhook URL** (HTTPS):

- When a threshold is crossed, Glow posts an HMAC-signed JSON payload containing the workspace identifier, resource kind, threshold reached, and current usage.
- Updating or adding a webhook URL automatically generates and displays a unique signing secret for verification.

---

## Understanding pause states

When workflow execution stops for a billing-related reason, the cause falls into one of two distinct categories:

  - [1. Resource Exhaustion](#1-resource-exhaustion): **Allowance Depleted:** Only steps requiring the exhausted balance pause. Recovers on monthly reset or capacity upgrade.

  - [2. Payment Grace Period](#2-payment-issues--seven-day-grace-period): **Unpaid Renewal Invoice:** Workflows run normally during a 7-day grace window. Resolved immediately via **Pay now**.

### 1. Resource exhaustion

- Occurs when monthly Step credits or AI tokens reach 100% of the purchased allowance.
- Steps requiring that resource pause with clear status codes (`out_of_credits` or `glow_ai_token_limit`).
- Steps that do not require the exhausted resource (for example, standard webhook ingestion when only AI tokens are depleted) continue running.

### 2. Payment issues & seven-day grace period

- Occurs if an automated renewal payment fails or requires customer action.
- The workspace enters a **seven-day payment grace period**. During grace, workflows continue running normally while alert banners notify Admins to update payment details.
- If payment is not completed before grace expires, workflow execution pauses until the outstanding invoice is cleared.

---

## Restoring service and recovering workflows

Restoring active service is straightforward and maintains full operational continuity:

### Restore allowance or resolve invoice

If an allowance is exhausted, navigate to **Billing & Usage → Usage** and increase your resource amounts, or wait for the scheduled monthly reset date. If an invoice is outstanding, open **Billing & Usage → Billing**, select **Pay now**, and confirm payment of the open balance.

### Service resumes without resetting usage

Once payment or capacity expansion is confirmed, active service resumes immediately. The current billing period continues with its recorded history intact; usage counters are never wiped or reset prematurely.

### Verify live workflows

Confirm that your workflows display **Live** status in the workflow editor. For webhook-triggered workflows, triggers remain deployed at their URLs during pauses; sending a test payload confirms the restored execution path. For scheduled automations, check the **Next runs** indicator to verify the upcoming execution time.

> **Missed events during exhaustion:** Events sent to a paused workflow during
> an exhaustion window are not automatically queued or replayed. Verify external
> sender logs if historical events need manual reprocessing.

## What's Next?

- 👉 **[Billing & Usage Overview →](/manage/billing/overview)**: Review the complete workspace billing architecture.
- **[Step Credits, Tokens & Storage](/manage/billing/credits-and-allowances)**: Detailed consumption rules across all step types.
- **[Activity & Workflow Monitoring](/manage/workspace-settings/activity)**: Monitor live workflow health, execution logs, and alert queues.
