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 fs and env, plus familiar Web APIs such as fetch, URL, and console. 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#

  1. Sign in and open the Workbench.
  2. Click Add File and name it hello.js.
  3. Add this line, then click Save:
console.log("Hello from GearTrain!");

2. Create the Job#

  1. Open Jobs and click Create Job.
  2. Select hello.js as the script.
  3. Name the job Hello and enter 0 * * * * as the schedule. That cron expression means “every hour”. See Writing Jobs for more expressions.
  4. 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#