Utilizing Google Drive from Workflow – Sending files to people outside the company

In this post, I will explain auto-steps 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) shared by multiple people. Also, it is possible to perform various operations using the API, and the automatic Step I am going to introduce is also using it.

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


Automatic Steps

Concerning Google Drive, there are auto-steps such as “File Upload”, “Create Folder”, and “Delete File” which are available from the beginning, and those which become available by adding Add-ons such as “Create Permission” and “Files Get”. In this article, I will mention regarding the four of the kinds among them, which are “File Upload”, “Create Folder”, “Delete File”, and “Create Permission”.

First, I briefly explain each Step.

Google Drive: File Upload

Config screen of “File Upload”

It uploads files to Google Drive. File to be uploaded is 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 of its folder ID or the path. If not specified, the file will be uploaded to the root of My Drive of the user who uploads. In addition, ID and URL of the uploaded file can be saved in a Data Item.

Google Drive: Create Folder

Config screen of “Create Folder”

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

Google Drive: Delete File

Config screen of “Delete File”

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

Google Drive: Create Permission

Config screen of “Create Permission”

Designates file/folder on Google Drive and creates Permission on it. If you specify a String type Data Item multi-line, you can create permission on multiple files and folders at one time. You can determine respectively “whether to allow anyone on the internet can search to find” and “whether to allow other people to edit”.

Unlike the above three, it needs to be added the Add-on file to use this. 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 account of Questetra BPM Suite. Please set up according to the following procedure.


Setting up Google Connectivity

System Setting

This setting must be done by Users with System Administrator Authorization.
Open the [System Setting], then go to [Google Connectivity]. There, enter your using G Suite domain.

Input screen for “G Suite domain”

It completes by clicking on “Save”.

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

The item of “Google Connectivity” will appear on the [Account Setting] screen, and setting of your account becomes possible.

Account Setting

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

Then, confirm the label of the button in the Google Dive section on the opened page. If it says “disconnect”, your account has already connected with Google account. In that case, the following procedure is unnecessary to do.

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

Connection permission screen by Google

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


Example App

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

This App is for “sending files to outside people”. It is a mechanism that uploads the file to a folder created on Google Drive and shares that folder. It is a premise that to tell the URL of the folder 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. It is used when “too large the file size to send by e-mail is ” or “there are multiple files to send”.

The Data Items are as follows.

Data Item Type Required “Attach file” Task “Confirm URL” Task Description
Title No Editable Only display The title of the Process
ID of created folder String type (single-line) No No display No display Stores the ID of the folder created at “Create Folder” step
URL of created folder String type (single-line) No No display Only display Stores the URL of the folder created at “Create Folder” step
Uploading file File type Yes Editable Only display Stores the file to be uploaded and shared

First, specify the files to share at the “Attach file” step. At the next “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 name Required Description
C1: User who connects to Google Drive Yes Specify which User it connects to Google Drive as. The User to be specified must have configured Google Connectivity.
I1: Parent Folder ID No Specify 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/[id]”) When empty, creates in My Drive root. Leave it empty, this time.
I2: Folder Name to create Yes Specify 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 ID No Specify a Data Item to store the ID of created folder. In this example, specify “ID of created folder”.
O2: Data Item that will save web view url of Folder No Specify a Data Item to store the URL of created folder. In this example, specify “URL of created folder”.

Although the save destination of ID and URL are not required, set them since we need in this case. Please be noted that you cannot share folders on Team Drive, even 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 name Required Description
User who connects to Google Drive Yes Specify which User it connects to Google Drive as. The User to be specified must have configured Google Connectivity.
Folder that files will be uploaded No Specify to which folder the files to be uploaded. You can specify with either of ID or path of the folder, but in cases of Team Drive, only with ID. When empty, creates in My Drive root. 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 Drive Yes Specify 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 ids No Specify 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 files No Specify 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 files No Specify 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 occurred No Specify a Data Item to store error contents when an error occurred. In this example, leave it empty.

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

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

Item name Required Description
C1: User who connects to Google Drive Yes Specify which User it connects to Google Drive as. The User to be specified must have configured Google Connectivity.
I1: File / Folder Ids to share Yes Specify 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) Yes Set up whether to allow an unspecified large number of people can search the shared file/folder, or not. Enter “true” to allow, “false” not to. (An error will occur if you enter other than those.) In this example, enter “false”.
C3: Can edit or not (true or false) Yes Set up whether to allow other people to edit, or not. Enter “true” to allow, “false” not to. (An error will occur if you enter other than those.) In this example, enter “false”.

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

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

Item name Description
Datetime specified by a data item Specify with a Data Item, the date and time when it will proceed. Not use in this example.
Datetime specified by an expression Specify with an expression, the date and time when it will proceed. In this example, select this option and set “processInstanceStartDatetime.addDays(1)” to the expression.

With this, it holds up 1 day after the Process is Started. Let your partner receive the file during the period.

After 1 day lapses, 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 name Required Description
C1: User who connects to Google Drive Yes Specify 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 delete Yes Specify 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: