This guide demonstrates how to automate ingestion and indexing of Google Drive content using Snowflake Openflow and Cortex Search Service, enabling permission-aware AI-powered search while preserving access controls.
Unlock hidden value in enterprise documents with Snowflake Openflow and Cortex. In this use case, you'll see how to automate ingestion and indexing of Google Drive content—enabling permission-aware, AI-powered search and intelligent applications like chatbots and dashboards. Say goodbye to manual ETL and hello to real-time insight.
In today's data-driven world, critical business knowledge often lives in unstructured formats on platforms such as Google Drive. Turning those documents into searchable, AI-ready assets is a major challenge—until now.
With Snowflake Openflow's Google Drive Connector, you can automatically ingest, process, and index your Drive content in Snowflake, all while preserving native access controls. This blog explores how to:
Organizations across industries face common data onboarding hurdles:
Snowflake Openflow — Snowflake's open, API-driven data workflow engine built on Apache NiFi — directly addresses these challenges. By integrating Google Drive content with Snowflake Cortex using Openflow, businesses gain:
Faster Time to Insights: Automated pipelines make new data available in Snowflake within minutes, accelerating the data-to-value cycle.
Lower Operational Overhead: Teams manage a single platform instead of juggling multiple ETL tools or custom scripts, reducing pipeline failures and troubleshooting time.
Greater Agility and Scalability: Openflow's configurable and scalable architecture supports rapid onboarding of new sources and handles both batch and streaming data.
Improved Data Quality and Governance: Each step in the pipeline is fully traceable, providing end-to-end visibility and data lineage for compliance and troubleshooting.
AI-Readiness: Unstructured content like documents and images is prepared inline for AI/ML models, enabling real-time enrichment or analysis within the data flow.
Adherence to Access Controls: AI assistants respect Google Drive's native sharing permissions, ensuring data security and privacy are preserved.
This solution involves several key phases — starting with foundational configurations in Google Cloud and Snowflake, and culminating in the deployment and operation of the Openflow Google Drive Connector.
To begin, ensure your Google Cloud and Snowflake environments are properly configured.
Set up the necessary credentials and permissions to allow Snowflake to access Google Drive data securely:
1. Create a Google Cloud Project:
Begin by creating a new project in the Google Cloud Console. This project acts as the foundation for managing APIs, billing, and permissions across all Google Cloud services.
2. Enable the Required APIs:
Within your Google Cloud project, navigate to the API Library and enable the following APIs:
These are essential for accessing and indexing content from Google Drive.
3. Create a Service Account and Generate a Key:
To allow Openflow to authenticate and interact with Google APIs securely, follow these steps:
4. Grant Domain-Wide Delegation to the Service Account:
This step allows your service account to impersonate users and access Google Workspace data (like Google Drive files) on their behalf.
Steps:
https://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.metadata.readonlyhttps://www.googleapis.com/auth/admin.directory.group.member.readonlyhttps://www.googleapis.com/auth/admin.directory.group.readonlyhttps://www.googleapis.com/auth/drive.filehttps://www.googleapis.com/auth/drive.metadata1. Create a Shared Drive: Navigate to your Google Drive interface. On the left-hand menu, click "Shared drives" → then click "New" to create a new shared drive. Give it a name (e.g., Openflow Data Repository) and click Create.
This shared drive will act as the source location for documents to be ingested by Openflow into Snowflake.
2. Upload Files to the Shared Drive:
Upload or move relevant documents (PDFs, DOCX, TXT, etc.) into the newly created Shared Drive. These files will be accessed by Openflow for ingestion into Snowflake, so ensure the content is appropriate for indexing and follows your organization's data governance policies.
To enable secure and organized data access, you'll need to create a dedicated user, role, and warehouse for the Openflow connector.
1. Create a Snowflake User and Role
2. Configure Key-Pair Authentication: Snowflake strongly recommends key-pair authentication.
3. Designate a Warehouse:
4. Create Database and Schema:
This step sets up all necessary controller services and parameters required for the connector to function properly.
Once your Google Cloud and Snowflake environments are prepared, the next step is to install and configure the Openflow Connector for Google Drive Cortex Connect.
1. Install the Connector:
2. Configure the Connector Parameters:
Once the connector is added to the Openflow canvas, follow these steps to configure it:
Right-click on the imported process group on the Openflow canvas and select Parameters.
Enter the required values for all the parameters in the context window.
3. Enable Controller Services and Start the Flow:
Steps:
Once started, the Openflow connector for Google Drive (Cortex connect) automates the entire process, including Change Data Capture (CDC).
1. CDC (Change Data Capture): The CaptureGoogleDriveChanges processor continuously watches your specified Google Drive for content and updates, including removed, created, and updated events. This ensures your data in Snowflake is always fresh.
2. Metadata Processing: The Process Google Drive Metadata group extracts crucial information from each Google Drive file change.
3. Duplicate Content Check: The Check if Duplicate Content group ensures efficiency.
4. Snowflake Staging and Parsing (Cortex): The Snowflake Stage and Parse PDF group handles the conversion and initial processing of your unstructured data.
5. Updating Snowflake Cortex: The Update Snowflake Cortex group manages the storage and indexing of the processed data in Snowflake tables, which are the foundation for the Cortex Search Service.
6. Cortex Search Service Creation: As part of the initialization flow (managed by the Init process group), a CORTEX SEARCH SERVICE named cortex.search_service is automatically created on the DOCS_CHUNKS table. This service is configured to use user_ids and user_emails as attributes, which is crucial for enforcing access control.
Once the connector has ingested and processed your Google Drive content, you can query the Cortex Search Service to unlock powerful insights and build intelligent applications. Snowflake Cortex Search Service can be queried using three methods: Python API, REST API, or the SQL SEARCH_PREVIEW Function.
Crucially, the connector ensures that your search results adhere to the original Google Drive permissions. You can filter responses to restrict them to documents that a specific user has access to.
The SEARCH_PREVIEW function is excellent for quick validation and testing directly within a Snowflake worksheet. It allows you to:
Ideal for rapid prototyping before embedding results in dashboards or applications.
SELECT PARSE_JSON(
SNOWFLAKE.CORTEX.SEARCH_PREVIEW(
'<application_instance_name>.cortex.search_service',
'{
"query": "<your_question>",
"columns": ["chunk", "web_url", "full_name", "last_modified_date_time", "user_ids", "user_emails"],
"filter": {"@contains": {"user_emails": "<user_emailID>"} },
"limit": <number_of_results>
}'
)
)['results'] AS results;
Replace <application_instance_name> with your database name, <your_question> with your search query, <user_emailID> with the email address of the user for whom you want to filter results, and <number_of_results> (max 1000, default 10).
Example:
SELECT PARSE_JSON(
SNOWFLAKE.CORTEX.SEARCH_PREVIEW(
'GDRIVE_POC.cortex_search_service',
'{
"query": "On which technology is Openflow based?",
"columns": ["chunk"],
"filter": {"@contains": {"user_emails": "radhika.p.jain@dev.kipi.bi"} },
"limit": 10
}'
)
)['results'] AS results;
This allows an IT team member to query documents while adhering to Google Drive access controls.
For programmatic access and building applications, the Python API is ideal.
The REST API offers direct integration with other systems or services.
The Snowflake Openflow Connector for Google Drive—paired with Cortex Search Service—delivers a powerful, automated solution for extracting value from unstructured data. By streamlining ingestion, processing, and semantic indexing, it eliminates manual ETL barriers and empowers teams with real-time, permission-aware search.
With this setup, organizations can:
Ready to transform how your organization leverages Google Drive data?
Discover the power of Openflow and Cortex—turning documents into enterprise intelligence, securely and at scale.