Google Sheets Integration

Ghost RPA reads lead data from your Google Sheet and writes results (status, timestamps, comments) back to it in real time. This guide walks you through connecting your Google account using OAuth 2.0 — the recommended and most secure method.

Time required: About 10–15 minutes for first-time setup. After that, connecting a new sheet takes seconds.

Prerequisites

  • A Google account (personal or Workspace)
  • Access to Google Cloud Console
  • Ghost RPA installed and running on your PC

Step 1 — Create a Google Cloud Project

If you already have a Google Cloud project, you can skip this step and use your existing project.

  1. Go to console.cloud.google.com and sign in with your Google account.
  2. Click the project dropdown at the top of the page, then click New Project.
  3. Enter a project name (e.g. Ghost RPA) and click Create.
  4. Make sure the new project is selected in the top dropdown.
Google Cloud Console — New Project dialog showing project name Ghost RPA SHEET

Step 2 — Enable the Google Sheets API

Your project needs the Google Sheets API enabled before Ghost RPA can read or write to any sheet.

  1. In the Cloud Console, go to APIs & Services → Library (from the left sidebar or the search bar).
  2. Search for Google Sheets API.
  3. Click on it, then click Enable.
Google Cloud Console — Google Sheets API enabled, showing Status: Enabled

Step 3 — Create OAuth Credentials

Ghost RPA uses an OAuth 2.0 "Desktop app" client to authorize your Google account. You create the client once in Cloud Console, then paste the credentials into Ghost RPA.

  1. Go to APIs & Services → Credentials.
  2. Click + Create Credentials → OAuth client ID.
  3. If prompted to configure the OAuth consent screen first:
    • Select External (or Internal if Workspace).
    • Fill in the app name (e.g. Ghost RPA), your email, and save.
    • Add the scope https://www.googleapis.com/auth/spreadsheets.
    • Add yourself as a test user.
    • Save and go back to Credentials.
  4. For Application type, select Desktop app.
  5. Give it a name (e.g. Ghost RPA Desktop) and click Create.
  6. A "Your Credentials" screen will appear with your Client ID. Click Download to save the JSON file — it contains both your Client ID and Client Secret. You'll need both in the next step.
Google Sheets API page — Create credentials button highlighted
OAuth Consent Screen — App name, support email, and developer contact
OAuth Client ID — Application type Desktop app selected, name Ghost RPA Desktop client
Your Credentials — Client ID displayed with copy and download options
Where to find Client ID & Secret: After creating the OAuth client, Google shows a "Your Credentials" popup. Click Download (⬇) to save a JSON file. Open this file in any text editor — your client_id and client_secret are both inside it. You'll paste these into Ghost RPA in the next step.

Add yourself as a Test User

Your OAuth app is in Testing mode by default — only accounts listed as test users can sign in. If you skip this, you'll see an "Access blocked" error when you try to connect.

  1. In the Cloud Console, go to Google Auth Platform → Audience (left sidebar).
  2. Under Test users, click + Add users.
  3. Enter the Google email address you'll use to connect Ghost RPA (the same account that owns or has access to your sheets).
  4. Click Save.
Don't skip this! Without adding yourself as a test user, Google will block the sign-in with a "403 access_denied" error. Every Google account that needs to connect must be added here.
Keep these credentials safe. Do not share your Client ID or Client Secret publicly. They give access to your Google Sheets API quota.

Step 4 — Configure OAuth in Ghost RPA

Now paste your OAuth credentials into Ghost RPA so it can connect to your Google account.

  1. Open Ghost RPA and go to Settings (gear icon in the sidebar).
  2. Scroll down to Sheet Connections and find the Google Sheets card.
  3. Click "Set up the OAuth client" to expand the configuration form.
  4. Paste your Client ID and Client Secret from Step 3.
  5. Click Save. You'll see a confirmation message.
Ghost RPA Settings — Google Sheets card expanded with Client ID and Client Secret fields, Connect button, and red arrow pointing to the OAuth form

Step 5 — Connect Your Google Account

With the OAuth client configured, you can now authorize Ghost RPA to access your Google Sheets.

  1. On the Google Sheets card, click the Connect button.
  2. Your default browser will open to Google's consent screen. Sign in with the same Google account where you created the Cloud project (the one you added as a test user in Step 3).
  3. Click Allow to grant Ghost RPA read and write access to your spreadsheets.
  4. The browser will show a success message. Go back to Ghost RPA — the card now shows "Connected as your-email@gmail.com".
Google Sign-in — Choose an account screen to continue to Ghost RPA Sheet OAuth
Google consent screen — Ghost RPA Sheet OAuth wants access to your Google Sheets, with Continue button
Per-workspace connection. Each workspace has its own Google account connection. If you have multiple workspaces, connect each one separately from its settings.

