Menu

StackMachine
    Schedule jobs

    Set a schedule.
    The job runs itself.

    Run a command in your app's environment or call one of its HTTP paths on a cron schedule. Create, pause, reschedule, and delete jobs from the same SDK.

    Pick a time. The job runs on its own.

    An agent sets a schedule. The job waits until the time comes, then runs and finishes.

    An illustration, with example data.

    Powering products and agents at

    Wasmer logo
    Simply Static logo
    Tiiny logo
    Manus logo
    ModularDS logo
    Commands or HTTP calls
    Run a command in the app's environment, or fetch a path on the app and check the status code that comes back.
    Plain cron syntax
    Give each job a name and a cron expression. Change the schedule whenever you need to.
    Pause without deleting
    Disable a job to stop its runs and enable it again later. Its configuration stays as it was.

    Name it. Schedule it.
    Point it at the work.

    Create a job with a name, a cron schedule, and exactly one target: a command to execute or a path to fetch.

    Shell
    $ npm install stackmachine

    Read the docs

    schedule.js
    import StackMachine from "stackmachine";
    
    const client = new StackMachine(process.env.STACKMACHINE_API_KEY);
    
    const cleanup = await client.apps.cronjobs.create({
      app: "da_XYZ",
      name: "cleanup",
      schedule: "0 2 * * *",
      execute: { command: "python cleanup.py" },
    });
    
    const healthcheck = await client.apps.cronjobs.create({
      app: "da_XYZ",
      name: "healthcheck",
      schedule: "*/5 * * * *",
      fetch: { path: "/health", method: "GET" },
    });

    From a nightly cleanup
    to a health check.

    Recurring backend work, kept next to the app it belongs to.

    Two kinds of target

    An execute job runs a command with its own environment variables. A fetch job calls a path with the method you choose and the status codes you expect.

    EXECUTE0 2 * * *

    $ python cleanup.py

    FETCH*/5 * * * *

    GET /healthreturns200

    Retries, drift, and timeouts

    Set how many times a run retries, how far it may drift from its schedule, and how long it may take.

    cleanupEnabled
    Schedule
    0 2 * * *
    Retries
    3
    Maximum drift
    5 min
    Timeout
    60 s

    A few things
    to know.

    More in the documentation.

    Either a command inside the app's environment or an HTTP request to a path on the app. The kind is fixed when the job is created.

    Start with your first job.

    One API key for hosting, storage, databases, email, and cron.