Google Drive

Transfer files between Apify's key-value stores and Google Drive.

Google Drive Actor

Transfer files between Apify's key-value stores and Google Drive.


The input is a JSON object with the following fields.

FieldTypeDescriptionDefault valuePossible valuesRequired
constantsarrayConstants to use in the operations--false
constants[*]objectConstant settings---
constants[name]stringConstant name--true
constants[value]string or ObjectConstant value--true
operationsarrayThe operations to execute--false
operations[*]ObjectOperation settings, mainly it contains the type and other specific settings---
fileUploadTimeoutSecsnumberMaximum available time (in seconds) used to upload a single file120-false
fileUploadingMaxConcurrencynumberMaximum concurrency used for uploading files in parallel--false
isSetupModebooleanWhether yes or no to activate the setup modefalse-false
googleOAuthTokensStorestringKey-value store where your Google OAuth tokens will be stored so you don't have to authorize every time again"google-oauth-tokens"-false
googleOAuthCredentialsobjectGoogle OAuth credentials--false


An array of folder info constants to use by the operations (DRY principle). Each constant is a JSON object composed of two fields: name and value.

Constant value as string

Represent the path of the folder


{ "name": "myFolder", "value": "my-project/files" }

Constant value as object

Provide more folder definition, which can be useful for defining a shared folder.


{ "name": "myFolder", "value": { "parentFolderId": "GoogleDriveFolderId", "path": "files" } }

Constant usage

We use the constant inside a string with the following format "constants.[CONSTANT_NAME]".


{ "type": "folders-delete", "folder": "constants.myFolder" }


Operations are the backbone. Each operation is an object and distinguished by the type field. The field type can have one the following values: upload, and folders-delete.

For each operation type there are specific settings that accompany as explained below:

Operation "upload"

Upload files from the key-value stores to a Google Drive folder.

FieldTypeDescriptionDefault valuePossible valuesRequired
sourceobjectRepresent the file(s) to upload--true
source.idOrNamestringThe ID or name of the key-value store--true
source.forceCloudbooleanForcibly use the key-value store from the cloudfalse-false
source.filesarrayFile(s) to apply the operation on them
source.files[*]objectFile(s) settings--true
source.files[key]stringThe key of the file on the key-value store--true
source.files[name]stringThe name of upload file on Google Drive--false
source.files[mimeType]stringThe Google Drive MIME type of the file-Google Drive MIME typesfalse
destinationstring / objectInfo of the Google Drive's folder where we will upload the file(s)--true


{ "type": "upload", "source": { "idOrName": "my-store", "files": [ { "key": "my_spreadsheet", "name": "My spreadsheet", "mimeType": "application/" }, { "key": "my_image", "name": "My Image" } ] }, "destination": "My actor files" }

Operation "folders-delete"

Delete a folder. This operation type is useful for deleting folders before uploading files to prevent file duplication.

FieldTypeDescriptionDefault valuePossible valuesRequired
folderstring / objectInfo of the Google Drive's folder to delete--true


{ "type": "folders-delete", "folder": "My Folder" }

Is setup mode

Before you start using the actor for running operations, you will need to run it in the setup mode. To achieve that, you need to run it with the bellow input and follow the steps in the run's log ( for more info, check this article).

{ "isSetupMode": true }

Note: If the setup mode is activated, operations will not get executed.

Google OAuth credentials

If you want to use this actor locally or with your own version, you have to provide your own credentials. To setup yours, check this guide. Required credentials data is: "client_id", "client_secret", and "redirect_uri".