[Yandex Cloud documentation](../../../index.md) > [Yandex Cloud Functions](../../index.md) > [Concepts](../index.md) > [Trigger](index.md) > Trigger for budgets

# Trigger for budgets that invokes a Cloud Functions function

[Trigger](index.md) for [budgets](../../../billing/concepts/budget.md) calls a Cloud Functions [function](../function.md) when threshold values are exceeded.

A trigger for budgets needs a [service account](../../../iam/concepts/users/service-accounts.md) to call the function.

For more information about creating a trigger for budgets, see [Creating a trigger for budgets that invokes Cloud Functions](../../operations/trigger/budget-trigger-create.md).

## Roles required for the proper operation of a trigger for budgets {#roles}

* To create a trigger, you need a permission for the service account under which the trigger runs the operation. This permission comes with the [iam.serviceAccounts.user](../../../iam/concepts/access-control/roles.md#sa-user) and [editor](../../../iam/concepts/access-control/roles.md#editor) roles or higher.
* For the trigger to fire, the service account requires the `functions.functionInvoker` role for the function invoked by the trigger.

## Format of the message from the trigger for budgets {#format}

After the trigger is activated, it sends the following message to the function:

```json
{
   "messages":[
      {
         "billing_account_id":"a6q6***",
         "budget_id":"a626***",
         "budget_display_name":"name",
         "amount":90012.00,
         "currency":"RUB",
         "period":"2021",
         "budgeted_amount":100000.00,
         "threshold_amount":90000.00,
         "threshold_type":"amount"
      }
   ]
}
```

Where:

* `billing_account_id`: Billing account ID.
* `budget_id`: Budget ID.
* `budget_display_name`: Budget name.
* `amount`: Cost of resources or personal account balance when notifications were sent.
* `currency`: Payment currency.
* `period`: Budget calculation period.
* `budgeted_amount`: Budget amount.
* `threshold_amount`: Consumption threshold that triggered notifications.
* `threshold_type`: Threshold type:
  * `amount`: Currency.
  * `percent`: Percentage.

## Use cases {#examples}

* [Creating a budget trigger that invokes a Cloud Functions function to stop VM instances](../../tutorials/serverless-trigger-budget-vm.md)

## Useful links {#see-also}

* [Trigger for budgets that invokes a Serverless Containers container](../../../serverless-containers/concepts/trigger/budget-trigger.md)
* [Trigger for budgets that sends messages to WebSocket connections](../../../api-gateway/concepts/trigger/budget-trigger.md)