GSP1356
Overview
In this lab, you explore the integration of enterprise ERP data with advanced generative AI to create a conversational supply chain management system. You learn how to transform complex, raw SAP data into an AI-ready foundation and deploy intelligent agents capable of reasoning across both SAP logistics data and non-SAP data sources such as sustainability and weather data.
What you'll learn
In this lab, you learn how to perform the following tasks:
- Prepare raw SAP supply chain data in BigQuery.
- Deploy Cortex Framework 7 to transform raw SAP tables.
- Build conversational agents on top of your SAP data.
- Integrate with Gemini Enterprise to publish your agents.
Setup and requirements
Before you click the Start Lab button
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
- Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
- Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.
How to start your lab and sign in to the Google Cloud console
-
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method.
On the right is the Lab setup and access panel with the following:
- The Open Google Cloud console button
- The temporary credentials (username and password) that you must use for this lab
- Other information, if needed, to step through this lab
Note that the lab timer is located near the top of the page, showing the remaining time.
-
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
Note: If you see the Choose an account dialog, click Use Another Account.
-
If necessary, copy the Username below and paste it into the Sign in dialog.
{{{user_0.username | "Username"}}}
You can also find the Username in the Lab setup and access panel.
-
Click Next.
-
Copy the Password below and paste it into the Welcome dialog.
{{{user_0.password | "Password"}}}
You can also find the Password in the Lab setup and access panel.
-
Click Next.
Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials.
Note: Using your own Google Cloud account for this lab may incur extra charges.
-
Click through the subsequent pages:
- Accept the terms and conditions.
- Do not add recovery options or two-factor authentication (because this is a temporary account).
- Do not sign up for free trials.
After a few moments, the Google Cloud console opens in this tab.
Note: To access Google Cloud products and services, click the Navigation menu or type the service or product name in the Search field.
Activate Cloud Shell
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
-
Click Activate Cloud Shell
at the top of the Google Cloud console.
-
Click through the following windows:
- Continue through the Cloud Shell information window.
- Authorize Cloud Shell to use your credentials to make Google Cloud API calls.
When you are connected, you are already authenticated, and the project is set to your Project_ID, . The output contains a line that declares the Project_ID for this session:
Your Cloud Platform project in this session is set to {{{project_0.project_id | "PROJECT_ID"}}}
gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
- (Optional) You can list the active account name with this command:
gcloud auth list
- Click Authorize.
Output:
ACTIVE: *
ACCOUNT: {{{user_0.username | "ACCOUNT"}}}
To set the active account, run:
$ gcloud config set account `ACCOUNT`
- (Optional) You can list the project ID with this command:
gcloud config list project
Output:
[core]
project = {{{project_0.project_id | "PROJECT_ID"}}}
Note: For full documentation of gcloud, in Google Cloud, refer to the gcloud CLI overview guide.
Scenario
It is early 2026. Scoops & Smiles is seeing a surge in pre-orders for the "Champion's Crunch" flavor. However, critical supply chain and inventory data resides within complex SAP enterprise systems. To ensure the Hamburg distribution center is stocked, you must deploy a "Conversational Supply Chain" AI assistant that allows your logistics team to ask natural language questions like, "Which vendors are at risk of missing our June delivery window?" or "Compare our current stock of cocoa against the Hamburg forecast."
Overview of Cortex Framework & SAP BDC Connect
Modernizing SAP data architectures requires seamless interoperability between SAP's rich business context and Google Cloud's AI and analytics scale:
-
SAP & Google Cloud Partnership & SAP BDC Connect for BigQuery: Building upon our strategic partnership, SAP and Google Cloud deliver a zero-copy data sharing architecture via SAP Business Data Cloud (BDC) Connect for Google BigQuery. Powered by open Delta Sharing protocols, SAP BDC Connect allows organizations to securely federate and expose business-ready SAP Data Products directly into BigQuery without building custom ETL pipelines, moving raw datasets across clouds, or losing native SAP business context and semantics.
-
Google Cloud Cortex Framework: Google Cloud Cortex Framework provides turnkey data product accelerators designed to transform and enrich enterprise data into trusted, high-quality analytical assets ready for advanced analytics, Gemini Enterprise agents, and GenAI applications.
-
Lab Environment Note: Due to hands-on lab sandbox limitations, this session utilizes preloaded and modeled SAP data inside BigQuery rather than a live SAP BDC connection. However, the exact same architecture, semantic models, and conversational agent workflows apply identically to live SAP Data Products federated via SAP BDC Connect for BigQuery.
Data Architecture & Modernization Options
Cortex Framework standardizes data processing inside BigQuery into three distinct architectural layers, supporting both direct replication (ELT/CDC) and zero-copy federation via SAP BDC Connect:
-
Raw / Ingestion Layer: The landing zone in BigQuery. In classical pipelines, this stores raw CDC logs or batch extracts. In an SAP BDC Connect pattern, this represents zero-copy federated Delta Sharing tables with native SAP business metadata intact.
-
Data Foundation Layer: A standardized, clean representation of the latest records of the source data, normalizing schemas and exposing human-readable annotations.
-
Data Product Layer: Applies aggregations, cross-domain business logic, KPI calculations, and semantic modeling optimized for BI tools and conversational AI agents.
Data Foundation
The data foundation layer establishes a clean, unified semantic baseline to feed downstream analytical and AI models:
-
For SAP BDC Connect & Zero-Copy Sources: Leverages zero-copy table federation (Delta Sharing) where BigQuery queries live SAP Data Products in-place, preserving SAP semantic models and business context without data movement.
-
For CDC-Enabled Replicated Sources: A dedicated Dataform pipeline incrementally processes raw CDC logs into continuously updated, persisted "Current State" tables.
-
For Batch / Non-CDC Sources: Functions as a virtualized semantic abstraction layer (e.g., BigQuery Views), applying on-the-fly cleansing and standardization.
The foundation layer supports dynamic schemas and extensive field-level annotations, ensuring data models are human-readable and optimized for LLM tool grounding.
Data Products
Through Dataform pipelines and semantic views, standardized SAP datasets are aggregated, joined, and shaped into structured, domain-oriented data products:
-
Data Source Specific: Granular domain models (e.g., Sales Documents, Purchase Orders, Material Inventory) that preserve business rules and can be composed into custom models.
-
Solution Samples: Use-case-specific analytical models (e.g., Supply Chain Performance Insights, Demand vs. Stock Forecasting) that ground conversational assistants and enterprise agents.
Task 1. Validate that SAP tables with sample data are copied to BigQuery
In this task, you validate that the data transfer job is finished, before you explore the raw SAP data in BigQuery.
In a real world deployment, an SAP to BigQuery connection is likely already established using the BigQuery connector for SAP, Google BigQuery Toolkit, SAP Business data Cloud, or other tools. In this scenario, the SAP sample tables have already been copied to your project using BigQuery Data Transfer Service.
In this lab environment, your only actions are to validate that the data transfer job is finished, and then explore the raw SAP data in BigQuery.
Verify completion of the BigQuery data transfer job
-
In the Google Cloud console, in the Navigation menu (
), click BigQuery > Pipeline & Connections.
-
In the Pipelines table, click on Sample dataset copy to view the details of the data transfer job.
-
Review the Summary column in the Run history table to verify the transfer status.
After you see that the Summary states The transfer run has completed successfully (represented by a green circle with a checkmark), you can move to the next task.
Note: If the Summary states that The transfer run is pending (represented by a dark gray circle), wait 2-3 minutes, and then refresh the page. You may have to refresh the page more than once to see the message that the data transfer job has completed.
Note: If the Summary states that The transfer run has failed (represented by a red exclamation mark), press the retry button or the Run transfer now button in the toolbar.

