|Docs

railway cron

View recent runs of a cron service or trigger a run outside its schedule. The command group mirrors the Cron Runs tab in the dashboard.

Usage

railway cron <COMMAND> [OPTIONS]

Subcommands

SubcommandAliasesDescription
listls, runsList recent runs with status, start time, and duration
runtriggerTrigger an off-schedule run of a cron service now

Both subcommands target the linked service by default. Pass --service, --environment, or --project to pick another. The target service must have a cron schedule, either set in the service settings or declared under deploy in a config file. Otherwise the command exits with an error:

Service worker has no cron schedule in environment production

railway cron list

List the most recent runs of a cron service, newest first.

railway cron list [OPTIONS]

Options for

FlagDescription
-s, --service <SERVICE>Service name or ID (defaults to linked service)
-e, --environment <ENV>Environment (defaults to linked environment)
-p, --project <PROJECT>Project ID or name (defaults to linked project)
--limit <N>Maximum number of runs to show (default: 20, max: 1000)
--jsonOutput in JSON format

List recent runs

railway cron list

Output:

Cron runs for worker in production
Schedule: 0 0 * * * (at 00:00), next run in 14 hours

  STARTED                     STATUS        DURATION      DEPLOYMENT
  2026-10-12 02:01:53 +02:00  EXITED        7s            9830309c-4c34-47c5-8841-ddb872e77b07
  2026-10-11 02:02:21 +02:00  EXITED        8s            9830309c-4c34-47c5-8841-ddb872e77b07
  2026-10-10 02:04:19 +02:00  EXITED        9s            9830309c-4c34-47c5-8841-ddb872e77b07

Logs for a run: railway logs -s worker --since 2026-10-12T00:01:53Z --until 2026-10-12T00:02:02Z

Start times are shown in your local time zone. The header describes the schedule in words and shows when the next run is due. A run that is still in progress shows its elapsed time with a so far suffix. A run that was skipped because the previous one was still running shows previous run still running next to the deployment ID.

The last line is a ready-to-run railway logs command for the latest completed run. It uses the run's start and end time, with the end rounded up to the next whole second, so the output covers exactly that run.

List runs for another service

railway cron list --service worker --environment production --limit 50

List runs in JSON format

railway cron list --json

Prints an array of runs, newest first:

[
  {
    "id": "0d3b5e6a-2b6c-4ab0-9d6e-7f1c3a9e2b45",
    "deploymentId": "9830309c-4c34-47c5-8841-ddb872e77b07",
    "status": "EXITED",
    "createdAt": "2026-10-12T00:01:53.000Z",
    "completedAt": "2026-10-12T00:02:01.000Z",
    "durationSeconds": 8,
    "meta": {}
  }
]

durationSeconds and completedAt are null while a run is still in progress. meta holds the deployment metadata recorded for the run.

Useful for scripting:

# Status of the latest run
railway cron list --json --limit 1 | jq -r '.[0].status'

# Fail if any of the last 20 runs crashed
railway cron list --json | jq -e 'all(.status != "CRASHED")'

Run statuses

StatusDescription
EXITEDThe run finished and the process exited
CRASHEDThe run exited with an error
RUNNINGThe run is in progress
SKIPPEDThe run was skipped because the previous run was still in progress
CREATED, INITIALIZING, RESTARTINGThe run is starting up
STOPPED, REMOVED, REMOVINGThe run was stopped or its deployment was removed

See service execution requirements for why runs get skipped.

railway cron run

Trigger an off-schedule run of a cron service. The run shows up in railway cron list alongside scheduled runs.

railway cron run [OPTIONS]

Options for

FlagDescription
-s, --service <SERVICE>Service name or ID (defaults to linked service)
-e, --environment <ENV>Environment (defaults to linked environment)
-p, --project <PROJECT>Project ID or name (defaults to linked project)
-y, --yesSkip confirmation dialog
--jsonOutput in JSON format

Trigger a run

railway cron run

The command asks for confirmation, then enqueues the run:

Cron run enqueued for worker. It can take a few minutes to appear in `railway cron list`.

Skip confirmation

railway cron run --service worker --yes

The command requires --yes when stdout is not a terminal, for example in CI or when piped. Without it, the command exits with an error instead of prompting.

Trigger a run in JSON format

railway cron run --yes --json

Output:

{"success": true}