Is it necessary to give 'worker' information in Procfile? If yes then what it is actually? I have already added web: node server/server.js
detail in the Procfile
.

- 4,271
- 8
- 34
- 56

- 1,028
- 1
- 8
- 23
3 Answers
Procfile is a mechanism for declaring what commands are run by your application’s dynos on the Heroku platform.
From Process Types and the Procfile, which is a good introduction, but basically you use the Procfile to tell Heroku how to run various pieces of your app. The part to the left of the colon on each line is the process type; the part on the right is the command to run to start that process.
Process types can be anything, although web
is special, as Heroku will route HTTP requests to processes started with the web
name. Other processes, such as background workers, can be named anything, and you can use the Heroku toolbelt to start or stop those processes by referring to its name.
So, in short, worker
is not necessary, unless you want to run some other process in the background by controlling process with the heroku ps
command.

- 157,729
- 40
- 374
- 311
-
7http://blog.daviddollar.org/2011/05/06/introducing-foreman.html This too, is a nice introduction to the subject. – Kashyap Apr 21 '13 at 06:10
-
2@Kashyap Good call. It's worth noting that the Heroku Toolbelt will install Foreman locally so you can use the same Procfile to run your own apps in development. – Michelle Tilley Apr 21 '13 at 06:18
-
Hey guys, actually I am getting one error and I posted it here - It would be great if you can have a look into this. I scratched my head to solve this but failed. http://stackoverflow.com/questions/16129625/getting-error-while-running-command-heroku-psscale-worker-1-error – Maulik Suchak Apr 21 '13 at 09:17
-
1`Procfile`s are to configure `foreman`, right? So technically you could run `foreman` anywhere, not just on Heroku? – Sergey Orshanskiy Jun 06 '14 at 19:11
-
Thanks for for `Other processes, such as background workers, can be named anything` - facts like these are important but often overlooked – grokpot Jan 08 '15 at 22:06
You would only need a 'worker' entry in your Procfile
if you plan on using some sort of background job system (i.e. queuing long running tasks for later). Heroku has more information here:

- 37,288
- 33
- 152
- 232
-
3Also, the name "worker" is arbitrary. You can name them whatever you want in your procfile; "worker", "emailer", "sidekiq", "ladygaga_twitter_feed_watcher". This allows you to manage each type independently ($ heroku ps:scale emailer=2). In fact, if there are multiple "worker" types in a procfile, only the one listed last will be used. – Patrick Jan 06 '15 at 20:55
-
@Patrick For sure. I believe Heroku sets up some defaults to worker (for Rails apps it might run `rake jobs:work`) but other than that the name is for the user. – Kevin Sylvestre Jan 06 '15 at 20:58
I was following Udemy course regarding nestjs and aws Elastic Beanstalk to deploy however it keeps failing to deploy until I created Procfile with following:
web: npm install && npm run-script build && npm run-script start:prod

- 41
- 5