Skip to content

Google Drive — Connect

Type: googledrive-connect  ·  Package: Google Drive v1.0.5  ·  Output: ZoanGoogleDriveSession

Opens an authenticated session with Google Drive. It is the package’s starting point: every other activity (upload, download, list, move, share…) works on this session.

Authenticates with a Zoan Cloud Google OAuth connection (or a service account) and opens the session. Two ways to use it:

  • With body: the activities you place inside inherit the session automatically; when the block ends it closes by itself, also if an activity fails.
  • Without body: returns the session as output; save it in a variable, pass it in session to the other activities and close it with Google Drive — Close.

When connecting it reads the account email to identify the session in the logs. If that lookup fails (expired token, no network), it does not stop: the error shows up on the first Drive operation.

None.

ParameterTypeDefaultDescription
authTypestringoauthAuthentication mode: oauth or service-account.
credentialcredential—OAuth mode: the Zoan Cloud Google OAuth connection, credential("code-name").
serviceAccountcredential—Service account mode: credential with the full JSON key.
impersonateUserstring—Service account mode (optional): email of the Workspace user to impersonate (domain-wide delegation).

Activities to run inside the session. They inherit the session automatically and it closes when they finish.

Without body, returns a ZoanGoogleDriveSession: assign it to a variable and pass it as session to the other activities. With body it returns nothing (the session is inherited).

MessageCause and fix
Credential '…' could not be resolved. Verify it exists in Zoan Automation and that there is an active session.The connection or credential does not exist in the environment, the display name was used instead of the code name, or there is no Zoan Cloud session.
'credential' does not contain a valid access_token. Check the OAuth Connection in Zoan Cloud.The connection exists but has no token (for example, it is still Pending). Authorize it in Zoan Cloud.
'serviceAccount' must reference a Zoan Cloud credential containing the service account JSON key.In service account mode, the credential is empty.
The service account credential is not a valid Google service account JSON key. …The stored value is not the full JSON key. Store it again exactly as downloaded.
Google Drive — Connect credential = credential("drive-operations")
└─ body:
Google Drive — Create folder name = "Reports" → output: folder
Google Drive — Upload path = "C:\reports\today.pdf" folderId = folder["id"] → output: uploaded
Log message = "Available at " + uploaded["webViewLink"]