Object contexts

Preview

This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

This document describes how object contexts let you attach contextualinformation to your objects to help you manage and discover data.

To learn how to attach and manage object contexts, seeUse object contexts.

Overview

Object contexts let you attach descriptive information as key-value pairs toyour Cloud Storage objects. You can embed contexts in your objects to improvehow you categorize, track, and search your data. You can apply contexts when youcreate new objects or add contexts to existing objects.

For example, when you upload an invoice object, you can enrich it withcustomer_id andpayment_status contexts:

{"contexts":{"custom":{"customer_id":{"value":"cust-78901"},"payment_status":{"value":"unpaid"}}}}

Use cases for object contexts

Object contexts let you classify, track, and enrich your data. The followingsections describe the scenarios for using object contexts to manage different typesof information.

Group and classify objects

Classify and organize objects across buckets and projects. Use contexts to tagdata by attributes such as dataset origin, ownership, or costcenter.

  • Example 1: Assign the contextdata_classification: PII to objectscontaining personally identifiable information (PII) so that compliance policies can handle them.

  • Example 2: Group new training images during ingestion by assigningbatch_id: 2025_Q4_Model_Run context to enable efficient model testing andretrieval.

Track workflows

To optimize custom workflows and prevent redundant operations, embed workflowstate information directly onto objects to track their journey through aprocessing pipeline.

  • Example 1: Useprocessing_status: awaiting_review toindicate objects pending external release approval.

  • Example 2: Useprocessed_by: analytics_pipeline to prevent your customdata processing service from re-scanning files that have already completed astage.

Enrich objects with application-specific context

Attach specific information about an application or business process to provideadditional context and data lineage for each object.

  • Example 1: For a satellite image, record capture details, such ascapture_angle:45deg_NW, or track the file's history withlineage: ingested_from_s3.

  • Example 2: Embed details about a file's contents, such asdocument_type:service_manual andvehicle_model: f250.

Benefits of object contexts

Object contexts extend the capabilities of your Cloud Storage objects. Byassociating custom key-value pairs directly with stored objects, you can achievethe following benefits:

  • Data discovery: Object contexts help with filtering of object listings,limiting inputs for workloads to only the objects of interest.

  • Interoperability: Object contexts accept string values withoutpredefinition, to support interoperability with object tags from other cloudproviders and simplifying migrations.

  • Data persistence: Context data persists across the object's lifecycle.When you copy, rewrite, compose, move, or restoreobjects, contexts are automatically transferred. Preserving object contextshelps all associated contextual data remain linked to the objects,regardless of any changes to their storage location or state.

  • Identity and Access Management control over context modification: UseIdentity and Access Management(IAM) permissions to define who can add, change, or remove contexts tomaintain a reliable audit trail.

Pricing

During the preview, object contexts are offered at no charge. After the previewends, an additional storage fee will apply for object contexts. The pricingdetails will be available once the preview ends.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.