In this post I will explain an automated process concerning Google Drive.

Google Drive is a cloud storage service offered by Google. In addition to personal use, if you are using G Suite you can create and use Drive (Team Drive) which is shared by multiple people. Also, it is possible to perform various operations using the API, and the automatic Step I am going to introduce uses this.

For more information about Google Drive please see Google’s official help page.


Automatic Steps

Concerning Google Drive, there are auto-steps such as File Upload, Create Folder, and Delete File which are pre-installed, and those which become available by adding Add-ons, such as Create Permission and File Download. In this article, I will focus on four of the types; File Upload, Create Folder, Delete File, and Create Permission.

First, I will briefly explain each Step.

Google Drive: File Upload

File Upload Config screen

It uploads files to Google Drive. Files to be uploaded are specified with File-type Data Item. Multiple files can be uploaded at the same time by setting multiple files in the File-type Data Item. The upload destination folder is specified with either its folder ID or the path. If not specified, the file will be uploaded to the root folder of My Drive of the uploading user. In addition, the ID and URL of the uploaded file can be saved in a Data Item.

Google Drive: Create Folder

Create Folder Config screen

Designates a folder on Google Drive and creates a new folder inside it. The ID and URL of the created folder can be saved in a Data Item.

Google Drive: Delete File

Delete File Config screen

Specifies files and folders on Google Drive and deletes them. If you use a multi-line String-type Data Item you can delete multiple files and folders at one time. To do so, write one ID per line.

Google Drive: Create Permission

Create Permission Config screen

Designates a file/folder on Google Drive and creates a permission for it. If you use a multi-line String-type Data Item you can create permissions on multiple files and folders at one time. You can determine respectively whether to make them searchable by anyone on the internet and whether to allow other people to edit them.

Unlike the above three, the Create Permission task needs to be added as an Add-on file to use it. You can download the Add-on file from HERE. For details on adding Add-on files please visit this page.

All auto-steps support Team Drive. However, Create Permission corresponds only for files on Team Drive.

Note that to use these auto-steps you need to connect the Google Account whose Drive stores the target file/folder with the Questetra BPM Suite account. Please set up according to the following procedure.


Setting up Google Connectivity

System Settings

These settings must be done by Users with System Administrator Authorization.
Open [System Settings], then go to [Google Connectivity]. There, enter your G Suite domain.

Input screen for G Suite domain

Click on Save to complete the settings.

This allows the federation function with Google, such as single sign-on, to be available in your environment.

The Google Connectivity item will appear in the [Account Settings] screen, and you will be able to configure the integration of your account.

Account Settings

First, open the [Account Settings] screen and click on [Google Connectivity].

Then check the button in the Google Drive section. If it says “disconnect” your account has already connected with your Google account. In that case the following procedure is unnecessary.

If the button says “connect” then it is not connected yet, so click on that button. On the page that opens log in to the Google Account you want to connect to, then click on “Allow” in the following page.

Google Connection permission screen

This completes the connection settings. Please also visit this page for Google connection information.


Example App

Below is an example App created by incorporating these auto-steps.

This App is for sending files externally. It is a mechanism that uploads a file to a folder created on Google Drive and shares that folder. It is assumed that the folder URL will be communicated to people outside the company by email, etc. In addition, the folder (and the files inside it) will be deleted one day after its creation. This is used when a file is too large to send by e-mail or there are multiple files to send.

The Data Items are as follows.

Data ItemTypeRequired“Attach file” Task“Confirm URL” TaskDescription
TitleNoEditableOnly displayThe title of the Process
ID of created folderString type (single-line)NoNo displayNo displayStores the ID of the folder created at the Create Folder step
URL of created folderString type (single-line)NoNo displayOnly displayStores the URL of the folder created at the Create Folder step
Uploading fileFile typeYesEditableOnly displayStores the file to be uploaded and shared

First, specify the files to be shared at the Attach file step. At the following Create folder step (Google Drive: Create Folder) a folder for sharing is created on Google drive.

The config items in Google Drive: Create Folder are as follows.