Verify raw data in BigQuery
In this section, you verify that the necessary SAP raw tables are accessible within BigQuery.
-
In the BigQuery menu (left panel), click Studio.
-
In the Explorer pane, expand your project ID: to see the options.
-
Click on the cortex_sap_raw dataset.
There should be a total of 23 tables including ekpo, marc, and mara.
- For the tables named
ekpo, marc, and mara, click on each table name to view the details, and then click on the Preview tab to explore the data.

Task 2. Deploy Google Cortex Framework for supply chain
In this task, you deploy Cortex Framework 7. This automatically generates a BigQuery Data Foundation, turning those raw tables into optimized data products.
-
In the Google Cloud console, click Activate Cloud Shell.
-
Set the required variables:
export REGION={{{project_0.default_region | "Region"}}}
export PROJECT_ID=$(gcloud config get-value project)
gcloud config set project $PROJECT_ID
export SA_CTX_NAME="cortex-dataflow-runner"
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export SA_CTX_FQN="${SA_CTX_NAME}@${PROJECT_ID}.iam.gserviceaccount.com"
export SA_DF_FQN="service-${PROJECT_NUMBER}@gcp-sa-dataform.iam.gserviceaccount.com"
- Enable the Dataform API:
gcloud services enable dataform.googleapis.com
- Download and unzip Cortex 7 artifacts from Cloud Storage:
gcloud storage cp gs://spls/gsp1356/cortex-framework.zip .
unzip cortex-framework.zip
cd cortex-framework
- Configure the Dataform service identity binding on the pre-provisioned Cortex deployer service account:
gcloud beta services identity create --service=dataform.googleapis.com --project=$PROJECT_ID
gcloud iam service-accounts add-iam-policy-binding -q ${SA_CTX_FQN} --member="serviceAccount:${SA_DF_FQN}" --role='roles/iam.serviceAccountUser' --project=$PROJECT_ID
- Verify that the required service accounts for Cortex deployment have been pre-provisioned:
gcloud iam service-accounts list --filter="email:${SA_CTX_FQN}"
- Set up the Python environment:
uv venv --clear
source .venv/bin/activate
uv sync
- Prepare the configuration file:
gcloud storage cp gs://spls/gsp1356/config.yaml.example config/config.yaml
sed -i "s/YOUR_BUILD_PROJECT_ID/$PROJECT_ID/g" config/config.yaml
sed -i "s/YOUR_SOURCE_PROJECT_ID/$PROJECT_ID/g" config/config.yaml
sed -i "s/YOUR_TARGET_PROJECT_ID/$PROJECT_ID/g" config/config.yaml
sed -i "s/YOUR_REPO_PROJECT_ID/$PROJECT_ID/g" config/config.yaml
sed -i "s/YOUR_GCP_PROJECT_ID/$PROJECT_ID/g" config/config.yaml
sed -i "s/us-central1/$REGION/g" config/config.yaml
cat config/config.yaml
- Run the deployment:
uv run cortex-build-and-deploy --config "config/config.yaml"
- When prompted by
Create them? [Y/n], enter Y.
Note: If you receive an error similar to Target datasets are missing and could not be created: 'qwiklabs-gcp-XXX-XXXXXXXX.cortex_sap_products', 'qwiklabs-gcp-XXX-XXXXXXXX.cortex_sap_foundation' , wait 3 minutes to allow permissions from step 5 to fully provision, and then repeat step 9 to run the deployment.
When you see a final message stating All workflow steps completed successfully, you can proceed to the next task. That message will resemble the following:
2026-07-23 15:42:32,521 - INFO - tools.run_all - All workflow steps completed successfully.
Click Check my progress to verify the objective.
Deploy Google Cortex Framework for supply chain
Task 3. Execute Dataform pipelines to create new data products
In this task, you execute Dataform pipelines to create new data products from the raw data in BigQuery.
Deploy the Dataform pipelines
-
In the BigQuery menu (left panel), click Dataform.
-
Click on the created repository named cortex-repository.
-
Click on the workspace named dev.
-
Click Start execution > Execute actions.
-
For Select actions to execute, enable the checkbox for Select all.
After you select all, there are 29 actions selected.
- Click OK.

