Skip to content

Google Drive Folder Manager

Google Drive Folder Manager is a tool in Nappai that connects your dashboard to Google Drive. It lets you perform common file operations—create new files, get information about existing ones, delete them, or share them with other people—without leaving the Nappai interface.

How it Works

When you use this component, Nappai sends a request to the Google Drive API. The component takes the values you enter (or map from other components) and builds the appropriate API call. The response from Google Drive is then returned to Nappai as data that can be used by other components or displayed in the dashboard.

Operations

This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:

  • Create: Adds a new file to a specified folder in Google Drive.
  • Get: Retrieves information about a file or folder.
  • Delete: Removes a file or folder from Google Drive.
  • Share: Gives another user access to a file or folder.

To use the component, first select the operation you need in the “Operation” field.

Inputs

Mapping Mode

This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:

  • Fixed: You type the value directly into the field.
  • Mapped: You connect the output of another component to use its result as the value.
  • Javascript: You write Javascript code to dynamically calculate the value.

This flexibility allows you to create more dynamic and connected workflows.

Input Fields

The following fields are available to configure this component. Each field may be visible in different operations:

  • Select folder: Choose the folder that will be used for the operation.

    • Visible in: Create, Get, Delete, Share
  • Operation: Pick the action you want to perform (Create, Get, Delete, Share).

    • Visible in: Create, Get, Delete, Share
  • Email: Email address of the user you want to share the file with.

    • Visible in: Share
  • Filename: Name that will be used for the file you are creating or retrieving.

    • Visible in: Create, Get
  • Folder Id: ID of the folder. If you leave it blank, the root folder is used.

    • Visible in: Create, Get, Delete, Share
  • Mapping Mode: Enable mapping mode to process multiple data records in batch.

    • Visible in: Create, Get, Delete, Share
  • Mode of Input: Choose how the component receives folder identifiers.

    • Visible in: Create, Get, Delete, Share
  • Role: Role that will be assigned to the user when sharing.

    • Visible in: Share
  • Send Notification: Decide whether to send a notification to the user when sharing.

    • Visible in: Share
  • Type: Type of permission that will be assigned to the user.

    • Visible in: Share
  • Tool Name: The name of the tool that will be used when this component is connected as a tool. This name will be displayed to the agent when it selects tools to use.

    • Visible in: Create, Get, Delete, Share
  • Tool Description: A detailed description of what this tool does. This description will help the agent understand when and how to use this tool effectively.

    • Visible in: Create, Get, Delete, Share
  • Tools arguments metadata: Defines the arguments metadata for the tools.

    • Visible in: Create, Get, Delete, Share

Credential
This component requires a Google Drive credential. First, set up a Google Drive credential in the Nappai credentials section. Then select that credential in the component’s “Credential” field. The credential needs a Client Id, Client Secret, and a Google Drive access level. You can find your API key in the Google Cloud Console.

Outputs

  • Data: The raw data returned from Google Drive (e.g., file metadata, confirmation of deletion).
  • Tool: A tool representation that can be used by Nappai agents to perform the same operation programmatically.

Usage Example

Example 1 – Create a File

  1. Drag the Google Drive Folder Manager component onto the canvas.
  2. In the Operation field, select Create.
  3. Set Select folder to the folder where you want the new file.
  4. Enter a Filename for the new file.
  5. Choose the Credential you created earlier.
  6. Click Run.
    The component will create the file in Google Drive and return the file’s metadata in the Data output.

Example 2 – Share a File

  1. Add the component and set Operation to Share.
  2. Provide the Folder Id or Select folder that contains the file you want to share.
  3. Enter the Email of the person you want to share with.
  4. Choose a Role (e.g., Viewer, Editor) and a Type of permission.
  5. Optionally set Send Notification to true.
  6. Run the component.
    The file will be shared, and the Data output will confirm the sharing action.
  • Google Drive Folder Component – Manage folders only (create, list, delete).
  • Google Drive File Component – Manage individual files (upload, download, delete).

Tips and Best Practices

  • Use Mapping Mode when you need to process many files at once; it saves time and reduces manual input.
  • Keep your Credential secure and rotate it regularly.
  • When sharing, double‑check the Email address to avoid accidental access.
  • Use the Tool Name and Tool Description fields to help agents understand the tool’s purpose quickly.

Security Considerations

  • The component relies on a Google Drive credential; ensure that only trusted users have access to the credential in Nappai.
  • Do not expose the Client Id or Client Secret in any public or shared dashboards.
  • Use the Send Notification option carefully; it will notify the user via email, which may contain sensitive information.