How to Build an AI Agent for Google Drive and Salesforce
Automatically attach proposals, contracts, and SOWs to the right Salesforce records, and keep document versions synced as deals progress.
Last updated: February 26, 2026
The workflow problem
Sales deals generate documents at every stage. Discovery calls produce meeting notes. Proposals are drafted in Google Docs. Pricing is modeled in Google Sheets. Statements of work are authored collaboratively. Security questionnaires are filled out. Contracts are redlined back and forth. All of these documents live in Google Drive, organized (or disorganized) in team folders, shared drives, and personal drive spaces.
Meanwhile, the Salesforce opportunity record is supposed to be the single source of truth for the deal. But the Files section on most opportunities is empty or contains outdated versions. Finding the latest proposal for a deal means searching Drive, checking shared links in email threads, or asking the rep “where did you put the SOW?”
This disconnect creates real business problems. When a new account executive takes over a deal, they inherit an opportunity in Salesforce with financial details and a stage but no document trail. They cannot see the proposal that was sent, the pricing sheet that was negotiated, or the security questionnaire that was completed. They start from scratch, frustrating the customer who has to re-answer questions and re-share documents.
Deal reviews suffer too. A VP of Sales reviewing the pipeline opens an opportunity and wants to see the proposal. There is no attachment. They Slack the rep, who sends a Drive link that may or may not be the latest version. This is not a workflow – it is a scavenger hunt.
Why an AI agent, not just automation
Simple file sync tools exist. You can set up a Salesforce-Google Drive connector that links a Drive folder to an opportunity. But this approach has fundamental limitations. It requires reps to save documents in the right folder, which they often do not. It does not handle documents shared via email, created in personal Drive spaces, or stored in shared drives organized by team rather than by deal.
An AI agent locates and associates documents intelligently. Instead of requiring documents to be in a specific folder, the agent searches for documents based on deal context. It knows the opportunity name, the customer’s company, the contacts involved, and the deal stage. When a new Google Doc is created with “Meridian Health” in the title and shared with jennifer.wu@meridianhealth.com, the agent infers this document belongs on the Meridian Health opportunity and links it automatically.
The agent also understands document types and deal stages. It can categorize a document as a proposal, contract, SOW, security questionnaire, or meeting notes based on its content and title. It knows that proposals are relevant during the Proposal stage, contracts during Negotiation, and signed agreements at Closed-Won. This classification helps sales operations teams track which deals have their required documents and which are missing them.
Version awareness is another intelligence layer. When a proposal is revised, the agent does not just attach the new version alongside the old one. It updates the link to point to the latest version while preserving access to the version history, and it notes on the Salesforce record that the document was updated along with what likely changed.
How it works with ACP
The Agentic Control Plane connects to Google Drive via Google OAuth and to Salesforce through its standard connected app flow. The agent gets scoped access to the Google Drive API and the Salesforce REST and Content APIs.
On the Google Drive side, the agent can list and search files, read file metadata (name, owner, shared users, modification date, MIME type), access file content for Google Docs and Sheets, and monitor file creation and modification events. On the Salesforce side, the agent can query Opportunities, Accounts, Contacts, and Content Document Links. It can attach files to records by creating ContentVersion and ContentDocumentLink objects, update custom fields, and create Tasks.
You configure the agent with instructions like: “Monitor my team’s Google Drive for documents related to active Salesforce opportunities. When you find a proposal, contract, SOW, or other deal document, attach it to the matching opportunity. Categorize documents by type. Alert me when a deal in Negotiation or later stage is missing a signed contract.”
Here is how the agent processes documents:
New Google Doc created: “Proposal - NovaTech Solutions - Enterprise Platform Q2 2026.gdoc”
- Owner: sarah.m@yourcompany.com
- Shared with: marcus.r@novatech.io, cto@novatech.io
Agent actions:
- Matched to Salesforce Opportunity NovaTech Solutions - Enterprise Platform (currently in Proposal stage)
- Confirmed match: document shared with marcus.r@novatech.io who matches Contact Marcus Rivera on this account
- Linked document to Opportunity Files with category: Proposal
- Updated Opportunity custom field “Proposal Sent Date”: Today
- Created Activity: “Proposal document created and shared with Marcus Rivera and CTO”
Three days later, same document is updated: Agent: Proposal for NovaTech Solutions was updated (v3). Change summary: pricing section modified, new section added for implementation timeline. Updated the Salesforce file link to the latest version. Previous versions remain accessible in Drive’s version history.
Monday pipeline review – Agent scans all deals in Negotiation stage: Agent: Document completeness check for Negotiation-stage deals:
- Global Finance - Enterprise: Proposal (attached), SOW (attached), Security Questionnaire (attached), MSA (missing). Action needed: no master services agreement on file.
- Meridian Health - Renewal: Proposal (attached), Renewal Agreement (attached). Complete.
- Strata Ventures - Professional: Proposal (attached), SOW (missing). Action needed: no statement of work drafted yet.
The agent transforms document management from a manual chore into an automated, intelligent process.
Governance and security
Deal documents contain pricing, contract terms, customer requirements, and potentially confidential business information. Access must be strictly controlled.
The Google Drive OAuth scope is configurable. The most restrictive option is drive.readonly, which gives the agent read-only access to files and metadata without the ability to create, modify, or delete anything in Drive. If your workflow requires the agent to create links or organize files into folders, drive.file scope can be used, which grants access only to files the agent creates or that are explicitly shared with it.
Salesforce access is controlled through connected app permissions and field-level security. The agent needs write access to ContentVersion (to attach files) and read access to Opportunities, Accounts, and Contacts (to match documents to records). It does not need access to financial fields, user management, or other sensitive Salesforce objects.
The ACP audit log records every file the agent processes: which Drive file was accessed, what metadata was read, which Salesforce record it was linked to, and when. This creates a complete chain of custody for document handling that compliance teams can review during audits.
File content access is minimized. The agent reads file metadata (title, owner, shared users) for matching purposes and may read document content for categorization (determining whether a file is a proposal or contract). But raw document content is not stored in the ACP platform. The agent creates a link between the existing Drive file and the Salesforce record – the file stays in Google Drive, subject to your organization’s existing Drive sharing permissions and retention policies.
Access inheritance is important: when the agent links a Drive file to a Salesforce record, Salesforce users can only open the file if they have Google Drive access to it. The Salesforce link does not bypass Drive’s sharing permissions. This means the agent cannot inadvertently expose a restricted document to users who should not see it.
Example use cases
-
Automatic document attachment: Proposals, contracts, SOWs, and other deal documents created in Google Drive are automatically linked to the matching Salesforce opportunity based on file name, shared users, and account context. No manual uploading required.
-
Document type classification: The agent categorizes attached documents by type (proposal, contract, security questionnaire, meeting notes) and updates custom fields on the opportunity, enabling sales operations to track document completeness across the pipeline.
-
Version tracking: When deal documents are updated in Google Drive, the agent updates the Salesforce link and logs the revision, ensuring the opportunity always points to the latest version while maintaining version history.
-
Missing document alerts: The agent checks deals in late stages (Negotiation, Contract Review) for required documents and alerts the rep or manager when critical documents are missing, preventing deals from stalling due to incomplete paperwork.
-
Deal handoff packages: When a deal is reassigned to a new rep, the agent generates a summary of all associated documents with links, categories, and last-modified dates, giving the new owner instant access to the complete document trail.
Getting started
Start linking your deal documents to CRM records automatically.
-
Sign up at cloud.agenticcontrolplane.com. Create your free account.
-
Connect your tools. Authorize Google Drive (select read-only or file-level access based on your needs) and Salesforce (log in and approve the connected app) from the Data Sources page.
-
Describe your agent. Tell it what to do: “Find deal documents in Google Drive and attach them to the matching Salesforce opportunities. Categorize by document type. Alert me when deals in Negotiation are missing required documents.” The agent starts scanning and linking immediately.
Ready to build this agent?
Sign up free, connect your tools, and have this running in minutes.