-
Leave all other values as the default values, and click Start execution.
-
When prompted to Choose an account, select .
Verify the success of the deployment
-
Click Executions.
-
Verify the status is completed with a message of Success (represented by a green circle with a checkmark).
Please note that it might take a few minutes to complete the execution.
- Click the execution link for more details.
When the execution is successfully completed, there are 29 actions with a status of Success (green checkmark).


Verify the new data in BigQuery
In this task, you verify that the data products were successfully created.
-
In the BigQuery menu (left panel), click Studio.
-
In the Explorer pane, expand your project ID: to see the options.
-
Click on the cortex_sap_products dataset.
There should be a total of 10 tables including purchasing_documents_items.
- For the table named
purchasing_documents_items, click on the table name to view the details, and then click on the Preview tab to explore the data.

Click Check my progress to verify the objective.
Execute Dataform pipelines to create new data products
Task 4. Start a chat conversation about a BigQuery table
In this task, you use the Conversational Analytics Agent to interact with your data.
-
Remain on the BigQuery tab for the purchasing_documents_items table.
-
At the top of the BigQuery console, click Chat (next to Query) to open the Gemini chat.
-
Enter this prompt:
List the top 10 open PO items ranked by their net value in currency USD.
The response includes a message similar to Here are the top 10 open Purchase Order (PO) items ranked by their net order value in USD, likely followed by a data table and/or chart of the details.

