gcp.billing.cost.summarize ​
Summarize GCP cost from the BigQuery billing export, grouped by dimensions.
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 | — | Query project; defaults to the connection's project. |
export_table | string | Yes | — | Billing export table ref, e.g. dataset.gcp_billing_export_v1_XXXXXX or project.dataset.table. |
start_date | string | No | — | Inclusive lower bound on usage_start_time (RFC3339/timestamp). |
end_date | string | No | — | Exclusive upper bound on usage_start_time (RFC3339/timestamp). |
group_by | json | No | — | List of billing-export column expressions to group by; defaults to [service.description]. |
location | string | No | — | BigQuery location, e.g. US or EU. |
limit | integer | No | — | Max grouped rows; defaults to 100. |
poll_interval_seconds | integer | No | — | Poll interval when the job is not immediately complete. |
timeout_seconds | integer | No | — | Overall wait budget for job completion. |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | Echoed connection UUID. |
project_id | string | No | — | Effective project id. |
export_table | string | No | — | Billing export table ref, e.g. dataset.gcp_billing_export_v1_XXXXXX or project.dataset.table. |
start_date | string | No | — | Inclusive lower bound on usage_start_time (RFC3339/timestamp). |
end_date | string | No | — | Exclusive upper bound on usage_start_time (RFC3339/timestamp). |
group_by | json | No | — | List of billing-export column expressions to group by; defaults to [service.description]. |
location | string | No | — | BigQuery location, e.g. US or EU. |
limit | integer | No | — | Max grouped rows; defaults to 100. |
poll_interval_seconds | integer | No | — | Poll interval when the job is not immediately complete. |
timeout_seconds | integer | No | — | Overall wait budget for job completion. |
rows | json | No | — | Grouped cost rows with cost, credits, net_cost. |
row_count | integer | No | — | Number of grouped rows. |
summary | json | No | — | Totals: total_cost, total_credits, net_cost, row_count. |
query | string | No | — | The generated SQL executed. |
job_id | string | No | — | BigQuery job id. |
total_bytes_processed | string | No | — | Bytes scanned by the query. |
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 | — |
preflighting | No | No | — | execute | — |
summarizing | No | No | — | complete | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | preflight | preflighting | — |
preflighting | execute | summarizing | — |
summarizing | complete | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "gcp.billing.cost.summarize",
"initial_data": {
"connection_uuid": "value",
"export_table": "value"
}
}