[ { "label": "Tag orders based on the assigned fulfillment location", "trigger_type": [ "order_created" ], "object_type": "order", "app_id": "triggers", "tags": [], "settings": { "priority": 0, "condition_groups": { "1": { "conditions": [], "actions": { "1": { "type": "shopify_api_request", "settings": { "wait": "0", "run_once": 0, "custom_wait": "", "label": "", "method": "GET", "path": "orders\/{{ order.id }}\/fulfillment_orders", "data": "", "response_handle": "handle_response", "response_object_type": "", "parent_data": "", "workflow_actions": [], "token_object_type": "order", "exported_workflow": { "label": "HTTP Response subworkflow", "trigger_type": [ "manual" ], "object_type": "http_response", "app_id": "triggers", "tags": [], "settings": { "priority": 0, "condition_groups": { "1": { "conditions": [], "actions": { "1": { "type": "custom", "settings": { "wait": "0", "custom_wait": "", "label": "Tag order by the products assigned location", "twig": "{% if http_response.success ==1 %}\r\n{% set fulfillment_orders = http_response.json.fulfillment_orders %}\r\n{% set tagss = [] %}\r\n{% for fulfillment_order in fulfillment_orders %}\r\n{% set tagss = tagss|merge([fulfillment_order.assigned_location.name]) %}\r\n{% endfor %}\r\n{% if tagss|length > 0 %}\r\n{% set tagged = QUEUE_ACTION('order_add_tags',{\r\nresource:parent,\r\ntags:tagss\r\n}) %}\r\n{% endif %}\r\n{% endif %}\r\n\r\n", "token_object_type": "http_response" }, "weight": 999, "target_key": "http_response" } } } } } } }, "weight": 999, "target_key": "order" } } } }, "shared_workflow_id": 38625 } } ]