Google Apps Script: Automate Everything in Google Workspace for Free
Automate13 min read·April 12, 2026·--

Google Apps Script: Automate Everything in Google Workspace for Free

Google Apps Script is the most underrated free automation tool. It can automate Gmail, Sheets, Calendar, Drive, and Docs with custom JavaScript — no server, no subscription, no limits.

@
@kivorablog
April 12, 2026
Share

Why Google Apps Script Is Underrated


Every person with a Google account already has access to Apps Script. It runs on Google's servers. It's completely free. And it can automate virtually everything in your Google Workspace — without any subscription, no server setup, no external tools.


CapabilityWhat You Can Automate
GmailAuto-label, auto-reply, extract data from emails
Google SheetsAuto-calculations, sending emails from Sheet data, building dashboards
Google CalendarCreate events, send reminders, sync with other systems
Google DriveOrganise files, create folders, convert formats
Google DocsGenerate documents from templates
Google FormsProcess submissions, trigger workflows



Getting Started


  • Open any Google Sheet, Doc, or Form
  • Click Extensions → Apps Script
  • A code editor opens — this is where you write your scripts
  • Click the floppy disk icon to save, then the play button to run

Or go directly to script.google.com to create standalone scripts.


Automation 1: Auto-Label Emails in Gmail

Sort incoming emails automatically by sender domain, keywords, or any criteria.

function autoLabelEmails() {
  // Run this on a trigger: every 5 minutes
  const label   = GmailApp.getUserLabelByName('Clients') || GmailApp.createLabel('Clients')
  const threads = GmailApp.search('is:unread from:(@yourclient.com)', 0, 10)

  threads.forEach(thread => {
    thread.addLabel(label)
    // Optional: mark as read after labelling
    // thread.markRead()
  })
},

// Set a time-based trigger to run every 5 minutes:
// Extensions → Apps Script → Triggers → Add trigger
// Function: autoLabelEmails
// Select event source: Time-driven → Minutes timer → Every 5 minutes

Automation 2: Send Emails from a Google Sheet

You have a spreadsheet of contacts. Send each one a personalised email.

function sendPersonalisedEmails() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Contacts')
  const data  = sheet.getDataRange().getValues()

  // Skip header row
  for (let i = 1; i < data.length; i++) {
    const [name, email, company, status] = data[i]

    // Skip if already sent
    if (status === 'Sent') continue

    // Build email body
    const subject = `Following up — ${company}`
    const body    = `Hi ${name},

I wanted to follow up on our conversation about ${company}'s automation needs.

Have you had a chance to think about it?

Best,
Your Name`

    // Send email
    GmailApp.sendEmail(email, subject, body)

    // Mark as sent in the spreadsheet
    sheet.getRange(i + 1, 4).setValue('Sent')
    sheet.getRange(i + 1, 5).setValue(new Date())

    // Rate limiting: wait 1 second between emails
    Utilities.sleep(1000)
  }

  Logger.log('Done! Check the sheet for sent statuses.')
},

Automation 3: Webhook Receiver in Apps Script

Apps Script can receive webhooks — making it a free alternative to many paid webhook processors.

// This script acts as a webhook endpoint
// Deploy it as a Web App (Publish → Deploy as web app → Anyone can access)

function doPost(e) {
  const data = JSON.parse(e.postData.contents)

  // Log to a Sheet
  const sheet = SpreadsheetApp.openById('YOUR_SHEET_ID').getSheetByName('Webhooks')
  sheet.appendRow([
    new Date(),
    data.event || 'unknown',
    JSON.stringify(data),
  ])

  // Trigger actions based on event type
  if (data.event === 'payment.success') {
    handlePaymentSuccess(data)
  }

  return ContentService
    .createTextOutput(JSON.stringify({ success: true }))
    .setMimeType(ContentService.MimeType.JSON)
},

function handlePaymentSuccess(data) {
  // Send confirmation email, update CRM, etc.
  GmailApp.sendEmail(
    data.customer.email,
    'Payment Confirmed — Thank You!',
    `Hi ${data.customer.name}, your payment of ${data.amount} has been confirmed.`
  )
},

Automation 4: Generate Reports Automatically

function generateWeeklyReport() {
  const ss          = SpreadsheetApp.getActiveSpreadsheet()
  const dataSheet   = ss.getSheetByName('Data')
  const reportSheet = ss.getSheetByName('Weekly Report') || ss.insertSheet('Weekly Report')

  const lastWeek = new Date()
  lastWeek.setDate(lastWeek.getDate() - 7)

  // Get data from last 7 days
  const allData = dataSheet.getDataRange().getValues()
  const weekData = allData.filter(row => new Date(row[0]) >= lastWeek)

  // Calculate metrics
  const totalRevenue = weekData.reduce((sum, row) => sum + (row[2] || 0), 0)
  const totalOrders  = weekData.length
  const avgOrder     = totalOrders > 0 ? totalRevenue / totalOrders : 0

  // Write to report sheet
  reportSheet.clearContents()
  reportSheet.getRange('A1').setValue('Weekly Report: ' + new Date().toDateString())
  reportSheet.getRange('A3:B6').setValues([
    ['Total Revenue',   totalRevenue],
    ['Total Orders',    totalOrders],
    ['Average Order',   avgOrder.toFixed(2)],
    ['Generated',       new Date()],
  ])

  // Email the report
  const recipient = 'you@example.com'
  const subject   = `Weekly Report — ${new Date().toDateString()}`
  const body      = `Weekly Summary:
Revenue: $${totalRevenue.toFixed(2)}
Orders: ${totalOrders}
Average Order: $${avgOrder.toFixed(2)}`

  GmailApp.sendEmail(recipient, subject, body)
  Logger.log('Weekly report sent!')
},

Triggers: Running Scripts Automatically

Without triggers, scripts only run when you manually click "Run." Triggers make them automatic.

Trigger TypeWhen It RunsUse Case
Time-driven: Every minuteEvery minuteReal-time monitoring
Time-driven: Every 5 minutesEvery 5 minutesEmail checking, webhook processing
Time-driven: HourlyEvery hourReporting, data sync
Time-driven: Daily (9am)Every day at 9amMorning reports
Time-driven: Weekly (Monday)Every MondayWeekly reports
On form submitWhen a Google Form is submittedForm processing
On editWhen a cell changes in a SheetLive data validation
On openWhen a Sheet is openedDashboard refresh

To add a trigger:

  • In Apps Script editor, click the clock icon (Triggers)
  • Click "Add Trigger"
  • Choose your function, event source, and schedule
Read more on Kivora Blog

Read more on Kivora Blog

Get started →