Google Sheet Integration Not Working in WATI? Here Is the Real Reason and the Only Fix That Works

Over the last few weeks, many WATI Pro users reported the same problem. They could not connect Google Sheets to their chatbot workflows. The issue was not caused by WATI. It came from Google. If you try to force the old connection you will waste time because Google tightened access rules and blocked many third party integrations.

The good news is simple. There is a clean workaround that does not depend on Google's broken connector. You can handle the entire flow using a webhook and a small Google Apps Script. It gives you full control, it is far more stable than the native connection and it avoids the permission conflicts that triggered the failures.

If you rely on Google Sheets for lead capture, logs, or automation output, follow the steps below. This method works regardless of how many variables you want to send.


Why the Native WATI Google Sheet Connector Fails

Google recently rolled out background security updates. They did not announce these clearly but the impact is visible. Apps that request spreadsheet access through old scopes are being blocked or delayed. When WATI tries to authenticate, Google rejects the request or hangs. The result is a connector that looks active but never actually writes data.

Trying to refresh the token does not solve anything because the issue is on Google’s authorization layer. Until Google resolves it, relying on that integration is simply unstable.

If your revenue or lead tracking depends on these logs, you cannot afford instability. Use a webhook instead.


The Practical Fix. Use a Webhook With Google Apps Script

Here is the exact setup that works reliably. It bypasses the unstable Google connector and gives you a simple POST endpoint that receives JSON and writes it into your Sheet.

Step 1. Open Apps Script

Open your Google Sheet → Extensions → Apps Script

Delete any existing code and paste the script below.

Step 2. Delete any existing code and paste the script below

I will not pretend the script is magical. It is just a structured handler that accepts JSON, auto creates headers, and appends a row. It also uses locking to avoid corrupted writes during peak traffic.

Paste this:

function doPost(e) {
  // Acquire lock to prevent concurrent writes
  const lock = LockService.getScriptLock();
  try {
    lock.waitLock(10000); // wait up to 10 seconds

    // ====== CONFIGURATION ======
    const SHEET_NAME = 'WebhookData'; // Change to your sheet name
    // ===========================

    const ss = SpreadsheetApp.getActiveSpreadsheet();
    let sheet = ss.getSheetByName(SHEET_NAME);

    // Create sheet if not found
    if (!sheet) {
      sheet = ss.insertSheet(SHEET_NAME);
    }

    // Parse incoming JSON
    const data = JSON.parse(e.postData.contents || '{}');

    // If data is empty, throw error
    const keys = Object.keys(data);
    if (keys.length === 0) {
      throw new Error("No data received in JSON payload.");
    }

    // Add timestamp to the data
    data.timestamp = new Date();
    keys.push('timestamp'); // include timestamp in headers

    // Safely read existing headers
    let headers = [];
    const lastCol = sheet.getLastColumn();
    if (lastCol > 0) {
      headers = sheet.getRange(1, 1, 1, lastCol).getValues()[0];
    }

    // Add any new headers
    let newHeadersAdded = false;
    Object.keys(data).forEach(key => {
      if (!headers.includes(key)) {
        headers.push(key);
        newHeadersAdded = true;
      }
    });

    // Update header row if empty sheet or new headers
    if (headers.length > 0 && (lastCol === 0 || newHeadersAdded)) {
      sheet.getRange(1, 1, 1, headers.length).setValues([headers]);
    }

    // Prepare row based on headers
    const row = headers.map(h => data[h] || '');

    // Append row
    sheet.appendRow(row);

    // Release lock
    lock.releaseLock();

    // Success response
    return ContentService
      .createTextOutput(JSON.stringify({
        status: 'success',
        message: `Data added to "${SHEET_NAME}"`,
        receivedKeys: Object.keys(data)
      }))
      .setMimeType(ContentService.MimeType.JSON);

  } catch (error) {
    try { lock.releaseLock(); } catch (e) {} // ensure lock is released
    return ContentService
      .createTextOutput(JSON.stringify({
        status: 'error',
        message: error.message
      }))
      .setMimeType(ContentService.MimeType.JSON);
  }
}

Step 3. Deploy as Web App

Go to Deploy, New deployment.
Select Web app.

Use these settings:

Description: Webhook endpoint
Execute as: Me
Who has access: Anyone or Anyone with the link

Click Deploy.
Copy the Web App URL.
This is your new webhook URL.


Sample Payload

Send anything in JSON format. For example:

{
  "name": "Alice",
  "email": "alice@example.com",
  "city": "Bangalore"
}

Your sheet will output:

timestampnameemailcity
2025 10 26 19:55:00Alicealice@example.comBangalore

The script auto detects new fields and creates new columns without breaking the sheet.


Connecting the Webhook to WATI

Inside the WATI chatbot builder, insert a Webhook Node.
Add the URL you copied.
Set method to POST.
Send the JSON you want to store.

You can build any data structure you want. If you decide to change the field names later, the script adjusts the headers automatically.


How Many Requests Can This Handle

This method is stable but not unlimited. Many people overestimate what Google Sheets can handle. Here are the real constraints.

Apps Script quotas

These vary by account, but average limits are:

Limit TypeApprox limitNotes
Write operations~50,000 per dayEach appendRow counts as one
Script runtime total~6 hours per dayAll executions combined
Concurrent executionsLimitedHeavy bursts create queueing

Expect safe performance at 30 to 60 requests per minute. If you push beyond that, you risk lock timeouts or delayed writes.

Spreadsheet limits

Google Sheets caps at about 10 million cells per file.
If you plan long term storage or heavy automation, do not use Sheets as a database. Move to a proper DB like Firebase or Supabase. Sheets is fine for logs, demos, or lightweight pipelines, not enterprise scale.


Brutal Truth. Stop Treating Google Sheets as a Real Backend

Many WATI users rely entirely on Sheets for lead management. It works until traffic increases. Then it collapses under its own limitations. The Apps Script method solves the immediate issue, but it does not solve scalability. If you are onboarding hundreds of leads daily, Sheets is the wrong tool.

Use this method as a patch, not a long term architecture.

If you want something scalable, stop depending on a spreadsheet and move your pipelines to a database or CRM.

If you need any support contact us : lwpworkflow@gmail.com

Leave a Reply

Your email address will not be published. Required fields are marked *