Item nameRequiredDescription
C1: User who connects to Google DriveYesSpecify which User it connects to Google Drive as. The User to be specified must have configured Google Connectivity.
I1: Parent Folder IDNoSpecify inside which folder to create a new folder by its ID. The ID is shown at the end of the display URL of the folder. (The part of [id] in “https://drive.google.com/drive/u/0/folders/%5Bid%5D”) When empty it is created in My Drive root. Leave it empty this time.
I2: Folder Name to createYesSpecify the name of the folder to be created. Name it as “Sharing#{processInstanceId}” in this example. Since the Process ID will be inserted to the part of #{processInstanceId}, it will not conflict with other folders that are created by this App.
O1: Data Item that will save Folder IDNoSpecify a Data Item to store the ID of the created folder. In this example specify “ID of created folder”.
O2: Data Item that will save web view url of FolderNoSpecify a Data Item to store the URL of the created folder. In this example specify “URL of created folder”.

Although the save destination of the ID and URL are not required, we will need them in this case so please set them. Please note that you cannot share folders on Team Drive, though it doesn’t matter in this example.

At the next Step, Upload file (Google Drive: File Upload), the specified file is uploaded to the created folder.

The config items in Google Drive: File Upload are as follows.

Item nameRequiredDescription
User who connects to Google DriveYesSpecify which User it connects to Google Drive as. The User to be specified must have configured Google Connectivity.
Folder that files will be uploadedNoSpecify to which folder the files to be uploaded. You can specify with either the ID or folder path, but when using of Team Drive only ID can be used. When empty, the My Drive root folder is used. In this example, set it to “ID” and set an Expression Language to read the ID stored in the Data Item “ID of created folder”.
File type data item whose attached files will be uploaded to Google DriveYesSpecify the Data Item that stores the files to be uploaded. In this example, specify “Uploading file”.
String type data item that will save uploaded file idsNoSpecify a Data Item to store the ID of the created folder. In this example, leave it empty.
String type data item that will save web view url of uploaded filesNoSpecify a Data Item to store the URL for displaying the file. In this example, leave it empty.
String type data item that will save download urls of uploaded filesNoSpecify a Data Item to store the download URLs for uploaded files. In this example, leave it empty.
String type data item that will save contain error details when an error occurredNoSpecify a Data Item to store error contents when an error occurred. In this example, leave it empty.

And then at the Share folder Step sharing of the folder is set.

The config items in Google Drive: Create Permission are as follows.

Item nameRequiredDescription
C1: User who connects to Google DriveYesSpecify which User it connects to Google Drive as. The User to be specified must have configured Google Connectivity.
I1: File / Folder Ids to shareYesSpecify the Data Item that stores the ID of file/folder to share. In this example, specify “ID of created folder”.
C2: Can find or not (true or false)YesSet up whether to allow an unspecified large number of people can search the shared file/folder, or not. Enter “true” to allow and “false” to deny. (An error will occur if you enter anything other than those.) In this example enter “false”.
C3: Can edit or not (true or false)YesSet up whether to allow other people to edit, or not. Enter “true” to allow and “false” to deny. (An error will occur if you enter anything other than those.) In this example enter “false”.

When the sharing setup is completed the App proceeds to the Confirm URL Step. There you confirm the URL stored in “URL of created folder”, and convey it to the recipient. Since the App does not include a mechanism for conveying this please do it manually with email, etc.

After you have confirmed, the App proceeds to the Timer Intermediate Event. The config items in the Timer Intermediate Event are as follows.

Item nameDescription
Datetime specified by a data itemSpecify with a Data Item the date and time when it will proceed. Not used in this example.
Datetime specified by an expressionSpecify with an expression the date and time when it will proceed. In this example select this option and set “processInstanceStartDatetime.addDays(1)” as the expression.

With this, it delays by 1 day after the Process started. Let the recipient receive the file during that period.

After 1 day elapses the folder will be deleted at the Delete folder Step (Google Drive: Delete File).

The config items in Google Drive: Delete File are as follows.

Item nameRequiredDescription
C1: User who connects to Google DriveYesSpecify which User it connects to Google Drive as. The User to be specified must have configured Google Connectivity.
I1: Data Item with File / Folder IDs to deleteYesSpecify the Data Item that stores the ID of file/folder to delete. In this example, specify “ID of created folder”.

When deletion of the folder is completed the whole Process ends.


That’s it for today.

4 thoughts on “Utilizing Google Drive from Workflow – Sending files to people outside the company”

  1. Pingback: Google Drive: Create Folder – Questetra Support

  2. Pingback: Google Drive: Create Permission – Questetra Support

  3. Pingback: Google Drive: Delete File – Questetra Support

  4. Pingback: Service Task (Google Drive: File Upload) – Questetra Support

Comments are closed.

%d bloggers like this: