All systems operational
Cloudphere
← Documentation

Background workers and schedulers

A worker runs your app's code without a web address: a queue worker, a scheduler, or a WebSocket server. It deploys from the same repository as its service and shares its variables.

Add a worker

  1. Connect the service to GitHub first. The worker deploys from the same repository and branch.
  2. On the service, choose Add worker.
  3. Give it a name and a start command, then create it. It builds and starts on its own.

Common start commands

Laravel queue
php artisan queue:work --tries=3
Laravel scheduler
php artisan schedule:work. Runs everything in your schedule, every minute.
Laravel Horizon
php artisan horizon. Only if laravel/horizon is installed and the queue uses Redis.
Laravel Reverb
php artisan reverb:start --host=0.0.0.0 --port=8080
Node.js
Your script, for example node worker.js or npm run worker.
Celery
celery -A app worker

Without a scheduler worker (or a cron job), scheduled tasks in your code never run.

Change the start command

Open the worker's Service settings, edit Start command, and choose Save and redeploy. The worker redeploys with the new command and Deployment Center shows the result. A stopped worker uses it when you start it.

How workers behave

Plan limits

Workers added from a service don't count towards your plan's web services. Each plan includes a number of workers: Starter 2, Business 4, Scale 8.