Skip to content

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

  1. Configure a GitHub Actions schedule trigger
  2. Choose between timezone and UTC-based scheduling
  3. 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

ScheduleCron ExpressionJapan Time (JST)
Daily 9:17 AM17 9 * * * + timezone: "Asia/Tokyo"9:17
Weekdays 9:17 AM17 9 * * 1-5 + timezone: "Asia/Tokyo"9:17 (Mon-Fri)
Monday 9:17 AM17 9 * * 1 + timezone: "Asia/Tokyo"Monday 9:17
1st of month 9:17 AM17 9 1 * * + timezone: "Asia/Tokyo"1st 9:17
Every 6 hours17 */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

SymptomCauseSolution
Doesn't runIncorrect cron syntaxValidate with crontab.guru
Time offsetMissing timezone or UTC conversion errorSet timezone: "Asia/Tokyo" or calculate in UTC
Delayed near the top of the hourGitHub Actions high-load windowAvoid minute 0; use minutes such as 17 or 23
Occasionally does not runQueued job may have been dropped during high loadKeep a manual trigger or retry path for critical work
Stops after 60 daysPublic repository inactivityCommit to repository regularly
Advanced Configuration (Click to Expand) ### Multiple Schedules
on:
  schedule:
    - cron: '17 9 * * *'
      timezone: "Asia/Tokyo"
    - cron: '23 12 * * 5'
      timezone: "Asia/Tokyo"
### Environment-Specific Execution
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 }}"
### Add Error Notifications
- 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


This article extracts and organizes GitHub Actions-specific content from multiple legacy cron-related articles.