agentleFS
botirkhaltaevbotirkhaltaev/botir-skills/skills/modal-scheduling/SKILL.md

modal-scheduling

Skill4 starsChanged 3 months agoApache-2.0View on GitHub

Schedule recurring and periodic jobs on Modal with Cron and Period. Use when running daily reports, periodic data pipelines, scheduled model retraining, or any time-based automation.

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when scheduling Functions to run automatically at fixed intervals or cron-based schedules.

    line 8
  2. Distinctive:

    Use the "run now" button on the App dashboard to trigger manually

    line 100
  3. Very specific:

    Ensure you used modal deploy, not modal run

    line 112
  4. Distinctive:

    Check the schedule parameter syntax

    line 113
  5. Distinctive:

    Verify the app is visible in the Modal dashboard

    line 114
  6. Distinctive:

    Default timezone is UTC

    line 117
  7. Very specific:

    Use timezone= parameter: Cron("0 8 * * *", timezone="America/New_York")

    line 118
  8. Distinctive:

    Use Cron for deploy-independent schedules

    line 122

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Modal Scheduling

Use this skill when scheduling Functions to run automatically at fixed intervals or cron-based schedules.

When to Use This Skill

  • Running daily/weekly/hourly jobs
  • Scheduling data pipeline runs
  • Periodic model retraining
  • Automated monitoring or reporting
  • Any time-based automation

Quick Start

import modal

app = modal.App()

@app.function(schedule=modal.Period(days=1))
def daily_job():
    print("Running daily task")

Activate with: modal deploy script.py

Schedule Types

Period (interval-based)

Runs at fixed intervals from the time of deployment:

@app.function(schedule=modal.Period(hours=5))
def every_five_hours():
    ...

@app.function(schedule=modal.Period(minutes=30))
def half_hourly():
    ...

Redeployment resets the Period timer.

Cron (cron syntax)

Runs at specific times using cron expressions:

# 8 AM UTC every Monday
@app.function(schedule=modal.Cron("0 8 * * 1"))
def weekly_report():
    ...

# 6 AM New York time daily
@app.function(schedule=modal.Cron("0 6 * * *", timezone="America/New_York"))
def morning_report():
    ...

Cron schedules are not affected by redeployment timing.

Cron Syntax

┌─── minute (0-59)
│ ┌─── hour (0-23)
│ │ ┌─── day of month (1-31)
│ │ │ ┌─── month (1-12)
│ │ │ │ ┌─── day of week (0-7, 0/7=Sunday)
│ │ │ │ │
* * * * *
ExpressionMeaning
0 8 * * *Daily at 8 AM UTC
0 8 * * 1Every Monday at 8 AM UTC
*/15 * * * *Every 15 minutes
0 0 1 * *First day of month at midnight

Deployment

Schedules only activate with modal deploy:

modal deploy --name my-scheduled-app script.py

modal run does NOT activate schedules.

Monitoring

  • Execution logs: modal-observability (modal app logs <app> --since …)
  • Use the "run now" button on the App dashboard to trigger manually
  • Schedules cannot be paused — remove the schedule and redeploy to stop

Go/TypeScript SDK Note

Scheduling (modal.Cron, modal.Period) is Python-only. Go and TypeScript SDKs cannot define schedules.

To trigger Modal Functions on a schedule from Go/TS, use an external scheduler (e.g., cron job, cloud scheduler) that calls fn.Spawn() / fn.spawn().

Symptom Triage

"Schedule doesn't run"

  • Ensure you used modal deploy, not modal run
  • Check the schedule parameter syntax
  • Verify the app is visible in the Modal dashboard

"Cron runs at wrong time"

  • Default timezone is UTC
  • Use timezone= parameter: Cron("0 8 * * *", timezone="America/New_York")

"Period resets after deploy"

  • Expected behavior; Period counts from deployment time
  • Use Cron for deploy-independent schedules

Reference Map

  • references/cron-scheduling.md — Cron/Period details, timezone, monitoring

Related Skills

  • modal-fundamentals — deploy/rollover CLI; schedules require modal deploy
  • modal-observability — dashboard logs for scheduled runs; .get_dashboard_url()
  • modal-parallel-execution — fan-out work from a scheduled entrypoint

Guardrails

  • Schedules only work with modal deploy (not modal run)
  • Period resets on each redeployment; use Cron for stable schedules
  • Cannot pause schedules — remove and redeploy to stop
  • Each scheduled Function runs independently with its own autoscaling

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.