Process automation means software runs a whole business process from start to finish. It starts on its own, pulls the inputs, applies your rules, and hands you a finished output with the decision already proposed. Task automation does one step, like copying a form into a sheet. The difference matters because most founders who think they've automated something have automated a task and still run the process themselves. They still open four tabs every Monday and still decide what to do from numbers they compared in their head.

The quickest way to learn process automation is to automate one process you personally run, end to end, and look at where it breaks. Below is one I can show with real numbers: the weekly check on how the AsLynx website performs in Google search. Every setting is listed, so you can build the same thing today with a Google account and an Anthropic API key, then reuse the pattern for invoices or client intake.

The test I use to tell a process from a task

The question I ask first is simple. If you disappeared for a month, would the output still arrive, and would the person reading it know what to do next? If the answer is no, you automated a task.

A process has four parts. A trigger (Monday morning, or an invoice going overdue). Inputs (the data it needs, from wherever it lives). Rules (what's worth flagging and what isn't). An output that includes a proposed action, delivered where you'll act on it. The trigger and the inputs are the plumbing, and you've probably wired plenty of that already. The rules and the proposed action are where AI earns its place, because that's the part you were doing in your head. If you want the longer version of where the line sits, I wrote up the difference between business process automation and workflow automation.

The process before automation

Here's what the manual version looked like. Open Search Console, go to Performance, set the date to the last 28 days, read the Queries tab, then the Pages tab. Open GA4, go to Reports, Acquisition, Traffic acquisition, and look at the Organic Search row. Compare against the previous 28 days. Then decide what to write or fix that week.

These are the real numbers for the 28 days to November 15, 2026. Search Console's query table listed 50 search queries that showed the site, with 285 impressions and 4 clicks between them. Hold on to the word listed. The page table for the same window shows /blog alone with 502 impressions and 0 clicks, so the query table is a slice of the site, not the site. The most seen search was "ai solutions for business canada" with 32 impressions at an average position of 19.0. In GA4, organic search brought 13 sessions and 0 key events, against 33 sessions the 28 days before.

I'm not going to put an hours saved figure on this, because I never timed the manual version. The honest gain is different anyway. The manual check got skipped in busy weeks, and the drop from 33 sessions to 13 is exactly the kind of thing you want to see the week it happens.

The setup, step by step

The whole thing runs in Google Apps Script, inside a Google Sheet, so there's no server to host and no new tool to subscribe to.

