Google Sheets & Docs automation

Flowdrome’s Google nodes — Sheets, Docs, Drive, Gmail — authenticate with an OAuth2 credential you connect once in the vault. The nodes then reference ${credential.google-oauth2.accessToken}, and the Nucleus refreshes the token automatically. The fiddly part is Google’s side; here is the exact path.

1. Create the OAuth client (Google Cloud Console)

  1. In Google Cloud Console, create (or pick) a project.

  2. APIs & Services → Enabled APIs → Enable APIs and Services: enable each API you’ll use — Google Sheets API, Google Docs API, Google Drive API, Gmail API. A node call against a disabled API fails with a clear accessNotConfigured error naming the API.

  3. APIs & Services → OAuth consent screen: configure the consent screen (External is fine for personal use). Add yourself under Test usersonly listed test users can complete consent while the app is in Testing status.

  4. APIs & Services → Credentials → Create credentials → OAuth client ID, application type Web application. Add the authorized redirect URI:

    http://localhost:48170/api/oauth/callback

    If your Nucleus runs elsewhere, use its public URL instead — {NINER_NUCLEUS_PUBLIC_URL}/api/oauth/callback — and it must match exactly.

  5. Copy the Client ID and Client secret.

The 7-day caveat: while the consent screen is in Testing status, Google expires refresh tokens after 7 days — your credential will flip to an error state and need reconnecting weekly. For anything long-lived, publish the consent screen (move it to In production); refresh tokens then live until revoked.

2. Connect the credential

Admin → Credentials → New, template Google (OAuth2). Paste the client id + secret, save, click Connect. The Google consent tab opens; approve, and the tab closes with the credential showing connected (with token expiry). Scopes default to the Google nodes’ needs; override them on the credential if you need more or less.

The Nucleus requests offline access with forced consent, so a refresh token is always issued — token refresh happens automatically whenever a run resolves the credential.

3. Append rows to a sheet

The shipped demo appends order rows from the trigger payload:

{
  "nodes": [
    {
      "id": "seed", "type": "trigger.inject",
      "config": {
        "contentType": "application/json",
        "payload": { "orders": [
          { "id": 1, "customer": "Smith, John", "total": 149.95 },
          { "id": 2, "customer": "Jones, Ada", "total": 12.5 }
        ] }
      }
    },
    {
      "id": "append", "type": "io.google-sheets",
      "config": {
        "accessToken": "${credential.google-oauth2.accessToken}",
        "operation": "append",
        "spreadsheetId": "<your spreadsheet id>",
        "range": "Orders!A:D",
        "valuesPath": "orders",
        "valueInputOption": "USER_ENTERED"
      }
    }
  ]
}
  • valuesPath points at a list in the input; each object’s values become a row. Alternatively supply values as a literal 2-D array.
  • The spreadsheet id is the long segment of the sheet’s URL.
  • USER_ENTERED lets Sheets parse numbers/dates the way typing would; RAW stores strings.

The Sheets node also reads (read), updates (update) and clears (clear) ranges — see the node reference. Docs (create/insert/replace text), Drive (upload/download/list/delete) and Gmail (send, with attachments from binary input) ride the same credential.

Troubleshooting

SymptomCause
redirect_uri_mismatch at consentThe redirect URI in Google doesn’t exactly match the Nucleus URL — scheme, host, port, path.
access_denied for a known userThe account isn’t in Test users while the app is in Testing.
accessNotConfigured on a node callThat specific API isn’t enabled in the Cloud project.
Credential turns to error:refresh_failed after a weekTesting-status refresh-token expiry — publish the consent screen.