{"id":145,"date":"2026-10-17T14:16:04","date_gmt":"2026-10-17T14:16:04","guid":{"rendered":"http:\/\/plugin-docs.com\/?post_type=doc&#038;p=145"},"modified":"2026-10-18T11:17:39","modified_gmt":"2026-10-18T11:17:39","slug":"trigger-workflows-woocommerce-stock-events","status":"publish","type":"doc","link":"https:\/\/dragwyb.com\/docs\/trigger-workflows-woocommerce-stock-events\/","title":{"rendered":"Trigger Workflows from WooCommerce Stock Events"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The <strong>WooCommerce stock status trigger<\/strong> can start a workflow when a product&#8217;s stock status changes. Use it for notifications or follow-up actions when an item moves between stock states. The trigger responds to status transitions, not every change in stock quantity.<\/p>\n\n\n\n\n<p class=\"wp-block-paragraph\">Screenshot to add: Workflow editor showing Product Stock Status Updated and Product Status Changed trigger options<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Available product status triggers<\/h2>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Product Stock Status Updated:<\/strong> runs when the product stock status changes. Supported stock status values include <code>instock<\/code>, <code>outofstock<\/code>, and <code>onbackorder<\/code>.<\/li>\n\n\n<li><strong>Product Status Updated:<\/strong> runs when the WooCommerce product post status changes, such as to publish, draft, or pending.<\/li>\n\n\n<li><strong>Product Status Changed:<\/strong> combines product post-status and stock-status transitions into one trigger.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Configure a stock status trigger<\/h2>\n\n\n<ol class=\"wp-block-list\">\n<li>Confirm that WooCommerce is active.<\/li>\n\n\n<li>Open <strong>Agent Workflows<\/strong> and edit the workflow.<\/li>\n\n\n<li>Add <strong>Product Stock Status Updated<\/strong> if you only need stock-status transitions, or choose <strong>Product Status Changed<\/strong> if the workflow should also react to product post-status transitions.<\/li>\n\n\n<li>Connect the trigger to a notification or other action and map the product data it needs.<\/li>\n\n\n<li>Save and test with a staging product or another controlled stock-status change. Review the old and new status values before activating the workflow.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Inspect the product payload<\/h2>\n\n\n<p class=\"wp-block-paragraph\">The payload includes <code>source<\/code> (<code>woocommerce<\/code>), <code>event<\/code>, and <code>product_id<\/code>. When the product object is available, it can also include the product name, SKU, product status, stock status, stock quantity, and stock-management settings. A stock transition includes <code>old_stock_status<\/code> and <code>new_stock_status<\/code>; the implementation also provides <code>old_status<\/code> and <code>new_status<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Stock status is not stock quantity<\/h2>\n\n\n<p class=\"wp-block-paragraph\">A quantity update that leaves the stock status unchanged is not the same as a stock-status transition. Use this trigger for state changes such as in stock, out of stock, or on backorder. Test your store&#8217;s stock-management settings before relying on a workflow for inventory alerts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automate actions for supported product stock events.<\/p>\n","protected":false},"author":0,"featured_media":0,"parent":139,"menu_order":0,"template":"","class_list":["post-145","doc","type-doc","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/doc\/145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/doc"}],"about":[{"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/types\/doc"}],"version-history":[{"count":2,"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/doc\/145\/revisions"}],"predecessor-version":[{"id":871,"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/doc\/145\/revisions\/871"}],"up":[{"embeddable":true,"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/doc\/139"}],"wp:attachment":[{"href":"https:\/\/dragwyb.com\/docs\/wp-json\/wp\/v2\/media?parent=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}