# When Apps Script triggers aren't enough

Source: https://clickruntime.com/alternatives/google-apps-script

> Apps Script is the quickest way to automate inside Google Sheets and Docs. It gets harder when a job runs on a timetable that must be exact, receives webhooks that need a signature check, or calls services outside Google. ClickRuntime runs those as Python, and still reads and writes your Sheets.

## Why people move Apps Script triggers to ClickRuntime

- **Webhooks you can verify.** Trigger links pass the request headers to the script and check Stripe, GitHub, Shopify, Typeform and HMAC signatures for you.
- **Runs at the time you set.** A daily schedule runs at that time in your timezone, not somewhere within an hour.
- **Any app with an API.** No connector to wait for. If an app has an API or sends webhooks, an automation can use it.
- **Still works with Sheets.** Connect Google with only the spreadsheets you pick, and the script reads and writes them through the Sheets API.
- **State and versions built in.** Each automation remembers what it saw last time. Every change is a new version, and a failed deploy never replaces the working one.
- **Built from the assistant you already use.** Ask in ChatGPT, Claude, Cursor or any MCP client. It writes the automation, tests it and fixes it.

## Google Apps Script and ClickRuntime compared

|  | Google Apps Script | ClickRuntime |
|---|---|---|
| Made for | Scripts inside Google Workspace files | Jobs on a schedule or webhook, across any apps |
| Language | JavaScript | Python 3.11 |
| Schedules | Time-driven triggers; a daily trigger fires within a one-hour window | Every 5 minutes or slower, at the time you set |
| Run length | 6 minutes per execution | A time limit per run |
| Daily limits | Trigger runtime 90 minutes a day (consumer) or 6 hours (Workspace); URL Fetch 20,000 or 100,000 calls a day | Monthly runs per plan |
| Webhooks | Web app doPost; the event object doesn't list request headers, so signatures can't be checked | Trigger link with headers and signature checks |
| State | Properties: 9 KB per value, 500 KB per store | State and counters built into every automation |
| Cost | Included with a Google account | 250 runs a month free; paid plans from $9 for 2,000 runs |

ClickRuntime pricing: https://clickruntime.com/pricing

## Google Apps Script or ClickRuntime?

### Choose Google Apps Script when

- The logic lives inside a Sheet or Doc: custom functions, menus, onEdit triggers, formatting.
- It only touches Google services and fits the quotas. Apps Script is included with your account.
- You need the script to run as each user inside their own document.

### Choose ClickRuntime when

- You receive webhooks from Stripe, Typeform or GitHub and want them verified.
- The job calls services outside Google, or needs Python packages.
- Timing matters, or the job runs into daily trigger or URL Fetch quotas.

## Move from Google Apps Script

1. **Pick triggers and web apps, not sheet logic.** Move time-driven triggers and doPost web apps. Keep custom functions, menus and onEdit triggers in Apps Script.
2. **Ask your assistant to rebuild it.** Connect ClickRuntime to ChatGPT, Claude or Cursor, paste the Apps Script code and say what should happen. It saves a draft you can read before anything runs.
3. **Connect Google and save keys.** Connect your Google account in the ClickRuntime dashboard and pick only the spreadsheets the automation should open. Save other services' keys as secrets. Keys never go into the chat.
4. **Test it.** Your assistant turns the automation on, runs it once or sends a test event, and fixes it until the run succeeds. Run both side by side for a few days if you like.
5. **Switch the old one off.** Replace the web app URL in Stripe or the sending service with the trigger link, then delete the trigger or web app deployment in Apps Script.

## One job, moved from Google Apps Script

Before: Code.gs

```javascript
// Web app deployed as "Anyone"; Stripe sends checkout.session.completed here
function doPost(e) {
  const body = JSON.parse(e.postData.contents);   // no headers: Stripe-Signature can't be checked
  const s = body.data.object;
  SpreadsheetApp.openById("SHEET_ID").getSheetByName("Payments")
    .appendRow([new Date(), s.customer_details.email, s.amount_total / 100, s.currency]);
  return ContentService.createTextOutput("ok");
}
```

