Skip to content

Google 云端硬盘节点常见问题#

¥Google Drive node common issues

以下是 Google 云端硬盘节点 的一些常见错误和问题,以及解决或故障排除步骤。

¥Here are some common errors and issues with the Google Drive node and steps to resolve or troubleshoot them.

Google 尚未验证此信息应用#

¥Google hasn't verified this app

If using the OAuth authentication method, you might see the warning Google hasn't verified this app. To avoid this:

  • If your app User Type is Internal, create OAuth credentials from the same account you want to authenticate.
  • If your app User Type is External, you can add your email to the list of testers for the app: go to the Audience page and add the email you're signing in with to the list of Test users.

If you need to use credentials generated by another account (by a developer or another third party), follow the instructions in Google Cloud documentation | Authorization errors: Google hasn't verified this app.

Google Cloud 应用未授权#

¥Google Cloud app becoming unauthorized

For Google Cloud apps with Publishing status set to Testing and User type set to External, consent and tokens expire after seven days. Refer to Google Cloud Platform Console Help | Setting up your OAuth consent screen for more information. To resolve this, reconnect the app in the n8n credentials modal.

Google 云端硬盘 OAuth 错误#

¥Google Drive OAuth error

如果使用 OAuth 身份验证方法,你可能会看到一条错误信息,提示你无法登录,因为该应用不符合 Google 的安全要求。

¥If using the OAuth authentication method, you may see an error indicating that you can't sign in because the app doesn't meet Google's expectations for keeping apps secure.

最常见的原因是 Google OAuth 配置和 n8n 中的 URL 不匹配。为避免这种情况,请先检查 Google 错误消息中包含的所有链接。这将包含有关所发生错误的详细信息。

¥Most often, the actual cause of this issue is that the URLs don't match between Google's OAuth configuration and n8n. To avoid this, start by reviewing any links included in Google's error message. This will contain details about the exact error that occurred.

如果你自行托管 n8n,请检查用于构建外部 URL 的 n8n 配置项。验证 N8N_EDITOR_BASE_URLWEBHOOK_URL 环境变量是否使用完全限定域名。

¥If you are self-hostin n8n, check the n8n configuration items used to construct external URLs. Verify that the N8N_EDITOR_BASE_URL and WEBHOOK_URL environment variables use fully qualified domains.

从 Google 云端硬盘获取最近文件#

¥Get recent files from Google Drive

要从 Google 云端硬盘检索最近使用的文件,你需要按修改时间对文件进行排序。要实现此操作,你需要搜索现有文件并检索其修改时间。接下来,你可以对文件进行排序,找到最新的文件,并使用另一个 Google 云端硬盘节点按 ID 定位该文件。

¥To retrieve recent files from Google Drive, you need to sort files by modification time. To do this, you need to search for existing files and retrieve their modification times. Next you can sort the files to find the most recent file and use another Google Drive node target the file by ID.

流程如下所示:

¥The process looks like this:

  1. 在画布上添加一个 Google 云端硬盘节点。

¥Add a Google Drive node to your canvas. 2. 选择文件/文件夹资源和搜索操作。

¥Select the File/Folder resource and the Search operation. 3. 启用“返回全部”可遍历所有文件。

¥Enable Return All to sort through all files. 4. 将“搜索内容”筛选器设置为“文件”。

¥Set the What to Search filter to Files. 5. 在“选项”中,将“字段”设置为“全部”。

¥In the Options, set the Fields to All. 6. 将排序节点连接到 Google 云端硬盘节点的输出。

¥Connect a Sort node to the output of the Google Drive node. 7. 选择简单排序类型。

¥Choose Simple sort type. 8. 在“排序依据字段”部分中,将字段名称输入为 modifiedTime

¥Enter modifiedTime as the Field Name in the Fields To Sort By section. 9. 选择降序排序。

¥Choose Descending sort order. 10. 在排序节点的输出端添加一个限制节点。

1
¥Add a **Limit** node to the output of the **Sort** node.
  1. 将“最大项目数”设置为 1,以保留最新文件。

    ¥Set Max Items to 1 to keep the most recent file. 12. 将另一个 Google Drive 节点连接到“限制”节点的输出。

    ¥Connect another Google Drive node to the output of the Limit node. 13. 选择“文件”作为资源,并选择所需的操作。

    ¥Select File as the Resource and the operation of your choice. 14. 在“文件选择”中,选择“按 ID”。

    ¥In the File selection, choose By ID. 15. 选择“表达式”并输入 {{ $json.id }} 作为表达式。

    ¥Select Expression and enter {{ $json.id }} as the expression.

Workflow preview placeholder.