Skip to content

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.

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:

  1. Settings → OAuth2 Tokens
  2. From the workflow code editor:
    • open More actions
    • select Manage OAuth2 tokens

Then:

  1. Click Connect to Service
  2. Choose the service
  3. Complete the provider’s OAuth flow
  4. Save the connection with a handle, a short name you use later in workflow code

Handles should use lowercase letters, numbers, and hyphens only.

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}` },
});

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.

ServiceDoc
GoogleGoogle OAuth
SlackSlack OAuth
MicrosoftMicrosoft OAuth
HubSpotHubSpot OAuth
GitHubGitHub OAuth
DropboxDropbox OAuth
MailchimpMailchimp OAuth
NotionNotion OAuth
Shopify (custom app / secondary store)Shopify Custom App
Custom (any OAuth 2.0 provider)Custom OAuth

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.