Skip to main content
LLM Controls integrates with Google OAuth for authenticating the Gmail loader, Google Drive loader, and Google Drive Search components. Learn how to create an OAuth app in Google Cloud, obtain the necessary credentials and access tokens, and add them to LLM Controls’ Google components.

Create an OAuth Application in Google Cloud

  1. Navigate to the Google Cloud Console.
  2. Click Select a project, and then click New Project to create a new project.
Oath1 Pn
  1. To enable APIs for the project, select APIs & Services, and then click Library. Enable the APIs you need for your project. For example, if your flow uses the Google Drive component, enable the Google Drive API.
  2. To navigate to the OAuth consent screen, click APIs & Services, and then click OAuth consent screen.
  3. Populate your OAuth consent screen with the application name, audience, and user support email. For the audience, select External. This creates a testing application environment that you can add users to.
  4. To add users to your OAuth audience, click Audience. Under Test users, click Add users. Enter any email addresses you intend to use to authenticate LLM Controls with OAuth. These email addresses have access to the application while it’s in a Testing publishing state. For more information, see the Google documentation.
  5. To create an OAuth Client ID, navigate to Clients and then click Create Client.
  6. Choose Desktop app as the application type, and then name your client ID.
  7. Click Create. A Client ID and Client Secret are created. Download the credentials as a JSON file to your local machine and save it securely.
Oath2 Pn

Retrieve Access and Refresh Tokens

With your OAuth application configured and your credentials JSON file created, follow these steps to authenticate the LLM Controls application.
  1. Create a new project in LLM Controls.
  2. Add a Google OAuth Token component to your flow.
  3. In the Credentials File field of the Google OAuth Token component, enter the path to your Credentials File, the JSON file containing the Client ID credentials you downloaded from Google in the previous steps.
  4. In the Scopes field of the Google Oauth Token component, enter the scope required to access your resources. For example, to allow your LLM Controls application to access a user’s Google Drive, the scope is https://www.googleapis.com/auth/drive. For more information, see the Google documentation.
  5. To authenticate your application, in the Google OAuth Token component, click Play. A new tab opens in the browser to authenticate your application using your Google Cloud account. You must authenticate the application with the same Google account that created the OAuth credentials.
infoIf a new tab does not open automatically, check the LLM Controls Logs for the Google authentication URL. Open this URL in your browser to complete the authentication.
  1. After successful authentication, your LLM Controls application can request and refresh tokens. These tokens enable LLM Controls to interact with Google services on your behalf and execute your specified requests.

Create a flow with Google Drive loader

For a pre-built JSON file of a flow that uses the Google Drive loader component, download the Google Drive Document Translation Example Flow JSON to your local machine. Example flow structure:
Google OAuth Token → Parse Data → JSON Cleaner → Google Drive Loader → Prompt → OpenAI Model → Chat Output
In this example, the Google Drive loader component loads a text file hosted on Google Drive, translates the text to Spanish, and returns it to a chat output.
  1. Download the Google Drive Document Translation Example Flow JSON to your local machine.
  2. To import the downloaded JSON to LLM Controls, click Options, and then select Import.
  3. In the Credentials File field of the Google OAuth Token component, enter the path to your Credentials File, the JSON file containing the Client ID credentials you downloaded from Google in the previous steps.
  4. In the Scopes field of the Google Oauth Token component, enter the scope required to access your resources. For example, to allow your LLM Controls application to access a user’s Google Drive, the scope is https://www.googleapis.com/auth/drive. For more information, see the Google documentation. The example flow includes a Parse data component to convert the data output of the Google OAuth Token component to the text input of the JSON Cleaner component.
  5. To allow the LLM Controls component to access the document in Google Drive, copy the Google Drive documentID from the document’s URL.
infoThe documentID is located between /d/ and /edit in a Google Drive document’s URL. For example, in the URL https://drive.google.com/file/d/1a2b3c4D5E6F7gHI8J9klmnopQ/edit, the documentID is 1a2b3c4D5E6F7gHI8J9klmnopQ.
  1. In the Google Drive loader component, in the Document ID field, paste the document URL.
  2. To view the translated document, open the Playground.

Google Sheets

This component creates, reads, and writes Google Sheets using credentials from Google Authenticator. It supports operations including create, read, write, append, clear, and listing sheets, with automatic spreadsheet creation for write/append when no spreadsheet ID is provided.

Prerequisites

  • Google Credentials JSON (from Gmail Setup Script or Google Universal Authenticator)

To Use Google Sheets

  1. Paste your Google Credentials JSON (from Gmail Setup Script or Universal Authenticator)
  2. Select an Operation (create, read, write, append, clear, or list_sheets)
  3. For read/write/append/clear/list_sheets: Provide a Spreadsheet ID or URL
  4. For write/append: Provide data via Input Data connection or Data to Write (JSON)
  5. Optionally configure Range, Include Headers, and Value Input Option
