# Automating Periodic Cloud Cost Reports

This guide will help you set up periodic cloud cost reports that are delivered directly to your inbox, allowing you to stay informed without constantly checking your dashboard.

## Use Case

Instead of logging into your OneLens dashboard to manually check weekly account-wise cost reports, you can have these reports automatically sent to your email on a weekly basis. This streamlined approach ensures that you're always up to date without logging in regularly.

## Video Guide

For a detailed walkthrough, refer to the video guide.

{% embed url="<https://youtu.be/Q6lDknRXTwA>" %}

## Step-by-Step Guide

{% stepper %}
{% step %}

### Access the Workflows

1. Navigate to the **Workflow** section in OneLens.
2. Click the **Create** button in the top-left corner to start a new workflow.

<figure><img src="/files/yWrhP6lg8OtNavqEuZSI" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create a New Workflow

1. A dialog box will appear, asking for a workflow name. Enter a descriptive name, such as Periodic Cloud Cost Reports.
2. Optionally, you can add a description.
3. Click **Create** to proceed.

<img src="/files/bEItNsAwvehKMMng1M1a" alt="" width="563">
{% endstep %}

{% step %}

### Select a Trigger

1. In the **Cost Alerts** section, set the periodic digest frequency. You can choose from:
   * **Every day**
   * **Every week**
   * **Every month**
2. For the type of cost reports, select  from Cost Alerts  with either as daily, weekly and monthly level alerts:&#x20;
   * **Account Wise Cost Alerts**
   * **Service Wise Cost Alerts**
   * **Cost Center Wise Cost Alerts**

     <figure><img src="/files/Lczd7AVGCIrXLRMM0ALt" alt="" width="563"><figcaption></figcaption></figure>

#### **Configure The Trigger**

The next step is configuring the start of the triggers.

1. Set the specific **day and time** at which you want the reports to be dispatched.

{% hint style="info" %}
**NOTE:** The time is based on the **tenant’s time zone.**
{% endhint %}

2. Choose the Aggregate Cost Type and enter the cost threshold.
3. Add any rules as per the needs.
4. Click **Save Changes** to finalize the trigger.

   <figure><img src="/files/vQaZSarWTr5NgfRTUClU" alt="" width="563"><figcaption></figcaption></figure>

{% endstep %}

{% step %}

### Set Up Email Notifications

1. After setting the trigger and conditions, click **Add Step**.

<img src="/files/iQhJJlGAo1Z3GodVNYsc" alt="" width="563">

2. Under **Messaging**, select **Send Email to Users**.

<img src="/files/OKACkLJgiUPcIJAI7lOt" alt="" width="563">

#### **Configure the Email**

* **Recipients**: Enter the email addresses of the users who will receive the notifications.
* **Cc/Bcc**: You can also add recipients in the Cc or Bcc fields.
* **Subject**: Define the subject of the email.
* **Message**: Write the content of the email.

#### **Preview the Email**

* To ensure the email is formatted correctly, click **Show preview with mock data**. This shows a preview of the email with sample data.
* If everything looks good, click **Save Changes**.

<img src="/files/5ibsiHSwLwcoA0us8C68" alt="" width="563">
{% endstep %}

{% step %}

### Publish the Workflow

Review your workflow to confirm everything is set up properly. When you’re ready, click **Publish** to activate the workflow.

<img src="/files/XfFRJPQTeLISjyzP2uWF" alt="" width="563">
{% endstep %}
{% endstepper %}

## Result

Here is how your email will look:<br>

<figure><img src="/files/OmVOZNLQtI6rhTzvHnSa" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onelens.cloud/automate/workflows-and-automation/usecases/automating-periodic-cloud-cost-reports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