Step 6 — Prepare Your Google Sheet

Your Google Sheet needs a specific structure so the engine can read data and write results.

Required tab: Sheet1

The first tab must be named Sheet1 (exact spelling, case-sensitive). This is where your lead data lives and where the engine writes status updates.

Column layout

The first three columns (A, B, C) are reserved by the engine. Your data columns start from column D onward.

ColumnHeaderPurposeWho writes
ASTATUSRun result — "success", "failure", or custom statusEngine
BRUNNER_IDWhich runner processed this rowEngine
CUsedTsTimestamp when the row was usedEngine
D+Your headersData columns — EMAIL, FIRST_NAME, LAST_NAME, PHONE, ADDRESS, etc.You
Google Sheet with proper column layout — STATUS, RUNNER_ID, UsedTs, USED_URL, FIRST_NAME, LAST_NAME, EMAIL, PHONE, ADDRESS, CITY, STATE, ZIP

Example sheet

Here's what a typical sheet looks like before a run:

STATUSRUNNER_IDUsedTsEMAILFIRST_NAMELAST_NAMEPHONE
john@example.comJohnSmith5551234567
jane@example.comJaneDoe5559876543

After a run, the engine fills in STATUS, RUNNER_ID, and UsedTs for each processed row. Rows with an existing STATUS are skipped (already done).

Optional: Sheet2 (VCC / Billing)

If your workflow involves Virtual Credit Card (VCC) billing, add a second tab named Sheet2. The engine uses this for billing-specific status writes (vcc_sheet_status action). If you don't use VCC, you can skip this tab.

Optional columns

HeaderPurpose
COMMENT or COMMENTSThe sheet_comment action writes here
USED_URLThe URL that was opened for this row

Step 7 — Sheet Access

If you create the Google Sheet from the same Google account you connected in Step 5, everything works automatically — no extra sharing is needed. The OAuth connection gives Ghost RPA full read and write access to all sheets owned by that account.

Different account? If the sheet belongs to a different Google account, open the sheet → click Share → add the email of the account you connected in Ghost RPA with Editor access. The engine needs write permission.

Finally, tell your script which Google Sheet to use by adding the spreadsheet ID to your script JSON.

Finding the Spreadsheet ID

Open your Google Sheet in the browser. The spreadsheet ID is the long string in the URL between /d/ and /edit:

JSON
https:6
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                         This is your spreadsheet ID

Adding to your script

In your script JSON file, set the sources.google_sheet_id field:

JSON
{
  "sheet": {
    "type": "google"
  },
  "sources": {
    "google_sheet_id": "1AbC2dEfG3hIjK4lMnOpQrStUvWxYz"
  }
}

That's it — your Google Sheet is now connected and ready to use. When you run the script, the engine will read rows from Sheet1 and write results back automatically.

How It Works at Runtime

When a run starts, the engine:

  1. Connects to the Google Sheets API using your stored OAuth token.
  2. Reads all rows from Sheet1 and picks rows where the STATUS column is empty (not yet processed).
  3. For each profile, assigns a row and writes the RUNNER_ID and UsedTs to claim it.
  4. Runs the script actions — data tokens like {{EMAIL}}, {{PHONE}} etc. pull values from that row's columns.
  5. After completing (or failing), writes the final STATUS and optional COMMENT back to the row.

Troubleshooting

Google Sheets API not enabled

Error: Google Sheets API has not been used in project ... or it is disabled

Fix: Go back to Step 2 and make sure the Google Sheets API is enabled in your Cloud project.

Required tab "Sheet1" not found

Error: Required tab "Sheet1" not found

Fix: Rename your first sheet tab to exactly Sheet1 (case-sensitive). Google Sheets sometimes defaults to locale-specific names like "Hoja 1" or "Feuille 1".

Permission denied / Cannot edit

Error: The caller does not have permission or PERMISSION_DENIED

Fix: Make sure the sheet is shared with Editor access to the Google account shown in your connection status (Step 7). Viewer-only access is not enough — the engine needs write access.

Token expired / Disconnected

OAuth tokens can expire if unused for a long time or if you revoke access from your Google account security settings.

Fix: Go to Settings → Sheet Connections → Google and click Connect again to re-authorize.

Quota exceeded (429 errors)

Google Sheets API has a quota of 300 requests per minute per project. Ghost RPA automatically rate-limits and retries with backoff, but if you're running many threads simultaneously, you may hit the limit.

Fix: The engine handles this automatically with retry and backoff. If it persists, reduce the number of concurrent threads or wait a few minutes.

Wrong spreadsheet ID

Error: Requested entity was not found

Fix: Double-check the google_sheet_id in your script JSON. Make sure you copied only the ID part from the URL, not the full URL.