Click Check my progress to verify the objective.
Start a chat conversation about a BigQuery table
Task 5. Convert a chat to a BigQuery data agent
In this task, you transform your conversational session into a reusable agent.
In addition to the SAP Cortex datasets, your BigQuery instance includes a dataset named supply_chain_external. This dataset was automatically created and preloaded with data during the lab startup. It contains a snapshot of current weather events that we can now integrate with SAP supply chain data. While a real-world scenario might use live weather APIs, we provided this static snapshot to keep the lab simple and performant.
-
In the Explorer pane, expand your project ID: to see the options.
-
Click on the supply_chain_external dataset.
-
Click on the weather_events table, and click Chat to start the chat with this table.
-
Ask this question:
Are there any active or imminent severe weather events globally in major industrial regions?
You receive a few weather events as a response.
- In the chat interface, under the Details menu (right side of screen), select Create Agent.

-
For Agent name, enter: cortex_sap_agent
-
Click Add source.
-
Click cortex_sap_products to see all data products located in this dataset.
-
Select the following data products to combine weather data with the supply chain data:
- purchasing_document_headers
- purchasing_document_items
- purchasing_document_schedule_lines
- purchasing_organizations
- vendors
-
Click Confirm.
-
Configure agent instructions by adding the following text to the Instructions box.
The following text is an example of instructions you could use, but feel free to modify and experiment.
You are an expert supply chain optimization assistant. Your primary role is to help mitigate supply chain disruptions by cross-referencing external weather alerts with internal SAP purchasing data.
When queried about weather, check the weather_events table for active or imminent severe conditions.
When asked about impacted suppliers, join the location data (country, region, or city) from the weather_events table with the location fields in the vendors_md table.
To determine spend or find open orders, join the impacted vendors with the purchasing_document_headers and purchasing_document_items tables, focusing on the net order value and quantities.
When providing mitigation strategies or drafting emails, adopt a professional, proactive, and urgent tone appropriate for enterprise supply chain management. Always use the provided tables to ground your answers.

-
Click Save.
-
Click Publish, and then click Publish agent to confirm.
-
Click Close to close the Share window, which you do not need at this time.
-
Click Create conversation (next to Publish and Share).
-
Test the agent by entering the following prompts, one at a time:
Are there any active or imminent severe weather events globally in major industrial regions?
Which of my key suppliers may be impacted by these events? Sort by spend.
Click Check my progress to verify the objective.
Convert a chat to a BigQuery data agent
Task 6. Build and configure the Gemini Enterprise app
In this task, you build and configure the Gemini Enterprise app.
-
In the Google Cloud console, in the search bar, type AI Applications, and select AI Applications from the list of results.
-
Click Create a new app.
-
In the Create App dialog, choose the Gemini Enterprise type by clicking Learn More.
-
For App name, enter: cortex-sap-agent-app
Leave the remaining settings as their defaults.
-
Click Create.
-
In the Gemini Enterprise navigation menu (left panel), click on Integration.
-
For Choose an identity provider for your entire project, select Use Google Identity.
-
Click Confirm Workforce Identity.
-
Open your application by clicking on the link in the Your Gemini Enterprise webapp is ready section on the Integration page.
The link resembles https://vertexaisearch.cloud.google.com/home/cid/0d3c899a-695f-4168-860b-77be164c0a87?hl=en_US , and the application opens in a new browser tab.
- Click Get started.
Although the application is not yet connected to any data sources, you can still interact with it.
- Enter a simple prompt such as
Hello there! to start the conversation.
Leave this browser tab open as you proceed to the next task.
Click Check my progress to verify the objective.
Build and configure the Gemini Enterprise app
Task 7. Publish the conversational agent in Gemini Enterprise
In this task, you register the conversation analytics agent created in the previous step in Gemini Enterprise as an a2a agent using its agent card.
The official Google Cloud documentation for agents provides a detailed description on how to add an a2a agent in Gemini Enterprise. This process consists of two main steps: configuring authorization details and registering the agent in Gemini Enterprise. Let us approach them below.
Configure the authorization details
-
Return to the original browser tab for the Google Cloud console.
-
In the Google Cloud console, in the Navigation menu (
), click APIs & Services > OAuth consent screen.
-
Click Get started, and enter the following information for the consent screen:
- For App name, enter: application
- For User support email, select the lab's username from the drop-down:
- For Audience, choose Internal so only users in your organization can use it.
- For Contact information, enter the lab's username:
- Enable the checkbox for I agree to the Google API Services: User Data Policy.
-
Click Create.
-
In the Google Cloud console, in the Navigation menu (
), click APIs & Services > Credentials.
-
Click Create credentials, and select OAuth client ID.
-
For Application type, select Web application.
-
In the Authorized redirect URIs section, click Add URI, and enter: https://vertexaisearch.cloud.google.com/oauth-redirect
-
Click Create.

