Add Google Drive node with interactive OAuth2 - #416
Merged
Conversation
Design for a googleDrive node with interactive OAuth2 and six operations: listFolderFiles, downloadFile, syncToHeymDrive, updateFile, removeFile, removeFolder.
…"{}"
evaluate_message_template returns str(inputs) for an empty template, so every
blank optional field came back as the literal "{}". This leaked into the Drive
query as "and ({})", made an empty gdFolderId query "'{}' in parents" instead of
the root, turned a blank gdExportFormat into an unsupported-format error, and —
worst — made syncToHeymDrive store every file under the name "{}".
The handler now short-circuits blank fields before templating. Expressions still
resolve as before.
Also raise a clear error when a credential has no access token; httpx previously
failed with "Illegal header value b'Bearer '".
The existing tests missed all of this because the mocked evaluate_message_template
echoed its input, so blanks stayed blank. The mock now mirrors the real executor.
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
Adds a
googleDrivenode with popup OAuth2 and six operations:listFolderFiles,downloadFile,syncToHeymDrive,updateFile,removeFile,removeFolder.This is separate from the existing
drivenode, which is Heym Drive (internalGeneratedFilestorage).syncToHeymDriveis the bridge between the two — it pulls a file out of Google Drive and stores it in Heym Drive.Architecture mirrors the Google Sheets integration:
GoogleDriveServiceowns all Drive v3 calls and token refresh, the node handler stays thin, and a dedicated router runs the consent flow.Design decisions worth reviewing
auth/drivescope. The narrowerdrive.filescope only sees files the OAuth client itself created, so listing/updating/deleting a user's existing files would silently return nothing. Consequence: sharing this credential grants full Drive access, documented as a required warning incredentials-sharing.mdand surfaced in the credential dialog.alt=mediareturns 403), sodownloadFileandsyncToHeymDriveauto-export — Docs→PDF, Sheets→XLSX, Slides→PPTX — overridable viagdExportFormat.gdPermanentDeleteopts into destruction.removeFilerefuses folders andremoveFolderrefuses files, so a mistyped ID cannot delete the wrong thing.googleSheets, to avoid renumbering 17 sections.Canvas affordances
All 8 expression-capable fields are wired for both evaluate-dialog
1/nnavigation (n varies by operation:updateFile4,listFolderFiles3,syncToHeymDrive2) and agent autofill viafield-key. No backend work was needed for agent tools —agentProvidedFieldsis already node-type agnostic.Docs
New node page plus updates to
features.md(per-node section and the node-types summary),node-types.md,integrations.md,credentials.md, andcredentials-sharing.md.Test Plan
./check.shgreen — 2503/2503 backend tests, ruff + eslint + vue-tsc cleanNotes for reviewers
alembic_version.version_numisvarchar(32); the revision id is103_add_google_drive_cred_typeto fit.test_alembic_migrations.pyhard-codes the expected head and is updated here.docs/superpowers/.🤖 Generated with Claude Code