How to schedule a Python script without a server
Cron works well until you realize the script only runs while your laptop is open, or you're paying for a server that does five minutes of work a day. If all you need is "run this Python every morning", you don't need a machine of your own at all. Here are the options, from free and fiddly to managed.
The options at a glance
| Option | Setup | Secrets | When a run fails | Good for |
|---|---|---|---|---|
| GitHub Actions | A YAML file in the repo | Repo secrets | Workflow logs, email to you | Developers who live in GitHub |
| AWS Lambda + EventBridge | Function, IAM role, schedule rule | Environment or Secrets Manager | CloudWatch logs and alarms | Teams already on AWS |
| Google Cloud Run jobs + Cloud Scheduler | Container, job, scheduler entry | Secret Manager | Cloud Logging | Teams already on Google Cloud |
| PythonAnywhere scheduled tasks | Upload the script, pick a time | Environment in the script setup | A log file per task | A single hobby script |
| Callables | A decorator, then push | Set in the web app | Every run saved with logs and result | Scripts a team also runs by hand |
GitHub Actions
If the script is already in a GitHub repo, a workflow file is the quickest free option:
name: Morning report
on:
schedule:
- cron: "0 13 * * 1-5" # 13:00 UTC = 9am New York in summer
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- run: pip install -r requirements.txt
- run: python report.py
env:
API_KEY: ${{ secrets.API_KEY }}The catches: schedules are in UTC only, so daylight saving time shifts your local run time; runs can start late at busy times; scheduled workflows in public repos switch off after 60 days with no activity; and anyone who needs to see the output or start a run needs access to the repo. It's built for CI, so it's fine for a developer's own job and awkward for something the finance team relies on.
Cloud functions with a scheduler
The big clouds can run code on a timer without a server you manage:
- AWS: put the script in a Lambda function and trigger it with an EventBridge Scheduler schedule. Lambda runs stop at 15 minutes.
- Google Cloud: package the script as a Cloud Run job and trigger it from Cloud Scheduler. Jobs can run for much longer than a request.
- Azure: a timer-triggered Azure Function does the same.
These scale to anything and cost very little for a daily job. The cost is setup: packaging dependencies, permissions, a secrets service, and logs in a console your teammates won't open. Worth it if you're already deep in that cloud; heavy for one script.
PythonAnywhere
PythonAnywhere is a hosted Python environment with a Tasks page: upload your script, choose a daily or hourly time, and it runs. It's the simplest of the lot for a single personal script, and there's a free tier with limits on how many tasks you can have. It isn't designed for teams: there's no form for someone else to run the script with their own inputs, and each task's output goes to a log file.
Callables
Callables runs Python functions on a schedule with nothing to host. Write the job as a function with a default for every input:
from callables import deploy
@deploy(title="Morning report", secrets=["API_KEY"])
def morning_report(days: int = 1) -> str:
"""Yesterday's numbers as a short summary."""
...Push the repo, open the function, and click Schedule…: every day, every weekday, every hour or any cron expression, in your own time zone, so 9am stays 9am when the clocks change. Or declare it in code with schedule="0 9 * * 1-5" (UTC).
What you get over the other options:
- Every run is kept, with its inputs, logs and result, in a history the whole team can read.
- Secrets stay out of the code and are never shown to the people running the function. See keeping API keys out of scripts.
- The schedule is also a form. Anyone you share the function with can run it by hand with different inputs, without touching a terminal or the repo.
- You pay for the seconds it runs, not for a server that sits idle. We wrote up moving a real pipeline off a VPS in stop paying for an idle server.
Runs last up to 2 hours on Pro (30 minutes on Hobby), so multi-hour batch jobs belong on Cloud Run or an orchestrator instead.
Which to choose
- One personal script, free: GitHub Actions, or PythonAnywhere if the code isn't on GitHub.
- Already all-in on a cloud: Lambda or Cloud Run with its scheduler.
- A job your team depends on, or also runs by hand: Callables.
For cron, Windows Task Scheduler and the rest of the methods side by side, see how to run a Python script on a schedule.
Turn your scripts into tools your team can run
Add @deploy to a Python function and push. Your team gets a form, schedules and run history.
Keep reading
How to run a Python script on a schedule
Every way to run a Python script on a schedule (cron, Windows Task Scheduler, GitHub Actions, the schedule library and Callables), with examples and when to use each.
CasesStop paying for an idle server to run Python scripts
We moved a Python scraping pipeline off a VPS that sat idle most of the day. Now it runs only when someone starts a step, with no server, SSH or cron to look after.
GuidesHow to run a Python script every hour
Five ways to run a Python script every hour (cron, Task Scheduler, GitHub Actions, a loop with the schedule library, and Callables), plus how to stop runs overlapping or failing silently.
