gcp.billing.budget.ensure ​
Create or update a billing budget (matched by display name).
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | Base-gcp |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | Yes | — | GCP CloudConnection UUID. |
project_id | string | No | — | GCP project override for auth; defaults to the connection's project. |
billing_account_id | string | Yes | — | Billing account id or billingAccounts/* name. |
display_name | string | Yes | — | Budget display name; used as the idempotency key. |
amount_units | integer | No | — | Specified budget amount in whole currency units. |
currency_code | string | No | — | Currency for amount; defaults to USD. |
use_last_period_amount | boolean | No | — | Use last period's spend as the amount instead of a fixed amount. |
threshold_percents | json | No | — | List of threshold fractions, e.g. [0.5, 0.9, 1.0]. |
spend_basis | string | No | — | Threshold spend basis, e.g. CURRENT_SPEND. |
budget_filter | json | No | — | Raw budgetFilter object (projects, services, credit treatment, etc.). |
notifications_rule | json | No | — | Raw notificationsRule object. |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | Echoed connection UUID. |
project_id | string | No | — | Effective project id. |
billing_account_id | string | No | — | Billing account id or billingAccounts/* name. |
amount_units | integer | No | — | Specified budget amount in whole currency units. |
currency_code | string | No | — | Currency for amount; defaults to USD. |
use_last_period_amount | boolean | No | — | Use last period's spend as the amount instead of a fixed amount. |
threshold_percents | json | No | — | List of threshold fractions, e.g. [0.5, 0.9, 1.0]. |
spend_basis | string | No | — | Threshold spend basis, e.g. CURRENT_SPEND. |
budget_filter | json | No | — | Raw budgetFilter object (projects, services, credit treatment, etc.). |
notifications_rule | json | No | — | Raw notificationsRule object. |
billing_account_name | string | No | — | Canonical billingAccounts/* name. |
budget_name | string | No | — | Full budget resource name billingAccounts//budgets/. |
budget_id | string | No | — | Short budget id. |
display_name | string | No | — | Budget display name. |
created | boolean | No | — | True when a new budget was created during this run. |
updated | boolean | No | — | True when an existing budget was updated during this run. |
budget | json | No | — | Sanitized Budget response. |
failure_reason | string | No | — | Human-readable failure reason. |
failed_step | string | No | — | Failed logical step. |
failed_layer | json | No | — | Engine failed layer. |
failed_at_state | string | No | — | State where failure occurred. |
error | string | No | — | Error message. |
error_type | string | No | — | Error class. |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | preflight | — |
ensuring | No | No | — | complete | — |
preflighting | No | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | preflight | preflighting | — |
preflighting | execute | ensuring | — |
ensuring | complete | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "gcp.billing.budget.ensure",
"initial_data": {
"connection_uuid": "value",
"billing_account_id": "value",
"display_name": "value"
}
}