Sort out access before you write anything, because that's where first runs fail. The Google account that will own the script has to be added as a user on the Search Console property (Settings, Users and permissions) and needs at least Viewer on the GA4 property (Admin, Property access management). Choose that account on purpose: the trigger runs as whoever creates it, so a shared operations login beats a staff member's personal account. Your Anthropic API key also has to come from an account with billing set up and credit on it, or the call fails.

  1. Create a Google Sheet. Go to Extensions, Apps Script.
  2. In the Apps Script editor, open Project Settings (the gear icon) and tick "Show appsscript.json manifest file in editor". This is the setting most people miss. With it off, I had nowhere to declare the Search Console permission, and the first run came back with a 403 that didn't say why.
  3. Open appsscript.json and add an oauthScopes list with these five: https://www.googleapis.com/auth/webmasters.readonly, https://www.googleapis.com/auth/analytics.readonly, https://www.googleapis.com/auth/script.external_request, https://www.googleapis.com/auth/spreadsheets.currentonly and https://www.googleapis.com/auth/gmail.send.
  4. In the left panel, click the plus next to Services and add Google Analytics Data API. Keep the identifier as AnalyticsData.
  5. Back in Project Settings, scroll to Script Properties and add SITE_URL (the property exactly as Search Console's property picker shows it), GA4_PROPERTY (the numeric ID from GA4 Admin, Property details), ANTHROPIC_API_KEY, MODEL and REPORT_TO (your email). For MODEL I use the Claude Sonnet model ID, copied straight from Anthropic's models page. Model IDs contain dashes and a date, so paste it rather than typing it. Keys go here, never in the code.
  6. Make a tab called Prompt and paste the report prompt from further down into cell A1.
  7. Paste the spec below into Claude, paste the script it returns into Code.gs, and run weeklyReport once by hand so Google asks you to approve the permissions.
  8. Click the clock icon (Triggers), Add Trigger, choose weeklyReport, Time driven, Week timer, Every Monday, 7am to 8am.

The objection I hear is "this needs a developer". It doesn't, but it needs you to read error messages. The 403 I see most often is caused by the script owner not being added to the Search Console property. Add it under Settings, Users and permissions, and it clears.

The spec I hand Claude to write the script

I don't write this code by hand anymore. I write the spec, because the spec is where the process lives, and Claude writes the code from it. Paste this as is:

Write a Google Apps Script for a script bound to a Google Sheet.
Read SITE_URL, GA4_PROPERTY, ANTHROPIC_API_KEY, MODEL and REPORT_TO from Script Properties.
Window A is the 28 days ending 3 days before today. Window B is the 28 days before Window A.
Format dates with toISOString and keep the first 10 characters.

1. For each window, call the Search Console searchAnalytics query endpoint with UrlFetchApp and ScriptApp.getOAuthToken(). Make one call with no dimensions (site totals), then one call each for dimension query and dimension page, with rowLimit 50.
2. For each window, call AnalyticsData.Properties.runReport with metrics sessions and keyEvents, filtered to sessionDefaultChannelGroup exactly equal to Organic Search.
3. Write every table to its own tab, named with the table type and the window end date.
4. Send all tables as one JSON object with keys totals_A, totals_B, queries_A, queries_B, pages_A, pages_B, ga4_A, ga4_B to the Anthropic Messages API, using the text in cell A1 of the Prompt tab as the instruction and max_tokens 1500.
5. Email the reply to REPORT_TO with GmailApp, subject Search report plus the Window A end date.

Call UrlFetchApp with muteHttpExceptions true.
Wrap every API call in try/catch. If a call throws, or a UrlFetchApp response code is anything other than 200, email REPORT_TO with subject Search report FAILED, then the step name, then the error text or response body with the response code if there is one. Then stop.
The script must never send email to anyone except REPORT_TO.

The try/catch line matters more than it looks. The GA4 call goes through an Apps Script Advanced Service, which throws an exception when it fails instead of handing back a response code. A spec that only checks for non 200 codes lets a GA4 failure die quietly in the log, and you find out three Mondays later.

The last line is there on purpose too. A process that sends email should have its recipient list fixed in the spec, so a bug can't turn it into something that writes to clients.

The prompt that writes the report

This goes in cell A1 of the Prompt tab. Keeping it in the sheet means you can tune it without touching code.

You are reviewing the weekly search report for our website. The JSON holds Search Console data (site totals in totals_A and totals_B, plus the top query and page rows) and GA4 organic sessions, for the current 28 days (A) and the previous 28 days (B).

The query and page rows are top slices, so query rows add up to less than the site totals. Never add rows together to get a total. Use totals_A and totals_B for totals.
GA4 organic sessions come from a different system than Search Console clicks. Do not treat a gap between them as an error.

Write under 250 words, in plain sentences:
1. Search Console clicks and impressions for Window A against Window B with the change, then the same comparison for GA4 organic sessions.
2. Every page with more than 200 impressions and 0 clicks. For each, say the fix is its title and meta description.
3. Every query with an average position between 8 and 20 and at least 10 impressions. For each, say whether a page in pages_A already targets it or a new page is needed.
4. One line on anything the data can't tell you.
Use only numbers that appear in the JSON. Do not round positions.

The thresholds (200 impressions, positions 8 to 20) are mine for a small site. Raise them once your numbers grow, or the report fills up with noise.

How to check it actually worked

You're trusting code Claude wrote, so don't trust it until it passes these, in this order.

  1. Run weeklyReport by hand from the editor, then click Executions in the left panel. The run should say Completed. If it says Failed, click it and read the log line where it stopped.
  2. Look at the Sheet. You should have eight new tabs (totals, queries, pages and ga4, once per window), each named with its window end date. The Window A queries tab should hold up to 50 rows.
  3. Open the REPORT_TO inbox. The subject is Search report plus the Window A end date, and the body runs under 250 words with the four numbered parts from the prompt.
  4. Once, compare the email's impressions against Search Console with the same custom dates set in Performance. If the email's number matches the query table instead of the site total, the model added rows, and the prompt needs tightening.
  5. Force a failure. Change SITE_URL in Script Properties to a property your account can't see and run it again (then put the real value back).

The failure email should look like this:

Subject: Search report FAILED
Step: queries, Window A
Response code: 403
Body: (the error text Search Console returned)

If the forced failure sends nothing, the try/catch isn't wrapping that call. You'd much rather learn that today than on the Monday it matters.

What it gets wrong: the 285 versus 502 problem

Our own numbers show the trap. The 50 listed queries add up to 285 impressions, yet /blog alone had 502. Both are correct. I can't see which searches are missing from the query table, but the arithmetic says they exist, because grouping by page counted impressions that grouping by query left out.

Hand a model only the query table and ask for a summary, and it will happily report 285 as your total impressions. That's why the spec makes a separate call with no dimensions for the real totals, and why the prompt says in plain words never to add rows up. If you build any process where the AI summarises a table, check whether the table is a total or a top slice. This is the single mistake I'd look for first.

The second trap is freshness. When I ended Window A at yesterday, the most recent days came in low and every week read like a drop. Ending it three days back stopped that. Our 4 clicks and 13 organic sessions don't match either, and they aren't supposed to. One comes from Search Console and the other from GA4's Organic Search channel, two systems counting different things, and the prompt tells the model so.

The decision part, which is the point

A report that only lists numbers is still a task. The process is finished when the output proposes the action. From the November numbers, the report would flag two things. /blog had 502 impressions and 0 clicks, so the fix is the page's title and meta description rather than another post. And "ai solutions for business canada" sat at position 19.0 with 32 impressions, on page two, which makes it the best candidate for a page written for that exact search.

The script drafts and I decide. Nothing gets published or changed without me. For search reports that's an easy call, but the rule I use for where an AI process should stop and wait is written up in when an AI agent should ask for human approval.

Where it breaks at real volume, and what it costs

The only metered part is the Anthropic call, once a week. The spec caps the reply at 1500 output tokens, so the output side of each run has a ceiling before it ever runs. The input is eight tables of mostly numbers, so the bill moves with how many rows you send. Raise rowLimit or add properties and that's the number that grows.

The Google side is where scale bites, say an agency running this for 30 clients. Apps Script limits how long a single run can last, and one long loop through 30 Search Console properties is the obvious way to hit that wall. Build it as one run per property from the start, each with its own trigger, so one slow or broken property can't take the others down with it.

The other thing that breaks quietly is ownership. The trigger runs as the person who created it. If that person leaves or loses access to the Search Console property, the script fails every Monday. The failure email in the spec is what tells you, which is why I never skip it.

The same pattern on invoices, intake and client email

Swap the parts and the process holds. For overdue invoices, the trigger is an invoice seven days past due, the inputs are the invoice and the client's last few emails, the rules decide tone (first reminder or second, long term client or new), and the output is a draft sitting in Gmail Drafts, never a sent email. For intake, the trigger is a new form submission, and the output is a filled matter record plus a list of what's missing. Before you send client financials or case details to a model, read what to share with AI and what to lock, because that changes which provider and which settings you can use.

Write the spec first, in plain sentences, with the recipient list and the try/catch failure email in it. If you can't write the rules down, you're not ready to automate the process yet, and that's the useful finding. For picking which process to start with across the rest of the business, my working guide to using AI in your business goes through it job by job.