Inputs
NameDisplay NameInfo
credentials_jsonGoogle Credentials JSON (Paste JSON Object)Paste the credentials JSON object (not a string, not escaped quotes) from Gmail Setup Script or Universal Authenticator.
input_dataInput Data (from Component)Connect data from other components (like Resume Results Formatter) to write to Google Sheets
spreadsheet_idSpreadsheet ID or URLGoogle Sheets spreadsheet ID (found in URL) or full Google Sheets URL (not needed for ‘create’ operation)
spreadsheet_titleNew Spreadsheet TitleTitle for new spreadsheet (only used with ‘create’ operation)
initial_sheet_namesInitial Sheet NamesComma-separated list of sheet names for new spreadsheet (only used with ‘create’ operation)
range_nameRangeRange to read/write (e.g., ‘Sheet1!A1:C10’, ‘Results!A1:Z1000’, or ‘A:C’)
operationOperationOperation to perform on the Google Sheet. Options: create, read, write, append, clear, list_sheets.
data_to_writeData to Write (JSON)JSON array of arrays for write/append operations (e.g., [[‘Name’, ‘Age’], [‘John’, 25]]) - not needed if using Input Data connection
include_headersInclude HeadersWhether to treat the first row as headers when reading
value_input_optionValue Input OptionHow input data should be interpreted. Options: RAW, USER_ENTERED.
Outputs
NameDisplay NameInfo
dataSheet DataOperation result as a Data object containing sheet data, operation status, and metadata.
sheet_urlSheet URLThe spreadsheet URL as a Message.

Google Docs

This component reads Google Docs and extracts text content and metadata using credentials from Google Universal Authenticator. It supports reading document content with optional formatting preservation and retrieving document metadata.

Prerequisites

  • Google Credentials JSON (from Google Universal Authenticator with Docs or Drive permissions)

To Use Google Docs

  1. Connect Google Credentials JSON from Google Universal Authenticator or paste JSON string
  2. Enter the Document ID (found in the Google Docs URL)
  3. Select an Operation (read or metadata)
  4. Optionally toggle Include Metadata and Preserve Formatting
Inputs
NameDisplay NameInfo
credentials_jsonGoogle Credentials JSONConnect from Google Universal Authenticator component output, or paste JSON string containing OAuth 2.0 access token information for Google Docs access
document_idDocument IDGoogle Docs document ID (found in the URL)
operationOperationOperation to perform on the Google Doc. Options: read, metadata.
include_metadataInclude MetadataWhether to include document metadata with content
preserve_formattingPreserve FormattingWhether to preserve basic formatting information in the extracted text
Outputs
NameDisplay NameInfo
dataDocument DataFull operation result as a Data object containing text, metadata, and word/character counts.
textDocument TextExtracted document text as a Data object.
metadataDocument MetadataDocument metadata (ID, title, revision, word count, etc.) as a Data object.
resultOperation ResultResult of the last operation as a Data object.

Gmail Manager

This component provides complete Gmail management with email extraction, sending, deletion, label management, attachment processing, and Google Drive integration. It supports duplicate avoidance, search queries, and multiple output formats for downstream processing.

Prerequisites

  • Gmail Credentials JSON (from Gmail Setup Script or Google Universal Authenticator)

To Use Gmail Manager

  1. Paste your Gmail Credentials JSON
  2. Select an Operation (extract, list, send, delete, mark_read, mark_unread, add_labels, remove_labels, create_label, move, create_and_apply_label, or show_extracted_emails)
  3. For extract: Configure Target Labels, Search Query, and Maximum Emails
  4. For send: Provide To, Subject, and Body in advanced options
  5. Optionally enable Include Attachments, Download Attachments, and Google Drive Upload
Inputs
NameDisplay NameInfo
credentials_jsonGmail Credentials JSONPaste credentials JSON from Gmail Setup Script or Universal Authenticator.
operationOperationOptions: extract, list, send, delete, mark_read, mark_unread, add_labels, remove_labels, create_label, move, create_and_apply_label, show_extracted_emails.
target_labelsTarget LabelsComma-separated Gmail labels (e.g., INBOX,IMPORTANT)
search_queryGmail Search QueryGmail search operators (e.g., ‘from:user@domain.com has:attachment’)
max_emailsMaximum Emails
include_attachmentsInclude Attachments
clean_contentClean Email Content
download_attachmentsDownload Attachments
avoid_duplicate_extractionAvoid Duplicate ExtractionOnly extract new emails, skip already processed ones
processed_labelProcessed Label NameLabel to mark processed emails
days_lookbackDays LookbackHow many days back to check for new emails
enable_drive_uploadEnable Google Drive UploadUpload attachments to Google Drive (optimized: ~2-3 seconds per file, provides permanent storage)
drive_folder_nameDrive Folder NameFolder name in Google Drive to store attachments
create_timestamped_subfolderCreate Timestamped Subfolder
organize_by_email_subjectOrganize by Email Subject
email_toTo (Recipients)
email_ccCC
email_subjectEmail Subject
email_bodyEmail Body
message_idsMessage IDs
labels_to_addLabels to Add
labels_to_removeLabels to Remove
new_label_nameNew Label Name
destination_labelDestination Label
apply_label_after_extractApply Label After Extract
label_name_for_applicationLabel Name for Application
label_action_typeLabel Action TypeOptions: create_new, use_existing.
Outputs
NameDisplay NameInfo
resultOperation ResultThe result of the Gmail operation as a Data object.
countEmail CountCount of extracted emails as a Data object.
summarySummarySummary of extracted emails (subjects, senders, attachment counts) as a Data object.
filesDownloaded FilesDownloaded attachment files as a list of Data objects with file paths and metadata.
sheet_dataEmail Data for SheetsEmail data formatted for Google Sheets (with headers and rows) as a Data object.
file_linksFile Links & IDsFile links and Google Drive IDs for downloaded attachments as a Data object.
email_contentsEmail ContentsFull email contents (subject, from, to, date, body, labels) as a Data object.
gmail_linksGmail LinksDirect Gmail links for extracted emails as a Message.

