Repository navigation
feat(google_drive_tool): new Google Drive tool plugin with OAuth and Each user signs in (1.0.0) - #4181
Merged
Conversation
…Each user signs in (1.0.0)
Merged
3 of 5 tasks
The agent retypes the sign-in link in its reply, and a long random state does not always survive that: in a real chat one character changed case, so the callback endpoint could not recognize the sign-in. The tool now returns <sign-in endpoint>?start=<12 lowercase characters without look-alikes>, and the endpoint redirects to the sign-in page it stored. The state and PKCE values go to the provider and back without passing through the agent.
This was referenced Nov 2, 2026
Closed
crazywoola
approved these changes
Nov 2, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A new Google Drive tool plugin (
tools/google_drive_tool) for working with files in Google Drive and shared drives from workflows and agents. The repository so far only has the Google Drive data source, which imports documents into knowledge bases. The plugin is namedgoogle_drive_toolbecause that data source already usesgoogle_drive; its label is "Google Drive". It is built like the other reworked plugins: Google Calendar (#4173), Gmail (#4180), and the Microsoft and Atlassian plugins (#4163–#4171).Auth
GET /google_drive/callback) that only stores the one-time code.client_id | Dify user ID. They never appear in tool output.invalid_grantor a 401 leads to a new sign-in.google_drive_sign_outforgets the sign-in.https://www.googleapis.com/auth/drive(plusopenid email), so the tools can search and manage all of the user's files, not only those the app created.Tools (prefixed
google_drive_: the new Agent rejects duplicate tool names across plugins)google_drive_search:• filters: name, full text, type (folder / Doc / Sheet / Slides / PDF), folder, recent
• or a raw Drive query (values escaped)
• follows pages
google_drive_list_folder(folders first, root by default),google_drive_list_shared_drivesgoogle_drive_read_text: a Doc as Markdown (falling back to plain text), a Sheet as CSV, Slides or a text file as text.google_drive_get_filegoogle_drive_download_file: binary files up to 50 MB. Google Docs/Sheets/Slides are exported to PDF, DOCX, XLSX, PPTX, CSV, MD, TXT, HTML or PNG (default: the Office format)google_drive_upload_file:• a file, or text written by the agent
• multipart upload
• optional conversion to a Google Doc / Sheet / Slides
google_drive_create_folder,google_drive_copy_file,google_drive_move_file,google_drive_rename_file,google_drive_delete_file(trash, restore or permanent)google_drive_share_file:• who: a person, a group, a domain or anyone with the link
• role: viewer / commenter / editor
• optional notification and message
google_drive_list_permissions,google_drive_remove_permission(by email,anyonefor link sharing, or by ID; the owner is refused)supportsAllDrives,corpora=allDrives).success/errorplus its fields).Release Notes
Change Type
Screenshots / Videos
The README includes two chat screenshots:
Testing
pytest tests). They cover:invalid_grant/ 401 → new link, unticked permission, per-user isolation, secret rotation, cancel/error pages, sign-out.removeParentsfrom the current parents.notes.txtinto it.convert_to=spreadsheet) and read it back as CSV.Checklist