After, the prompt: "Move my Apps Script webhook to ClickRuntime: when Stripe sends checkout.session.completed, check the signature and add a row to the Payments tab of my sheet with the date, customer email, amount and currency."

The ClickRuntime script:

```python
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, log

SHEET_ID = "your-spreadsheet-id"

@on_event
def handle(event):
    if not event.is_verified:
        log.warning("Stripe signature check failed")
        return {"skipped": "bad signature"}
    if event.json.get("type") != "checkout.session.completed":
        return {"skipped": event.json.get("type")}
    s = event.json["data"]["object"]
    row = [event.received_at, s["customer_details"]["email"], s["amount_total"] / 100, s["currency"].upper()]
    token = credentials.connection("cr_google_sheets_picked", "work")
    sheets = build("sheets", "v4", credentials=Credentials(token), cache_discovery=False).spreadsheets()
    sheets.values().append(spreadsheetId=SHEET_ID, range="Payments!A:D",
                           valueInputOption="USER_ENTERED", body={"values": [row]}).execute()
    return {"added": s["id"]}
```

## Where each Google Apps Script piece goes

| In Google Apps Script | In ClickRuntime |
|---|---|
| Time-driven trigger | Automation with a schedule |
| Web app doPost | Trigger link, with headers and signature checks |
| PropertiesService | state.get and state.set |
| UrlFetchApp | http.get / http.post |
| SpreadsheetApp | The Sheets API with a Google connection to the files you pick |
| MailApp | notify.email_me, or Gmail's API |
| Executions log | Run log with output and errors, and an email when a run fails |

## Extend it: what you can add next

Once the first job is moved, these are the changes people usually ask for next. Each is one message to your assistant, not a new service to set up.

- **Add a column saying what each customer bought, in plain words, from the line items** (Built-in AI)
  Prompt: "Change my Stripe payments automation so it adds a short plain description of what was bought in a new column."
- **Handle refunds too, by marking the matching row** (Multi-step logic)
  Prompt: "Change my Stripe payments automation so a charge.refunded event marks the matching row as refunded."
- **Post payments over $1,000 to Slack** (Any app or API)
  Prompt: "Add to my Stripe payments automation: post payments over $1,000 to #sales in Slack."
- **Keep a running monthly total without reading the sheet** (Memory between runs)
  Prompt: "Change my Stripe payments automation to keep a monthly revenue total and include it in a Slack post on the 1st."
- **A Monday email with last week's revenue by currency** (Schedules)
  Prompt: "Add to my Stripe payments automation: every Monday at 8, email me last week's revenue by currency."
- **Take Shopify orders into the same sheet** (Trigger links)
  Prompt: "Add a trigger link to my payments sheet automation for Shopify orders/paid, with its signature checked, and add those rows too."

## Moving from Google Apps Script

### Can Apps Script verify Stripe webhook signatures?

Apps Script's doPost event object doesn't include the request headers, so the Stripe-Signature header isn't available to check. ClickRuntime passes headers to the script and can check Stripe signatures for you.

### Can ClickRuntime still update my Google Sheets?

Yes. Connect Google and pick the spreadsheets the automation may open; the script uses the Sheets API with that connection.

### Is ClickRuntime better for everything Apps Script does?

No. For custom functions, menus and edits inside a Sheet or Doc, Apps Script is the right tool and costs nothing extra.

### Do I need to know how to code?

No. You describe what should happen and your AI assistant writes, tests and fixes the Python. You can read every version in the ClickRuntime dashboard.

### What does ClickRuntime cost?

The free plan includes 250 runs a month with webhooks, code and AI. Paid plans start at $9 a month for 2,000 runs, with unlimited users. A scheduled check that finds nothing new and sends nothing isn't counted.

### Will you help me move my scripts?

Yes. Email hello@clickruntime.com with what each scripts does, or the Apps Script code or config, and we'll help until it's running. Never send API keys or other secrets.
