Google Drive to Slack: Get Alerts for New Files Free (Apps Script)

Google Drive to Slack alerts for new files: a free Apps Script that posts to a Slack webhook. Slack's own Drive app cannot do it. Checked 27 October 2026.

By Archit Tamrakar · LinkedIn · · 6 min read

Slack's Google Drive app does not alert you when a file is added to a folder. It only sends notifications for comments, access requests and files shared with you. A free Google Apps Script that checks one folder every 10 minutes and posts to a Slack Incoming Webhook fills that gap, and it runs well inside Google's consumer quotas.

Does the Google Drive app for Slack send alerts for new files?

No. The Google Drive app for Slack covers comments, access requests and shared files. Files you add through the app are searchable in Slack, but they stay in Google Drive.

Event in Google DriveCovered by Slack's Google Drive app?
Someone comments on your fileYes
Someone requests access to your fileYes
A file is shared with youYes
A new file is added to one folderNo

The script in this guide covers only the last row. If you want a broader Drive-to-Slack workflow, the Gmail attachments to Google Drive guide covers the reverse habit of filing incoming items into Drive.

How do you create a Slack webhook for the alert channel?

Create a small Slack app, turn on Incoming Webhooks, and copy the URL that Slack gives you. Slack posts any message sent to that URL into the channel you pick. Slack's incoming webhook guide describes these steps, and the Svix guide and Sheetgo walkthrough match them.

  1. Open https://api.slack.com/apps and click Create an app.
  2. Enter an app name, choose your workspace, and click Create.
  3. In the sidebar, click Features > Incoming Webhooks and switch Activate Incoming Webhooks on.
  4. Click Add New Webhook to Workspace, choose the channel, and click Authorize.
  5. Copy the webhook URL. You will store it in the script in the next section.

Treat that URL like a password. Anyone who has it can post into the channel. The DEV Community guide to secrets in Apps Script recommends keeping such values in PropertiesService rather than in the code.

How do you write the Apps Script that checks the folder?

Create a new Apps Script project, then save the webhook URL as a script property. In the Apps Script editor, open Project Settings (the gear icon), scroll to Script properties, and click Add script property. Set the property to SLACK_WEBHOOK_URL and the value to your webhook URL.

Paste the code below into the script editor. Replace PASTE_FOLDER_ID_HERE with the folder ID, which is the last part of the folder's address after /folders/.

// Folder ID: the last part of the folder's URL after /folders/
const FOLDER_ID = 'PASTE_FOLDER_ID_HERE';

function checkFolderForNewFiles() {
  const props = PropertiesService.getScriptProperties();
  const webhookUrl = props.getProperty('SLACK_WEBHOOK_URL');
  if (!webhookUrl) {
    throw new Error('Add the SLACK_WEBHOOK_URL script property first.');
  }

  // Capture the clock before listing, so files added during this run are caught next time.
  const now = Date.now();
  // First run: start the clock now, so existing files are not announced.
  const lastCheck = Number(props.getProperty('LAST_CHECK_MS')) || now;

  const files = DriveApp.getFolderById(FOLDER_ID).getFiles();
  while (files.hasNext()) {
    const file = files.next();
    if (file.getDateCreated().getTime() <= lastCheck) continue;

    const owner = file.getOwner();
    const who = owner ? owner.getEmail() : 'unknown';
    sendSlackMessage(webhookUrl, 'New file in Drive: *' + file.getName() + '*\n'
      + 'Created by ' + who + '\n' + file.getUrl());
  }

  props.setProperty('LAST_CHECK_MS', String(now));
}

function sendSlackMessage(webhookUrl, text) {
  const response = UrlFetchApp.fetch(webhookUrl, {
    method: 'post',
    contentType: 'application/json',
    payload: JSON.stringify({ text: text }),
    muteHttpExceptions: true,
  });
  if (response.getResponseCode() !== 200) {
    console.error('Slack returned ' + response.getResponseCode() + ': ' + response.getContentText());
  }
}

The script saves the time of its last run, not a list of file IDs. A single timestamp stays small no matter how many files the folder holds. On the first run, the script only records the time and posts nothing.

How often should the script run?

Add a time-driven trigger that runs the function every 10 minutes. Verify this step: the menu may differ. In the Apps Script editor, open Triggers (the clock icon), click Add Trigger, choose checkFolderForNewFiles, set the event source to Time-driven, and pick Every 10 minutes.

Simple triggers, such as a plain onEdit function, cannot run for longer than 30 seconds. A time-driven trigger is the right type for a folder check. At 10 minutes the trigger runs 144 times a day. If each run takes 10 seconds, those runs use 24 minutes of the 90-minute daily trigger budget. Choosing every 5 minutes doubles the runs to 288 and uses 48 minutes at the same run time.

Which method should you choose?

Use the Apps Script method if you want a folder-level alert for free and can paste a script. Use a no-code connector if you need the alert but do not want to maintain code.

