[ { "label": "If an order is still unfulfilled after 2 days, email me", "trigger_type": [ "order_paid" ], "object_type": "order", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": [ { "conditions": [ { "field": "order.delay", "settings": { "wait": "172800", "custom_wait": "" }, "weight": 20 }, { "field": "order.fulfillment_status", "settings": { "operator": "any", "value": { "null": "null", "fulfilled": 0, "partial": 0, "restocked": 0 } }, "weight": 30 } ], "actions": { "1": { "type": "custom", "settings": { "wait": "0", "custom_wait": "", "label": "Check if a product is assigned to location and not fulfilled ", "twig": "{% set locs = RUN_ACTION('shopify_api_request', {\r\n method: \"GET\",\r\n path: \"orders\/\"~order.id~\"\/fulfillment_orders\",\r\n data: {limit: 5}\r\n})%}\r\n\r\n{% for loc in locs.response.fulfillment_orders if loc.assigned_location_id=='65625' %}\r\n{% set locs = RUN_ACTION('email', {\r\n to: shop.email,\r\n subject: \"Unfulfilled order \"~order.name,\r\n body: \"Hi there,<\/br><\/br> Order \"~order.name~\" was created on \"~order.created_at ~\" and still hasn't been fulfilled. <\/br>Link to order:\"~shopify_admin_link(order, {resource: 'orders'})~\"\",\r\n plain_text: false,\r\n context: {order: order}\r\n})%}\r\n{% endfor %}\r\n", "token_object_type": "order" }, "weight": 60, "target_key": "order" } } } ], "shared_workflow_id": 34359 }, "description": "This automation will notify you in case an order from a pre-defined location is unfulfilled after 2 days." } ]