Does service startup order via Reference Variables work on git push autodeploys?
yuta-hayashi
HOBBYOP

2 months ago

I have two services from the same GitHub repo (AdonisJS + queue worker, but this applies equally to Rails + Sidekiq or any similar web/worker stack):

- Workernode ace queue:work, with preDeployCommand: node ace migration:run --force

- Webnode bin/server.js

I added a Reference Variable in the Web service pointing to Worker:

```

WORKER_DOMAIN=${{Worker.RAILWAY_PRIVATE_DOMAIN}}

```

I saw the Changelog #0213 mentioning that this should enforce startup order, but in practice both services deploy simultaneously on git push — Web starts before migrations are complete.

It is also marked as resolved on this page.

https://station.railway.com/feedback/service-dependencies-rollouts-6b418f05

---

My questions:

1. Is the Reference Variable ordering limited to staged changes only, and not git push autodeploys?

2. For a Migration → Worker → Web deploy pattern, what is the recommended approach on Railway?

3. The solutions I've found so far are:

- GitHub Actions with railway up --service=<id> sequentially — works, but each service builds independently from the same repo, resulting in the same code being built twice

- Pre-built Docker image (e.g. GHCR) shared across both services — solves double build, but loses Railpack and adds CI complexity

Is there a cleaner Railway-native option?

Thanks!

0 Replies

Welcome!

Sign in to your Railway account to join the conversation.

Loading...