MethodCostAlerts on new files in one folder?LimitsBest for
Slack's Google Drive appInstalled from SlackNoComments, access requests and shares onlyPersonal file activity
Apps Script and Slack webhook (this guide)Apps Script: free. Webhook: check your Slack planYes, about every 10 minutesGoogle consumer quotas, listed belowTeams comfortable pasting and checking a script
Zapier or IFTTTCheck each vendor's pricing pageYes, through prebuilt workflows (Zapier, IFTTT)Set by the vendorPeople who want no code

For the spreadsheet direction, the Slack to Google Sheets logging guide covers the opposite flow.

What's free and what costs money?

The Apps Script side costs nothing. MageSheet says Google Apps Script has no licence, no seat cost and no per-execution charge. The practical limits are the quotas. Last checked 27 October 2026, the Google quotas page lists these for consumer accounts:

Quota (consumer account)Limit
Runtime per script execution6 minutes
Trigger runtime per day90 minutes
UrlFetch calls per day20,000
Triggers per user per script20, according to SaaS Glue
Simultaneous executions per user30, according to SaaS Glue

The UrlFetch cap allows 20,000 Slack posts a day, which is one per new file. You cannot buy past most of these limits, according to MageSheet. The quotas above apply to consumer accounts only.

What can go wrong with a Drive-to-Slack Apps Script alert?

  • Alerts arrive late. A 10-minute trigger can take up to about 10 minutes to fire, and ModelMonkey reports that triggers can be delayed by several minutes under load.
  • Moved files are skipped. The script checks creation dates. A file moved into the folder keeps its original date and gets no alert. Upload new files directly into the folder.
  • Large folders can time out. Each run reads every file in the folder. Google's limit is 6 minutes per run, so a very large folder can stop before it finishes. Split the folder if this happens.
  • Errors can repeat alerts. The last-check time is saved only after a run completes. If a run stops with an error partway through, the next run can post the same files again.
  • The script loses memory between runs. FolderPal describes Apps Script as a stateless environment. That is why the script keeps its timestamp in script properties.
  • The webhook URL leaks. If the URL appears in a shared sheet or public code, anyone can post to the channel. Rotate it by removing the webhook in the Slack app and creating a new one.

What's still unclear?

  • Slack's Drive app scope. Slack's help article lists comments, access requests and shares as the automatic notifications. It does not list a folder-level option, and this guide does not predict whether one will arrive.
  • Preview images. According to a 2023 Hacker News discussion, the Drive app for Slack can show a preview of a document's first page to people who do not have access to the document. Check this before you share sensitive folders through Slack.
  • Owner emails in alerts. The script posts the file owner's email address into the channel. Remove the Created by line if the channel is wider than your team.
  • Workspace accounts. This guide quotes consumer-account limits only. Google Workspace accounts have different quotas, and the figures above do not apply to them.
  • Weakest point. The alert is only as fast as the trigger. A 10-minute interval is a trade-off between timeliness and quota use, and a real-time alert is not something Apps Script promises.

Last checked: 27 October 2026.

Frequently asked questions

Can Slack's Google Drive app alert me when a new file is added to a folder?

No. According to Slack's help article, the Google Drive app notifies you about comments on your files, access requests and files shared with you. It does not send notifications for new files added to a specific folder. The Apps Script method in this guide fills that gap.

Is the Apps Script method free?

Google Apps Script has no licence, seat cost or per-execution charge, according to MageSheet. Consumer accounts still have quotas: 6 minutes per run, 90 minutes of trigger time per day and 20,000 UrlFetch calls per day, as of 27 October 2026. A trigger that runs every 10 minutes uses far less than those limits.

How quickly do the alerts arrive?

Within about 10 minutes with the trigger in this guide, plus any delay. ModelMonkey reports that Apps Script triggers can be delayed by several minutes under load, so real-time alerts are not guaranteed.

Will files moved into the folder trigger an alert?

No. The script compares each file's creation date with the time of the last run. A file moved into the folder keeps its original creation date, so the script skips it. Upload new files directly into the folder to get an alert.

Where should I keep the Slack webhook URL?

Store it in script properties as SLACK_WEBHOOK_URL, not in the code. Anyone with the webhook URL can post messages to the channel, so do not paste it into shared documents or public code.

Sources

  1. Google Drive for Slack, Slack Help Center (2026-10-27)
  2. Quotas for Google Services (Apps Script), Google for Developers (2026-09-03)
  3. Apps Script triggers, Google for Developers (2026-09-03)
  4. How to get a Slack webhook URL, Svix (2026-10-09)
  5. How to create a Slack webhook URL, MagicBell (2026-03-25)
  6. Send Slack notifications from Google Sheets, Sheetgo (2026-10-27)
  7. Google Apps Script pricing, MageSheet (2026-09-16)
  8. Google Apps Script limitations, ModelMonkey (2026-07-11)
  9. Google Apps Script quotas and workarounds for Drive automation, SaaS Glue (2026-01-15)
  10. Secure secrets in Google Apps Script, DEV Community (2025-12-19)
  11. Get Slack notifications for new Google Drive files in a folder, Zapier (2026-10-27)
  12. Alert team in Slack when Google Drive adds a file, IFTTT (2026-10-27)