OAuth Connectors Overview
JsWorkflows lets you connect external services using OAuth 2.0. Once connected, your workflows can call those services’ APIs without manually storing tokens in workflow code. JsWorkflows stores the connection tokens and refreshes access tokens automatically when the provider supports refresh.
For Google, the same OAuth handle can also be used by the built-in file pickers in template settings and in Manage Environment Variables. That lets users select a Google Sheet, Doc, or Drive folder in the UI and then use the saved file reference in workflow code.
Connecting a service
Section titled “Connecting a service”OAuth connections in JsWorkflows are created first, then referenced later by a handle in workflow code, templates, or picker-enabled UI fields.
You can open the OAuth section in either of these places:
- Settings → OAuth2 Tokens
- From the workflow code editor:
- open More actions
- select Manage OAuth2 tokens
Then:
- Click Connect to Service
- Choose the service
- Complete the provider’s OAuth flow
- Save the connection with a handle, a short name you use later in workflow code
Handles should use lowercase letters, numbers, and hyphens only.
Using a connection in a workflow
Section titled “Using a connection in a workflow”Call api.getOAuthToken(handle) to get a valid access token, then use it with the global fetch():
const { token, error } = await api.getOAuthToken('my-google');if (error || !token) { console.log('OAuth error:', error); return; }
const response = await fetch('https://www.googleapis.com/drive/v3/files', { headers: { 'Authorization': `Bearer ${token}` },});Platform-managed connections
Section titled “Platform-managed connections”For the following services, JsWorkflows manages the OAuth app credentials. You only need to log in, no Client ID or Client Secret required:
- Google (Drive-based access for Sheets, Docs, and Drive picker flows)
- Slack
- Microsoft
- Dropbox
- GitHub
- Mailchimp
- HubSpot
- Notion
Custom OAuth providers are configured separately. See Custom OAuth when you need to connect a service that is not in the platform-managed list.
Supported services
Section titled “Supported services”| Service | Doc |
|---|---|
| Google OAuth | |
| Slack | Slack OAuth |
| Microsoft | Microsoft OAuth |
| HubSpot | HubSpot OAuth |
| GitHub | GitHub OAuth |
| Dropbox | Dropbox OAuth |
| Mailchimp | Mailchimp OAuth |
| Notion | Notion OAuth |
| Shopify (custom app / secondary store) | Shopify Custom App |
| Custom (any OAuth 2.0 provider) | Custom OAuth |
Google note
Section titled “Google note”Google is slightly different from some other OAuth connectors.
The current Google file flow is documented around:
- one saved Google OAuth handle
drive.file- optional Google file pickers in:
- template settings
- Manage Environment Variables
If you plan to work with Google Sheets, Google Docs, or Google Drive files from JsWorkflows, read the dedicated Google OAuth page for the current setup and examples.