Background workers
Add and manage background commands for Laravel, Symfony Messenger, and Node applications.
Background workers
Open your application's environment, then go to Settings → Services → Workers. Each environment has its own workers, so you can give production and staging different commands or process counts. Strackt can detect Laravel queue workers, Horizon, Symfony Messenger consumers, and Node worker scripts from your repository; you can also add a worker yourself.
Choose a worker
| Worker type | Use it for |
|---|---|
| Queue worker | Laravel jobs handled by php artisan queue:work. Set Processes to the number of jobs you want to run in parallel. |
| Horizon | Laravel queues managed through Horizon. Strackt runs one Horizon process; set Horizon's own worker counts in config/horizon.php. |
| Symfony Messenger consumer | Messages routed to an async transport in config/packages/messenger.yaml. Strackt starts one consumer per process with a distinct MESSENGER_CONSUMER_NAME. If you use Redis, reference that variable in the transport's consumer setting. |
| Node worker | A worker script in package.json, run through the package manager detected for your app. The worker reads the same shared/.env settings as your web process. |
| Custom worker | A background command you enter, such as another Artisan command. Add more than one process only when the command is safe to run in parallel. |
The Add worker menu offers only the types supported by this application. If Messenger is configured in config/packages/messenger.php, Strackt cannot read its routing; add the consumer command in Settings. If a Node queue package has no worker script, add one to package.json or enter the command in Settings.
For BullMQ with Valkey, set its prefix from REDIS_PREFIX in the environment. New Node templates include REDIS_PREFIX=${strackt:valkey.prefix} when Valkey is detected. An existing Node environment with a saved tokenized template does not gain that line automatically; add it in Environment settings before deploying the worker.
Add or change a worker
- Select Add worker in the Workers group, choose a type, enter its command, and set Processes. Horizon is fixed at one process.
- Select Edit on a worker to change its type, command, or process count.
- Use Enable or Disable to control whether it runs. Disabling keeps the entry so you can enable it again later.
You can Remove a custom worker. A detected worker cannot be removed; disable it instead. If you change a detected worker's type or command, it becomes your custom worker, which you can then remove. Changes are pending until they are applied to the server, for example on the next deploy.
What happens during deploy and rollback
After the new version is live, strackt reloads enabled workers so they use that version. A rollback reloads them after the earlier version is live. Horizon finishes its current work before starting on the selected version; the deploy log reports when a worker is still finishing. If a worker is not running after the reload, the deploy log warns you and shows its last output lines. Check those lines and environment logs to diagnose its command or configuration.
Was this helpful?