If you want to process files directly in Snowflake, use the Local Processing method instead.
Cloud Processing and Zero Data Retention
Cloud Processing uses your account. If you want Zero Data Retention (ZDR) with Cloud Processing, you must first enable ZDR in your account. For information on how to do this, go here.Cloud Processing and Billing
When you use Cloud Processing, documents are processed using your account that is hosted by LandingAI. Billing for processing documents (like running parsing and field extraction) is managed by LandingAI. Billing for all other Snowflake usage, including the app’s CPU and GPU usage, will continue to be billed through Snowflake.Extracted Output
The output from Cloud Processing matches the response you get when calling the API directly. For complete details on the response format, go to API Reference.Quickstart: Cloud Processing
- Create an account at va.landing.ai.
- Get your API key. For detailed instructions on how to get the API key, go to API Key.
- Enter your API key in Snowsight.
- Grant permissions to the stage with the files you want to parse.
- Run the parse commands.
- If you want to run field extraction, include the JSON schema in the parse command.
Enter Your API Key in Snowsight
In order to parse documents with the Cloud Processing method, you must enter your API key in the app in Snowsight. Only one API Key can be entered in the app at a time. In case multiple users access the app, the API key is masked in the interface. To enter your API key:- Open Snowsight.
- Go to Catalog > Apps > LandingAI Agentic Document Extraction.
- Scroll down to Processing Methods and ensure that Cloud Processing (API) is selected.
- Enter your API key in the Cloud Processing section.
- Click Add API Key.
Parse with Cloud Processing
The app provides this function to run Cloud Processing:doc_extraction.cloud_extract_doc_structure
function in different scenarios.
Parse a Single File
Run the command below to parse a single file in a Snowflake stage. Replace these placeholders with your information:APP_NAME
, your_db
, your_schema
, your_stage
, and /path/to/file.pdf
.
Parse a Batch of Files in a Table
One way to process multiple documents is to create a table that lists the filenames of documents stored in a Snowflake stage. Then, write a SQL script that processes each file by using the file paths from the table. This approach uses thebuild_scoped_file_url
function to connect the file paths in your table to the actual documents in your stage.
Use the following script to process multiple files from a table. Replace these placeholders with your information: APP_NAME
, your_db
, your_schema
, your_stage
, and documents
. The script assumes you have a table called documents
that has a column called file_path
, which lists the filenames of the documents you want to process.
Sample Script: Parse a Batch of Files in a Table
Let’s say you have the following setup:- APP_NAME: LANDINGAI_AGENTIC_DOCUMENT_EXTRACTION
- Database: DEMO_DB
- Schema: DEMO_SCHEMA
- Stage: DEMO_STAGE (contains PDFs)
- Table: STATEMENTS
file_path
. The file_path
column contains the following the following filenames:
- document-1.pdf
- document-2.pdf
- document-3.pdf

Parse a Batch of Files in a Fixed List
One way to process multiple documents is to specify the exact filenames directly in your SQL script. This approach is useful when you know exactly which files you want to process and don’t need to create a separate table. This method creates a temporary list of filenames within the SQL query itself and processes each file from your Snowflake stage. Use the following script to process multiple files from a fixed list. Replace these placeholders with your information:APP_NAME
, your_db
, your_schema
, your_stage
, and the file paths in the VALUES section.
Sample Script: Parse a Batch of Files in a Fixed List
Let’s say you have the following setup: This example processes three specific PDF files stored in a stage called DEMO_STAGE.- APP_NAME: LANDINGAI_AGENTIC_DOCUMENT_EXTRACTION
- Database: DEMO_DB
- Schema: DEMO_SCHEMA
- Stage: DEMO_STAGE
- invoice-001.pdf
- invoice-002.pdf
- invoice-003.pdf

Field Extraction
The app on Snowflake supports field extraction, which allows you to extract specific key:value pairs from the documents you are parsing. The key:value pairs are defined using an extraction schema. Learn more about field extraction in Overview: Extract Data. To run field extraction, add the field extraction schema as a parameter in thedoc_extraction.cloud_extract_doc_structure
function.
Sample Script: Run Field Extraction on Single File
Let’s say you have the following setup:- APP_NAME: LANDINGAI_AGENTIC_DOCUMENT_EXTRACTION
- Database: DEMO_DB
- Schema: DEMO_SCHEMA
- Stage: DEMO_STAGE
- statement-jane-harper.pdf
- Employee Name
- Employee Social Security Number