How to Set Up Scheduled Workflows in GitHub Actions in 5 Minutes¶
Target Audience
- Developers who want to automate recurring tasks with GitHub Actions
Key Points¶
- Configure a GitHub Actions
scheduletrigger - Choose between
timezoneand UTC-based scheduling - Avoid delay or dropped jobs during high-load schedule windows
Important 2026 behavior
GitHub Actions schedule now supports IANA time zones alongside cron expressions. You no longer have to convert every local schedule to UTC. Scheduled runs can still be delayed during high-load periods, especially at the start of each hour, and queued jobs may be dropped if load is high enough.
How Scheduled Execution Works¶
GitHub Actions schedule events automatically run workflows at specified times. Internally they use cron expressions, but everything runs on GitHub, so no server setup is required.
The current official behavior has three practical points:
- Scheduled workflows run on the latest commit on the default branch
- The shortest supported interval is once every 5 minutes
- If you omit
timezone, the schedule uses UTC; if you set it, the schedule uses that IANA timezone
Implementation Steps¶
Step 1: Create a Workflow File¶
Create .github/workflows/scheduled-task.yml:
name: Scheduled Task
on:
schedule:
- cron: '17 9 * * *' # Daily at 9:17 AM
timezone: "Asia/Tokyo"
workflow_dispatch: # Enable manual triggering
The example uses minute 17 to avoid the high-load window near the start of each hour. If you prefer UTC-only scheduling, remove the timezone line and set the cron expression in UTC.
Step 2: Add Claude Code Execution Job¶
jobs:
run-claude:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Claude Code
env:
CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
run: |
# Execute automation task with Claude Code
npx claude-code --task "Generate daily report"
Step 3: Push to GitHub to Activate¶
git add .github/workflows/scheduled-task.yml
git commit -m "Add scheduled workflow"
git push origin main
Common Cron Expression Patterns¶
| Schedule | Cron Expression | Japan Time (JST) |
|---|---|---|
| Daily 9:17 AM | 17 9 * * * + timezone: "Asia/Tokyo" | 9:17 |
| Weekdays 9:17 AM | 17 9 * * 1-5 + timezone: "Asia/Tokyo" | 9:17 (Mon-Fri) |
| Monday 9:17 AM | 17 9 * * 1 + timezone: "Asia/Tokyo" | Monday 9:17 |
| 1st of month 9:17 AM | 17 9 1 * * + timezone: "Asia/Tokyo" | 1st 9:17 |
| Every 6 hours | 17 */6 * * * | 00:17, 06:17, 12:17, 18:17 UTC |
If you do not set timezone, GitHub Actions uses UTC. For example, to run at 9:00 JST without timezone, use 0 0 * * * because JST is UTC+9.
Troubleshooting¶
| Symptom | Cause | Solution |
|---|---|---|
| Doesn't run | Incorrect cron syntax | Validate with crontab.guru |
| Time offset | Missing timezone or UTC conversion error | Set timezone: "Asia/Tokyo" or calculate in UTC |
| Delayed near the top of the hour | GitHub Actions high-load window | Avoid minute 0; use minutes such as 17 or 23 |
| Occasionally does not run | Queued job may have been dropped during high load | Keep a manual trigger or retry path for critical work |
| Stops after 60 days | Public repository inactivity | Commit to repository regularly |
Advanced Configuration (Click to Expand)
### Multiple Scheduleson:
schedule:
- cron: '17 9 * * *'
timezone: "Asia/Tokyo"
- cron: '23 12 * * 5'
timezone: "Asia/Tokyo"
jobs:
scheduled-task:
strategy:
matrix:
environment: [dev, staging, prod]
runs-on: ubuntu-latest
steps:
- name: Run for ${{ matrix.environment }}
run: echo "Running for ${{ matrix.environment }}"
- name: Error Notification
if: failure()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Scheduled task failed',
body: 'Check the workflow run for details'
})
Next Steps¶
Official Sources¶
- Workflow syntax for GitHub Actions - on.schedule
- Events that trigger workflows - schedule
- GitHub Changelog: Timezone support for scheduled workflows
This article extracts and organizes GitHub Actions-specific content from multiple legacy cron-related articles.