2 months ago
We have four Production cron services connected to a GitHub repository.
Each service has:
a GitHub source;
a Production deployment trigger;
a Start Command that performs a one-shot production job;
a Railway cron schedule.
The services currently have no initial successful/ready deployment revision. Railway therefore skips cron execution with:
Cron skipped: no running container and the deployment did not become ready
We need to create the initial deployable revision/image, but we must not execute the Start Command outside its scheduled cron time.
Please confirm the officially supported Railway procedure for initializing/building the first deployable revision of a cron service without immediately executing its Start Command.
Specifically:
Does Deploy Latest Commit immediately execute the cron service's Start Command, or only build/create the deployment that the scheduler later executes?
Does a normal GitHub autodeploy to a service with a cron schedule execute its Start Command immediately, or does Railway build/deploy it and wait until the cron schedule?
What is the supported method for creating the initial ready revision for a cron service without running the production job?
Should a Railway cron service ever have a continuously running container, or should Railway start the container only at scheduled execution time?
Our commands include jobs that send emails, modify stored data, synchronize external services, and refresh OAuth tokens, so we cannot safely test by executing them outside their schedules.
We do not want a workaround. We need the intended Railway cron-service deployment lifecycle.
1 Replies
2 months ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 2 months ago
2 months ago
Railway will only execute Start Command on the given schedule, so when you deploy, Railway will build the image first and execute it on schedule
Cron service is expected to run a task and exit as soon as the task finished
More info can be found here: