[ { "label": "Automatically Fulfill Products of a Certain Type (Shopify API)", "trigger_type": [ "order_paid" ], "object_type": "order", "app_id": "triggers", "settings": { "condition_groups": { "1": { "conditions": [], "actions": { "3": { "type": "debug", "settings": { "wait": "0", "custom_wait": "", "action_label": "Print Inventory By Location Data (Needed for Subworkflow Configuration)", "title": "", "body": "{% for line_item in order.line_items %}\r\n Inventory Item ID: {{ line_item.variant.inventory_item_id }} \r\n Product Title: {{ line_item.title }} - {{ line_item.variant_title }} \r\n Product URL: {{ line_item.product.admin_url }}\r\n{% for location in shop.locations %}\r\n**************************************\r\n Location ID: {{ location.id }}\r\n Location Name: {{ location.name}} \r\n Quantity Available: {{ line_item.product.inventory_quantity_by_location[location.id] }}\r\n{% endfor %}\r\n{% endfor %}", "token_object_type": "order" }, "weight": 10, "target_key": "order" }, "2": { "type": "trigger_child_workflow", "settings": { "wait": "0", "custom_wait": "", "target_path": "order.line_items", "token_object_type": "order", "exported_workflow": { "label": "Line Item subworkflow", "trigger_type": [ "manual" ], "object_type": "line_item", "app_id": "triggers", "settings": { "condition_groups": { "1": { "conditions": { "1": { "field": "line_item.product.product_type", "settings": { "operator": "equals_one", "value": "", "long_value": "THIS TYPE\r\nTHAT TYPE", "token_browser": "{{ Browse Tokens }}", "token_object_type": "line_item", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "shopify_api_request", "settings": { "wait": "0", "custom_wait": "", "label": "fulfill item", "method": "POST", "path": "orders\/{{ line_item.order.id }}\/fulfillments", "data": "{\r\n \"fulfillment\": {\r\n \"location_id\": INSERT YOUR LOCATION,\r\n \"notify_customer\": false,\r\n \"tracking_number\": null,\r\n \"line_items\": [\r\n {\r\n \"id\": {{ line_item.id }}\r\n }\r\n ]\r\n }\r\n}", "response_handle": "", "response_object_type": "", "parent_data": "", "workflow_actions": [], "token_object_type": "line_item" }, "weight": 999, "target_key": "line_item" } } } } } } }, "weight": 20, "target_key": "order" } } } }, "shared_workflow_id": 16443 } } ]