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.
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.
- Go to console.cloud.google.com and sign in with your Google account.
- Click the project dropdown at the top of the page, then click New Project.
- Enter a project name (e.g.
Ghost RPA) and click Create. - Make sure the new project is selected in the top dropdown.

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.
- In the Cloud Console, go to APIs & Services → Library (from the left sidebar or the search bar).
- Search for Google Sheets API.
- Click on it, then click Enable.

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.
- Go to APIs & Services → Credentials.
- Click + Create Credentials → OAuth client ID.
- 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.
- For Application type, select Desktop app.
- Give it a name (e.g.
Ghost RPA Desktop) and click Create. - 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.




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.
- In the Cloud Console, go to Google Auth Platform → Audience (left sidebar).
- Under Test users, click + Add users.
- Enter the Google email address you'll use to connect Ghost RPA (the same account that owns or has access to your sheets).
- Click Save.
Step 4 — Configure OAuth in Ghost RPA
Now paste your OAuth credentials into Ghost RPA so it can connect to your Google account.
- Open Ghost RPA and go to Settings (gear icon in the sidebar).
- Scroll down to Sheet Connections and find the Google Sheets card.
- Click "Set up the OAuth client" to expand the configuration form.
- Paste your Client ID and Client Secret from Step 3.
- Click Save. You'll see a confirmation message.

Step 5 — Connect Your Google Account
With the OAuth client configured, you can now authorize Ghost RPA to access your Google Sheets.
- On the Google Sheets card, click the Connect button.
- 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).
- Click Allow to grant Ghost RPA read and write access to your spreadsheets.
- The browser will show a success message. Go back to Ghost RPA — the card now shows "Connected as your-email@gmail.com".


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.
| Column | Header | Purpose | Who writes |
|---|---|---|---|
| A | STATUS | Run result — "success", "failure", or custom status | Engine |
| B | RUNNER_ID | Which runner processed this row | Engine |
| C | UsedTs | Timestamp when the row was used | Engine |
| D+ | Your headers | Data columns — EMAIL, FIRST_NAME, LAST_NAME, PHONE, ADDRESS, etc. | You |

Example sheet
Here's what a typical sheet looks like before a run:
| STATUS | RUNNER_ID | UsedTs | FIRST_NAME | LAST_NAME | PHONE | |
|---|---|---|---|---|---|---|
| john@example.com | John | Smith | 5551234567 | |||
| jane@example.com | Jane | Doe | 5559876543 |
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
| Header | Purpose |
|---|---|
COMMENT or COMMENTS | The sheet_comment action writes here |
USED_URL | The 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.
Step 8 — Link the Sheet to Your Script
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:
https:6
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is your spreadsheet IDAdding to your script
In your script JSON file, set the sources.google_sheet_id field:
{
"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:
- Connects to the Google Sheets API using your stored OAuth token.
- Reads all rows from
Sheet1and picks rows where theSTATUScolumn is empty (not yet processed). - For each profile, assigns a row and writes the
RUNNER_IDandUsedTsto claim it. - Runs the script actions — data tokens like
{{EMAIL}},{{PHONE}}etc. pull values from that row's columns. - After completing (or failing), writes the final
STATUSand optionalCOMMENTback 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.