Orange Collar Media
Orange Collar Media
DOCS
OCMLABS/MODULE-WEBHOOK · INSTALLATION

Installing the Webhooks module and starting the queue consumer

MAGENTO 2.4.7 - 2.4.8 PHP 8.2 - 8.4 LUMA + HYVÄ COMPOSER

Requirements

  • Magento Open Source or Adobe Commerce 2.4.7 - 2.4.8
  • PHP 8.2, 8.3, or 8.4
  • A working Magento cron (bin/magento cron:run scheduled every minute) - the module relies on cron for retries, log pruning, and (by default) running the queue consumer

Install via Composer

Terminal window
composer require ocmlabs/module-webhook
bin/magento module:enable OCMLabs_Webhook
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Adobe Commerce customers instead run composer require ocmlabs/module-webhook-commerce - a metapackage that licenses the module for Adobe Commerce and pulls in ocmlabs/module-webhook automatically. The remaining bin/magento steps are identical.

Verify the installation

Terminal window
bin/magento module:status OCMLabs_Webhook

In the admin panel, navigate to System > OCM Labs > Webhooks. If the menu item is visible, the module installed correctly. Ten disabled sample webhooks - one per curated event, each carrying its default payload template - are installed on first setup so you can start from a working example.

Start the queue consumer - the module does nothing without it

This is the step people miss. Publishing an event to the queue is not delivery: the consumer ocmlabs.webhook.trigger has to actually be running for anything to reach a destination URL. On the default db queue connection there is no broker pushing messages to you. If webhooks save fine but nothing ever arrives, this is why.

There are two supported ways to keep the consumer running - use one, not both:

Option 1: Magento cron (default behavior). If your app/etc/env.php has no cron_consumers_runner key, Magento’s cron starts every registered consumer automatically, including this one. With a working system cron, no extra configuration is needed. To scope it explicitly:

'cron_consumers_runner' => [
'cron_run' => true,
'max_messages' => 10000,
'consumers' => ['ocmlabs.webhook.trigger'],
],

Option 2: process supervisor. Run the consumer as a long-lived daemon under supervisord or similar:

Terminal window
bin/magento queue:consumers:start ocmlabs.webhook.trigger --max-messages=10000

--max-messages makes the process exit periodically so the supervisor can restart it, avoiding unbounded memory growth in long-running PHP processes.

Grant admin access

The module registers three ACL resources under System > Permissions > User Roles:

  • OCMLabs_Webhook::manage - create, edit, enable/disable webhooks (with a separate delete child resource)
  • OCMLabs_Webhook::log - view the delivery log
  • OCMLabs_Webhook::config - change module configuration

Create your first webhook

  1. Go to System > OCM Labs > Webhooks and click Add New Webhook.
  2. Name it, pick an event (for example “Order Placed”), and choose the store views it should fire for.
  3. Enter your destination URL. Optionally set a secret (enables HMAC signing) and authentication.
  4. Adjust the prefilled payload template if needed - the “Available Template Variables” panel below the editor documents everything you can reference.
  5. Click Send Test to deliver a sample payload synchronously and see the response, then Save Webhook.

Trigger the real event (place an order) and watch it arrive in System > OCM Labs > Delivery Log.

Production notes

Payload logging (Stores > Configuration > OCM Labs > Webhooks > General > Log Payloads) is off by default so potentially sensitive request bodies are not stored in the log table - enable it only while debugging. The Advanced flags “Allow Private Networks” and “Allow Insecure URL (HTTP)” are development conveniences; leave them off in production so the SSRF guard stays meaningful.