Gmail Setup Script

This component authenticates with Gmail, Drive, Sheets, Docs, and Calendar using a client_secret.json file and outputs a credentials JSON for use in LLMC extractors. It uses a two-step OAuth flow: first generating an OAuth URL, then exchanging the authorization code for credentials.

Prerequisites

  • A client_secret.json file from Google Cloud Console

To Use Gmail Setup Script

  1. Paste the contents of your client_secret_*.json file from Google Cloud Console
  2. Run the component to generate an OAuth URL
  3. Visit the OAuth URL in your browser and sign in to your Google account
  4. Copy the authorization code from the browser
  5. Paste the authorization code in the “Authorization Code (Step 2)” field
  6. Run the component again to complete authentication
Inputs
NameDisplay NameInfo
client_secret_jsonClient Secret JSON ContentPaste the contents of your client_secret_*.json file from Google Cloud Console here
custom_scopesCustom Scopes (optional)Comma-separated or newline-separated list of OAuth scopes. Leave blank to use default: Gmail, Drive, Sheets, Docs, Calendar (full access)
authorization_codeAuthorization Code (Step 2)After visiting the OAuth URL, paste the authorization code here and run again
saved_scopes_jsonSaved Scopes (Internal)DO NOT MODIFY - Internal field to persist scopes between OAuth steps
Outputs
NameDisplay NameInfo
credentials_jsonCredentials JSONGenerated OAuth credentials as a Data object (contains credentials_for_copy_paste for use in other components).
auth_statusAuthentication StatusCurrent authentication status (SUCCESS, ERROR, or PENDING) as a Data object.
emailAuthenticated EmailThe authenticated Google account email address as a Data object.
next_stepsNext StepsInstructions for next steps as a Data object.

Google Universal Authenticator

This component is a universal Google services authenticator. Select which Google services you need (Gmail, Sheets, Drive, Docs, Calendar, Photos, Contacts, YouTube, etc.) and authenticate once for all selected services. It supports both Desktop and Web application OAuth client types.

Prerequisites

  • A client_secret.json file from Google Cloud Console
  • Required APIs enabled in Google Cloud Console for selected services

To Use Google Universal Authenticator

  1. Paste the contents of your client_secret_*.json file from Google Cloud Console
  2. Enter the services you want to authenticate for in Selected Services (comma-separated)
  3. Run the component — a browser window will open for OAuth authentication
  4. Sign in with your Google account and grant the requested permissions
  5. Copy the generated credentials to use in other Google components (Gmail Manager, Google Sheets, Google Docs, etc.)
Inputs
NameDisplay NameInfo
client_secret_jsonClient Secret JSON ContentPaste the contents of your client_secret_*.json file from Google Cloud Console here
selected_servicesSelected ServicesComma-separated list of services to authenticate for. Available: gmail, gmail_readonly, sheets, sheets_readonly, drive, drive_readonly, drive_file, docs, docs_readonly, calendar, calendar_readonly, calendar_events, photos, photos_readonly, contacts, contacts_readonly, youtube, youtube_readonly, cloud_platform, admin_directory, all_full_access.
redirect_messageAuthentication InstructionsInstructions that will be shown to the user during OAuth flow
auto_open_browserAuto Open BrowserAutomatically open browser for OAuth authentication (disable if running on server)
Outputs
NameDisplay NameInfo
credentials_jsonGoogle Credentials JSONGenerated OAuth credentials as a Data object (includes credentials_for_copy_paste, authenticated_email, scopes, and service support flags).
auth_statusAuthentication StatusCurrent authentication status (SUCCESS, ERROR, or PENDING) as a Data object.
setup_instructionsSetup InstructionsStep-by-step setup instructions, security notes, and troubleshooting tips as a Data object.
available_servicesAvailable ServicesInformation about all available Google services and usage examples as a Data object.