- In the OAuth client created panel, click Download JSON.
The downloaded JSON includes the Client ID, Authorization URI, Token URI, and Client secret for the selected Google Cloud project. You need these details to create an authorization resource.
- Click OK to close the OAuth client details window.
Register the agent in Gemini Enterprise
-
Return to your BigQuery console by opening the Navigation menu (
), and clicking BigQuery.
-
In the BigQuery menu (left pane), click on Agents, and then click on the tile for the cortex_sap_agent agent.
-
Click Edit Agent under the Details menu (right panel).
-
Click Publish to see the agent details.
-
In the section for Additional channels > Integrate via A2A (Agent2Agent), click Copy JSON.

-
Return to the AI application again by searching AI Applications in the search bar, and selecting AI Applications from the list of results.
-
Click on cortex-sap-agent-app.
-
In the Gemini Enterprise navigation menu (left panel), click Agents.
-
Click Add Agent.
-
In the Choose an agent type section, click Add for Custom agent via A2A.
-
In the Agent card JSON field, paste the agent card JSON that you copied earlier in step 5.
-
Click Preview agent details, and then click Next.

-
Select Custom OAuth.
-
For Client ID, enter the client_id from the JSON file that you downloaded in the previous section (for example, 263636146694-34c9a7di8ojodnu50gj952itcsshrrl0.apps.googleusercontent.com).
-
For Client secret, enter the client_secret from the JSON file (for example, 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).
-
For Authorization URL, enter the auth_uri from the JSON file (for example, https://accounts.google.com/o/oauth2/auth), and the append the following string to the end: ?access_type=offline&prompt=consent
The Authorization URL now resembles https://accounts.google.com/o/oauth2/auth?access_type=offline&prompt=consent.
-
For Token URL, enter the token_uri from the JSON file (for example, https://oauth2.googleapis.com/token).
-
For Scopes, enter the following two values separated by a single space:
https://www.googleapis.com/auth/bigquery https://www.googleapis.com/auth/cloud-platform
- Click Finish.
After the agent is successfully created, the page refreshes to show you the Agents table with all created agents, including cortex_sap_agent.

Click Check my progress to verify the objective.
Publish the conversational agent in Gemini Enterprise
Task 8. Explore the conversational supply chain scenario through a chat with your agent
In this task, you explore the conversational supply chain scenario by asking questions to the agent.
-
In the Agents table, identify the row for the agent named cortex_sap_agent. Scroll to the column named Actions, click More options (three dots icon) to see the options, and then click Preview.
-
Start the conversation by entering Hello there! into the chat.
-
If prompted for authorization, click Authorize, and select the lab's username: . Then, click Allow.
You can now ask questions about the data. The real power of this integration becomes clear when you ask the agent to reason across multiple domains simultaneously. For example, these questions below illustrate how overlaying external variables, like severe weather, onto your core SAP supply chain records gives you a complete operational picture. By combining these datasets, you can move from reacting to delays to proactively pinpointing at-risk suppliers, calculating the exact value of exposed purchase orders, and drafting mitigation plans before the storm even hits.
- Enter the following prompts one at a time to explore the power of this agent:
Are there any active or imminent severe weather events globally in major industrial regions?
Which of my key suppliers may be impacted by these events? Sort by spend.
For at-risk suppliers, list open Purchase order items. Include PO#, Material, Qty, and Value.
Suggest mitigation strategies for the top two suppliers and draft a proactive email to the highest-risk contact.

Click Check my progress to verify the objective.
Explore the conversational supply chain scenario through a chat with your agent
Congratulations!
You have successfully bridged the gap between SAP and Agentic AI. You are now ready to redefine business processes with Google Cloud and SAP!
Next steps / Learn more
Google Cloud training and certification
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated October 27, 2026
Lab Last Tested October 27, 2026
Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.