GitHub Actions Schedule vs Cron vs Apps Script Triggers: Which to Use for Scheduled Jobs
Disclosure: I build Pocket Actions, an iPhone app for running workflows manually — not a scheduler. I mention it only in the section on manual runs. Platform facts are from official docs (linked) as of the last-checked date.
The job
You have a small recurring task: fetch some data each morning, send a weekly report, clean up a sheet. Three common places to schedule it:
- GitHub Actions
on: schedule - cron on a server or VPS you run
- Google Apps Script (GAS) time-driven triggers
GitHub Actions schedule
From Events that trigger workflows:
- POSIX cron syntax; shortest interval is every 5 minutes.
- Runs on the latest commit of the default branch only.
- Times are UTC by default; a
timezonekey with an IANA zone is supported. - Shorthands like
@dailyaren't supported. - Can be delayed during high load, especially at the start of every hour; if load is high enough, some queued jobs may be dropped. GitHub suggests picking a different minute.
- In public repositories, scheduled workflows are automatically disabled after 60 days with no repository activity (disable/enable docs).
Cost (billing): standard runners are free in public repos. Private repos use the included amount (GitHub Free: $12/month of compute; Linux 2-core $0.006/min), then billing — or blocked if no payment method.
Good for: anything code-based (Python, Node, CLI tools), secrets in repo settings, logs and failure notifications from GitHub, no server to maintain. Bad for: exact timing, sub-5-minute frequency.
on:
schedule:
- cron: "17 22 * * *" # avoid :00
timezone: "Asia/Tokyo"
workflow_dispatch: # also allow manual runs
Cron on your own server
Classic crontab: minute-level precision, any language, as long as the machine is up.
- Pros: precise timing, every minute if you want, no platform quotas, access to local resources/databases.
- Cons: you maintain the server (updates, uptime, disk, security), failures are silent unless you add monitoring (cron mails output only if mail is configured), and the server costs money even when idle.
Google Apps Script time-driven triggers
From Installable triggers and Quotas:
- Intervals from every minute up to monthly, or a specific date/time.
- Time is slightly randomized: a trigger set for 9 a.m. fires sometime between 9 and 10, then keeps that time.
- 6 minutes max per execution.
- Total trigger runtime: 90 min/day (consumer accounts), 6 hr/day (Google Workspace).
- 20 triggers per user per script.
- On failure, Google emails a summary (frequency configurable).
- Free with a Google account; native access to Sheets, Gmail, Drive, Calendar.
Good for: Google Workspace chores, short jobs, no repo or server. Bad for: long runs, heavy libraries, Python.
Comparison table
Scroll sideways to see the whole table
| GitHub Actions schedule | Server cron | GAS time-driven | |
|---|---|---|---|
| Timing precision | Can be delayed (esp. :00); may drop | Precise | Randomized within the hour |
| Min interval | 5 min | 1 min | 1 min |
| Time zone | UTC default, timezone key | Server's TZ / CRON_TZ (impl-dependent) | Script's time zone |
| Max run length | Job limits (long) | Unlimited | 6 min |
| Languages | Any | Any | JavaScript |
| Cost | Free public / included quota private | Server cost | Free (quotas) |
| Failure alerts | GitHub notifications | DIY | Email summary |
| Maintenance | Workflow file | Whole server | Script only |
| Gotcha | Public repo disabled after 60 inactive days | Server down = no run | 90 min/day trigger total (consumer) |
The same job, set up three ways
To make the comparison concrete, here is one small job — "fetch some data each morning and save a summary" — built on each platform, with the parts people usually forget.
GitHub Actions: a complete scheduled workflow
# .github/workflows/morning.yml
name: Morning summary
on:
schedule:
- cron: "17 22 * * *" # 22:17 UTC; avoid minute 0
workflow_dispatch: # manual run, same job
inputs:
verbose:
type: boolean
default: false
concurrency:
group: morning
cancel-in-progress: false
jobs:
run:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -r requirements.txt
- run: python summary.py
env:
API_KEY: ${{ secrets.API_KEY }}
VERBOSE: ${{ inputs.verbose || false }}
- run: cat summary.md >> "$GITHUB_STEP_SUMMARY"
Notes:
timeout-minutesstops a hung job from burning minutes. The default job limit is much longer, so set your own (workflow syntax).concurrencystops a manual run and a scheduled run from overlapping.$GITHUB_STEP_SUMMARYputs Markdown on the run page, so you can read the result in a browser or GitHub Mobile without opening logs (workflow commands).inputs.verbose || false: on a scheduled run there are no inputs, so give a fallback.- Secrets go in Settings → Secrets and variables → Actions, never in the file.
Converting times: if you don't use the timezone key, write the cron in UTC. 7:17 a.m. in Tokyo (UTC+9) is 17 22 * * * the previous day in UTC.
Server cron: a crontab line that won't bite you
# crontab -e
SHELL=/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin
MAILTO=""
17 7 * * * cd /opt/morning && /usr/bin/flock -n /tmp/morning.lock ./venv/bin/python summary.py >> /var/log/morning.log 2>&1
What each piece prevents (crontab(5)):
PATH: cron runs with a minimal environment, so commands that work in your terminal may not be found. Use absolute paths.cdfirst: relative file paths in your script resolve against the home directory otherwise.flock -n: if yesterday's run is somehow still going, today's exits instead of piling up (flock(1)).- Log redirection: without
MAILTOand a mail setup, output goes nowhere.>> log 2>&1keeps a record. %is special in crontab: it ends the command and starts stdin. Escape it as\%(for example insidedate +\%F).
Time zone handling depends on the cron implementation and system settings; some support CRON_TZ, others don't. Check man 5 crontab on your server.
Apps Script: creating the trigger in code
You can add a time-driven trigger in the editor (the clock icon → Add Trigger), but creating it in code makes it reproducible (ScriptApp ClockTriggerBuilder):
function setupTrigger() {
// Remove old triggers for this handler so you don't end up with duplicates
ScriptApp.getProjectTriggers()
.filter(t => t.getHandlerFunction() === 'morning')
.forEach(t => ScriptApp.deleteTrigger(t));
ScriptApp.newTrigger('morning')
.timeBased()
.atHour(7) // fires sometime in the 7 o'clock hour
.everyDays(1)
.inTimezone('Asia/Tokyo')
.create();
}
function morning() {
const lock = LockService.getScriptLock();
if (!lock.tryLock(1000)) return; // another run is in progress
try {
const key = PropertiesService.getScriptProperties().getProperty('API_KEY');
const res = UrlFetchApp.fetch('https://example.com/data', {
headers: { Authorization: 'Bearer ' + key },
muteHttpExceptions: true,
});
if (res.getResponseCode() !== 200) throw new Error('HTTP ' + res.getResponseCode());
SpreadsheetApp.getActive().getSheetByName('log')
.appendRow([new Date(), res.getContentText().slice(0, 500)]);
} finally {
lock.releaseLock();
}
}
- Run
setupTriggeronce by hand. Running it twice without the cleanup creates two triggers, and the job fires twice. - Keep keys in Script Properties (PropertiesService), not in code.
LockServiceprevents overlap if a manual web-app run and the trigger collide (LockService).- Throwing an error is what makes the failure email fire. If you catch errors and swallow them, Google sees a success.
If a job approaches the 6-minute limit, split it: process a batch, save your position in Script Properties, and let the next trigger continue.
Pitfalls by platform
Scroll sideways to see the whole table
| Symptom | Platform | Cause and fix |
|---|---|---|
| Scheduled run never happens | Actions | Workflow isn't on the default branch, or it was auto-disabled after 60 days of inactivity in a public repo. Re-enable it in the Actions tab |
| Run starts 10–30+ minutes late | Actions | High load around the top of the hour. Move the minute off 0, and don't depend on exact timing (actual delay varies; unconfirmed range) |
| Works in terminal, fails in cron | Cron | Minimal environment: set PATH, use absolute paths, cd first |
| Nothing in logs at all | Cron | No redirection and no mail. Add >> file 2>&1 |
| Job runs twice | GAS | Duplicate triggers. List them under Triggers in the editor and delete extras |
| "Exceeded maximum execution time" | GAS | Over 6 minutes. Batch the work and continue on the next run |
| "Service invoked too many times" | GAS | A daily quota was hit (quotas). Reduce calls or spread them out |
| Inputs are empty on scheduled runs | Actions | Scheduled runs have no inputs. Provide defaults in the expression |
Monitoring, the boring part that matters
- Actions: GitHub can notify you of failed workflow runs (Settings → Notifications → Actions). You can also add a final step with
if: failure()that posts to Slack or another chat tool. - Cron: add a heartbeat. At the end of a successful run, ping a monitoring URL; if the ping doesn't arrive, the monitor alerts you. Without something like this, a dead server is silent.
- GAS: the failure email is on by default for installable triggers; check the notification setting on the trigger if you aren't getting them.
Don't forget manual runs
Schedules miss things: a delayed or dropped Actions run, a randomized GAS time, a server reboot — or you simply want a result now, not at 7 a.m. tomorrow. Giving the same job a manual trigger covers this:
- GitHub Actions: add
workflow_dispatchalongsideschedule; run it from the web,gh workflow run, GitHub Mobile, a Shortcut, or Pocket Actions. - GAS: deploy the function as a web app, then open its URL or call it from a phone (guide).
- Cron: SSH in and run the script (from a phone, via an SSH app — specific apps not reviewed here).
Pocket Actions runs workflow_dispatch workflows and GAS web apps in 1–3 taps. Limits: runs always target main; GAS runs show success even if your script throws; no logs in the app; iOS only; free for 5 runs/day and 17/week.
Three realistic scenarios
"Post yesterday's sales from a spreadsheet to chat at 8 a.m." The data is already in Google Sheets and the job takes seconds. A GAS time-driven trigger is the natural fit: no repository, no server, native Sheets access. The randomized minute rarely matters for a morning report. Add a web-app doGet so you can re-send it by hand when someone asks.
"Scrape three sites, run a Python analysis, commit a CSV." This needs Python packages and may run for several minutes. GitHub Actions schedule fits: pip works, secrets live in the repository, and the CSV can be committed back. Put the cron off the hour, add workflow_dispatch for reruns, and accept that it may start late.
"Poll an internal API every minute and alert if it's down." Minute-level precision, access to an internal network, no tolerance for dropped runs. That points to cron on a machine you control (or a dedicated monitoring service). Neither GitHub's schedule nor GAS is designed for this.
The pattern: choose by where the data lives and how much timing matters, then add a manual trigger to whichever you chose.
One more check before you commit to a platform: who else will maintain this? A GAS project tied to one person's Google account, or a crontab on one person's VPS, is easy to lose track of when that person moves on. A workflow file in a shared repository is at least visible to everyone with access.
Which should you choose?
- Code job, don't care about exact minute, no server: GitHub Actions schedule (+
workflow_dispatch). - Must run at a precise time, or every minute, or needs local resources: server cron.
- Google Sheets/Gmail chores under 6 minutes: GAS time-driven trigger.
- Mostly on demand: skip the schedule; use a manual trigger.
A real example
My stock-evaluation workflow (AI scores stocks I'm curious about) isn't on a schedule at all — I run it manually from my phone when I need it, so I don't burn minutes on days I don't care.
Try it
View Pocket Actions on the App Store
FAQ
Why is my GitHub Actions schedule late?
Scheduled runs can be delayed under high load, especially at the top of the hour, and may be dropped. Use an off-peak minute and add workflow_dispatch for manual runs.
What time zone does GitHub Actions cron use?
UTC by default. You can set a timezone key with an IANA time zone.
Why did my scheduled workflow stop? In public repositories, scheduled workflows are disabled after 60 days without repository activity. Re-enable it in the Actions tab.
Do Apps Script time triggers run at an exact time? No. The time is slightly randomized, e.g. a 9 a.m. trigger runs between 9 and 10.
How long can a GAS triggered function run? Six minutes per execution, with a daily total trigger runtime of 90 minutes on consumer accounts.
Related
- workflow_dispatch vs repository_dispatch vs REST API vs gh CLI
- How to Trigger GitHub Actions from Your iPhone
- Run Google Apps Script from mobile
- Pocket Actions changelog
Last checked: 2026-11-01 (GitHub Docs events and billing; Google Apps Script triggers and quotas; crontab(5)).
