Getting Started#
GearTrain runs your JavaScript on a schedule. You write a script, give it a cron expression, and GearTrain executes it on time, with a live console, run history, and a built-in file system. This guide gets you from an empty account to your first completed run.
What Is GearTrain?#
GearTrain is a platform for running scheduled scripts written in JavaScript. A job pairs one of your scripts with a schedule. When the schedule fires, GearTrain runs the script and records the run: its console output, its status, and how long it took.
You manage everything through the web interface: scripts live in the workbench, jobs are listed under Jobs, and every execution shows up under Runs.
Common Uses#
GearTrain is meant for scripts that run on a schedule, do their work, and finish:
- Reports and digests. Collect data on a rhythm and deliver a summary where your team reads it.
- Syncs and backups. Move data between services on a schedule.
- Checks and alerts. Watch an endpoint, a price, or an inbox, and notify when something changes.
- Cleanup. Prune old files or stale records so things stay tidy.
Write jobs that fit the model: a job is a short-lived task that ends on its own, not a long-running service. And keep jobs appropriate for what GearTrain is: respect the services your scripts call, stay within the plan limits described in The Sandbox, and use the platform only for lawful purposes.
Philosophy: Simplicity and Ease#
GearTrain is built on two ideas: simplicity and ease.
- One concept. Everything you build is a script with a schedule. There are no build steps, no configuration files, and no deployment pipeline. You write a file, pick a schedule, and you are done.
- Everything in one place. Writing, scheduling, running, and debugging all happen in the same interface.
What Makes GearTrain Different?#
- A built-in file system. Your account comes with a persistent file system. Scripts and the files your jobs create live in it, and files survive between runs. See The Sandbox.
- A curated standard library. Scripts can use modules like
fsandenv, plus familiar Web APIs such asfetch,URL, andconsole. See the API Reference for the full list. - No module system. There are no packages to install. Scripts use only the built-in modules, Web APIs, and your own files. See The Sandbox.
Create Your First Job#
This walkthrough creates a job that runs every hour and logs a message.
1. Write a Script#
- Sign in and open the Workbench.
- Click Add File and name it
hello.js. - Add this line, then click Save:
console.log("Hello from GearTrain!");
2. Create the Job#
- Open Jobs and click Create Job.
- Select
hello.jsas the script. - Name the job
Helloand enter0 * * * *as the schedule. That cron expression means “every hour”. See Writing Jobs for more expressions. - Click Create Job.
3. Run It Now#
You do not have to wait for the schedule. Click Run now on the job to start a run immediately, then open the run to watch its console. You should see your log line appear live.
4. Check the History#
Every execution, scheduled or manual, is listed under Runs with its status, duration, and console output. See Running and Debugging for the details.
Where To Go Next#
- Writing Jobs: scripts, file layout, and cron scheduling
- Running and Debugging: the live console, run history, and how failures are retried
- Secrets and Environment Variables: configuration values for your jobs
- The Sandbox: what your scripts can use
- Best Practices: patterns for reliable jobs