[ { "label": "Publish to All Sales Channels when in Stock and publish only on the web store when out of stock", "trigger_type": [ "product_updated" ], "object_type": "product", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": { "1": { "conditions": { "1": { "field": "product.inventory_quantity", "settings": { "operator": "gt", "value": "0", "token_object_type": "product", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "product_publish_sales_channels", "settings": { "token_object_type": "product", "sales_channels": { "gid:\/\/shopify\/Publication\/78161936566": "gid:\/\/shopify\/Publication\/78161936566", "gid:\/\/shopify\/Publication\/111404351670": "gid:\/\/shopify\/Publication\/111404351670", "gid:\/\/shopify\/Publication\/111405596854": "gid:\/\/shopify\/Publication\/111405596854" }, "wait": "0", "cw_timezone": "Africa\/Nairobi", "custom_wait": "" }, "weight": 999, "target_key": "product" } } }, "2": { "conditions": { "1": { "field": "product.inventory_quantity", "settings": { "operator": "lte", "value": "0", "token_object_type": "product", "condition_type": "AND" }, "weight": 999 } }, "actions": { "2": { "type": "product_unpublish_sales_channels", "settings": { "token_object_type": "product", "sales_channels": { "gid:\/\/shopify\/Publication\/111404351670": "gid:\/\/shopify\/Publication\/111404351670", "gid:\/\/shopify\/Publication\/111405596854": "gid:\/\/shopify\/Publication\/111405596854", "gid:\/\/shopify\/Publication\/78161936566": 0 }, "wait": "0", "cw_timezone": "Africa\/Nairobi", "custom_wait": "" }, "weight": 1009, "target_key": "product" } } } }, "instructions": "To get started with the workflow, you need to check all the sales channels available on your store in the first group.\r\nIn the second group, tick all the sales channels that need to have the product unpublished.", "shared_workflow_id": 275949 }, "description": "This automation is fired every time a product is updated or sold. It checks if the product is in stock. If in stock and not already published, it publishes the product to all sales channels. If out of stock, it unpublishes the product from all sales channels on the web store. This automation can also be customized based on the specific channel where you wish to publish or unpublish the product depending on the stock levels." } ]