Skip to content

Instantly share code, notes, and snippets.

@ceaksan
Last active April 24, 2026 15:23
Show Gist options
  • Select an option

  • Save ceaksan/0eaafc398bda5ca5bd3442f4d68c558d to your computer and use it in GitHub Desktop.

Select an option

Save ceaksan/0eaafc398bda5ca5bd3442f4d68c558d to your computer and use it in GitHub Desktop.
Shopify Flow — B2B Koşullu Hediye Bundle (Tester Signal Setter + Free Gift Auto-Attach). Blog: https://ceaksan.com/tr/shopify-flow-b2b-hediye-otomasyon/
1d17a3adb482f8211eeb7e07fa9fb08ea3ca8c8802284d47f90ecbd5a008bd52:{"__metadata":{"version":0.1},"root":{"steps":[{"step_id":"b06b4e8d-f172-4cc4-92db-0ce72959af9e","step_position":[560,0],"config_field_values":[],"task_id":"shopify::admin::order_paid","task_version":"0.1","task_type":"TRIGGER","description":null,"note":null,"name":null},{"step_id":"73dec430-68ac-420d-997d-6dcd1f3b3754","step_position":[560,180],"config_field_values":[{"config_field_id":"condition","value":"{\"uuid\":\"01KPX2J8SSKBG73SCQ4CBYWF95\",\"lhs\":{\"uuid\":\"01KPX2J8SSY0QQQPDH6H0CQXAN\",\"parent_uuid\":\"01KPX2J8SSKBG73SCQ4CBYWF95\",\"lhs\":{\"uuid\":\"01KPX2J8SSE2GEQG9AX18XQ1W3\",\"parent_uuid\":\"01KPX2J8SSY0QQQPDH6H0CQXAN\",\"value\":\"order.customer.b2bStatus.value\",\"comparison_value_type\":\"EnvironmentValue\",\"full_environment_path\":\"order.customer.b2bStatus.value\"},\"rhs\":{\"uuid\":\"01KPX2J8SSYQV1M9HRBTNWA8HS\",\"parent_uuid\":\"01KPX2J8SSY0QQQPDH6H0CQXAN\",\"value\":\"true\",\"comparison_value_type\":\"LiteralValue\"},\"value_type\":\"EnvironmentScalarDefinition:String\",\"operator\":\"==\",\"operation_type\":\"Comparison\"},\"operator\":\"AND\",\"operation_type\":\"LogicalExpression\"}"}],"task_id":"shopify::flow::condition","task_version":"0.1","task_type":"CONDITION","description":null,"note":null,"name":null},{"step_id":"c2153a74-cf3e-4216-a1a7-290171d0e2a5","step_position":[560,340],"config_field_values":[{"config_field_id":"condition","value":"{\"uuid\":\"01KPX2J8TDR2YW131167G6QY2H\",\"lhs\":{\"uuid\":\"01KPX2J8TDNQAC31W55B5MNM48\",\"parent_uuid\":\"01KPX2J8TDR2YW131167G6QY2H\",\"lhs\":{\"uuid\":\"01KPX2J8TD0M6B7AZ6EBR56STX\",\"parent_uuid\":\"01KPX2J8TDNQAC31W55B5MNM48\",\"value\":\"order.customer.isTester.value\",\"comparison_value_type\":\"EnvironmentValue\",\"full_environment_path\":\"order.customer.isTester.value\"},\"rhs\":{\"uuid\":\"01KPX2J8TD9BGD2F80KEFRD8Z0\",\"parent_uuid\":\"01KPX2J8TDNQAC31W55B5MNM48\",\"value\":\"true\",\"comparison_value_type\":\"LiteralValue\"},\"value_type\":\"EnvironmentScalarDefinition:String\",\"operator\":\"==\",\"operation_type\":\"Comparison\"},\"operator\":\"AND\",\"operation_type\":\"LogicalExpression\"}"}],"task_id":"shopify::flow::condition","task_version":"0.1","task_type":"CONDITION","description":null,"note":null,"name":null},{"step_id":"7ea93cbb-366e-4dde-bb6e-7019479d04a3","step_position":[180,500],"config_field_values":[{"config_field_id":"condition","value":"{\"uuid\":\"01KPX2J8V08T5W1Z30DPK9EBX8\",\"lhs\":{\"uuid\":\"01KPX2J8V0JDEGR4NJMY1T5DC9\",\"parent_uuid\":\"01KPX2J8V08T5W1Z30DPK9EBX8\",\"lhs\":{\"uuid\":\"01KPX2J8V0CHTYMYD3QZES404S\",\"parent_uuid\":\"01KPX2J8V0JDEGR4NJMY1T5DC9\",\"value\":\"order.subtotalPriceSet.shopMoney.amount\",\"comparison_value_type\":\"EnvironmentValue\",\"full_environment_path\":\"order.subtotalPriceSet.shopMoney.amount\"},\"rhs\":{\"uuid\":\"01KPX2J8V07SJK9X3S335P7NBX\",\"parent_uuid\":\"01KPX2J8V0JDEGR4NJMY1T5DC9\",\"value\":\"500.0\",\"comparison_value_type\":\"LiteralValue\"},\"value_type\":\"EnvironmentScalarDefinition:Decimal\",\"operator\":\">=\",\"operation_type\":\"Comparison\"},\"operator\":\"AND\",\"operation_type\":\"LogicalExpression\"}"}],"task_id":"shopify::flow::condition","task_version":"0.1","task_type":"CONDITION","description":null,"note":null,"name":null},{"step_id":"211b7836-8584-4e19-a8b6-2e0172c4541f","step_position":[0,680],"config_field_values":[{"config_field_id":"order_id","value":"{\"value\":\"{{ order.id }}\",\"default_value\":\"order.id\"}"},{"config_field_id":"variant_id","value":"gid://shopify/ProductVariant/47525103304988"},{"config_field_id":"quantity","value":"1"},{"config_field_id":"allow_duplicates","value":"false"},{"config_field_id":"add_for_free","value":"true"},{"config_field_id":"notify_customer","value":"false"},{"config_field_id":"staff_note","value":"B2B hediye: Tester Premium Pack (tier: 500+)"}],"task_id":"shopify::admin::add_order_line_item","task_version":"0.1","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"94acb8c0-c445-4c87-a9d4-7753d92b8f53","step_position":[0,780],"config_field_values":[{"config_field_id":"order_id","value":"{\"value\":\"{{ order.id }}\",\"default_value\":\"order.id\"}"},{"config_field_id":"tags","value":"[\"b2b\", \"b2b-gift-attached\", \"b2b-gift-tester-premium\"]"}],"task_id":"shopify::admin::add_order_tags","task_version":"0.1","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"1b7fa4da-d86f-4ecc-9ddd-11bf0baa121e","step_position":[0,940],"config_field_values":[{"config_field_id":"public_api_key","value":"YOUR_KLAVIYO_PUBLIC_API_KEY"},{"config_field_id":"event","value":"B2B Order"},{"config_field_id":"email","value":"{{order.email}}"},{"config_field_id":"first_name","value":"{{order.customer.firstName}}"},{"config_field_id":"last_name","value":"{{order.customer.lastName}}"},{"config_field_id":"customer_properties","value":""},{"config_field_id":"properties","value":"{\"gift_tier\": \"tester-premium\", \"is_tester\": true}"}],"task_id":"0175dd42-61d3-4d9e-a2c0-a9a37e9f7bb4","task_version":"1.0","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"018de935-8df6-472c-b42f-43709d4cbfb4","step_position":[380,680],"config_field_values":[{"config_field_id":"order_id","value":"{\"value\":\"{{ order.id }}\",\"default_value\":\"order.id\"}"},{"config_field_id":"variant_id","value":"gid://shopify/ProductVariant/47525103337756"},{"config_field_id":"quantity","value":"1"},{"config_field_id":"allow_duplicates","value":"false"},{"config_field_id":"add_for_free","value":"true"},{"config_field_id":"notify_customer","value":"false"},{"config_field_id":"staff_note","value":"B2B hediye: Tester Sample Pack (tier: <500)"}],"task_id":"shopify::admin::add_order_line_item","task_version":"0.1","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"2466a16f-69d0-4dac-8dc1-9cd7136ce889","step_position":[380,780],"config_field_values":[{"config_field_id":"order_id","value":"{\"value\":\"{{ order.id }}\",\"default_value\":\"order.id\"}"},{"config_field_id":"tags","value":"[\"b2b\", \"b2b-gift-attached\", \"b2b-gift-tester-sample\"]"}],"task_id":"shopify::admin::add_order_tags","task_version":"0.1","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"15e25a54-26cd-4801-9327-b2a8558ef529","step_position":[380,940],"config_field_values":[{"config_field_id":"public_api_key","value":"YOUR_KLAVIYO_PUBLIC_API_KEY"},{"config_field_id":"event","value":"B2B Order"},{"config_field_id":"email","value":"{{order.email}}"},{"config_field_id":"first_name","value":"{{order.customer.firstName}}"},{"config_field_id":"last_name","value":"{{order.customer.lastName}}"},{"config_field_id":"customer_properties","value":""},{"config_field_id":"properties","value":"{\"gift_tier\": \"tester-sample\", \"is_tester\": true}"}],"task_id":"0175dd42-61d3-4d9e-a2c0-a9a37e9f7bb4","task_version":"1.0","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"257332b6-a742-4a56-9f3e-2cc58f16f591","step_position":[920,500],"config_field_values":[{"config_field_id":"condition","value":"{\"uuid\":\"01KPX2J8VJMZCZFR35736PMYWN\",\"lhs\":{\"uuid\":\"01KPX2J8VJV53KHVNR5CA1ESS2\",\"parent_uuid\":\"01KPX2J8VJMZCZFR35736PMYWN\",\"lhs\":{\"uuid\":\"01KPX2J8VJYNZ3F0FJ8B3M8EJC\",\"parent_uuid\":\"01KPX2J8VJV53KHVNR5CA1ESS2\",\"value\":\"order.subtotalPriceSet.shopMoney.amount\",\"comparison_value_type\":\"EnvironmentValue\",\"full_environment_path\":\"order.subtotalPriceSet.shopMoney.amount\"},\"rhs\":{\"uuid\":\"01KPX2J8VJ6PWM456MQZSSZ6D7\",\"parent_uuid\":\"01KPX2J8VJV53KHVNR5CA1ESS2\",\"value\":\"500.0\",\"comparison_value_type\":\"LiteralValue\"},\"value_type\":\"EnvironmentScalarDefinition:Decimal\",\"operator\":\">=\",\"operation_type\":\"Comparison\"},\"operator\":\"AND\",\"operation_type\":\"LogicalExpression\"}"}],"task_id":"shopify::flow::condition","task_version":"0.1","task_type":"CONDITION","description":null,"note":null,"name":null},{"step_id":"d8c4d943-014c-4e19-88a8-fed54992be82","step_position":[740,680],"config_field_values":[{"config_field_id":"order_id","value":"{\"value\":\"{{ order.id }}\",\"default_value\":\"order.id\"}"},{"config_field_id":"variant_id","value":"gid://shopify/ProductVariant/47525103370524"},{"config_field_id":"quantity","value":"1"},{"config_field_id":"allow_duplicates","value":"false"},{"config_field_id":"add_for_free","value":"true"},{"config_field_id":"notify_customer","value":"false"},{"config_field_id":"staff_note","value":"B2B hediye: Core Premium Kit (tier: 500+)"}],"task_id":"shopify::admin::add_order_line_item","task_version":"0.1","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"d3bbd133-f729-4302-9f5c-41d335198a5b","step_position":[740,780],"config_field_values":[{"config_field_id":"order_id","value":"{\"value\":\"{{ order.id }}\",\"default_value\":\"order.id\"}"},{"config_field_id":"tags","value":"[\"b2b\", \"b2b-gift-attached\", \"b2b-gift-core-premium\"]"}],"task_id":"shopify::admin::add_order_tags","task_version":"0.1","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"8666123a-3ae8-4aaf-a901-602f853fa548","step_position":[740,940],"config_field_values":[{"config_field_id":"public_api_key","value":"YOUR_KLAVIYO_PUBLIC_API_KEY"},{"config_field_id":"event","value":"B2B Order"},{"config_field_id":"email","value":"{{order.email}}"},{"config_field_id":"first_name","value":"{{order.customer.firstName}}"},{"config_field_id":"last_name","value":"{{order.customer.lastName}}"},{"config_field_id":"customer_properties","value":""},{"config_field_id":"properties","value":"{\"gift_tier\": \"core-premium\", \"is_tester\": false}"}],"task_id":"0175dd42-61d3-4d9e-a2c0-a9a37e9f7bb4","task_version":"1.0","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"a180a4cb-397c-4293-8329-d7d1c487704d","step_position":[1120,680],"config_field_values":[{"config_field_id":"order_id","value":"{\"value\":\"{{ order.id }}\",\"default_value\":\"order.id\"}"},{"config_field_id":"variant_id","value":"gid://shopify/ProductVariant/54061602570524"},{"config_field_id":"quantity","value":"1"},{"config_field_id":"allow_duplicates","value":"false"},{"config_field_id":"add_for_free","value":"true"},{"config_field_id":"notify_customer","value":"false"},{"config_field_id":"staff_note","value":"B2B hediye: Core Entry Kit (tier: <500)"}],"task_id":"shopify::admin::add_order_line_item","task_version":"0.1","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"2e39c15b-b55e-4685-bcc6-8d3c5a9c72e7","step_position":[1120,780],"config_field_values":[{"config_field_id":"order_id","value":"{\"value\":\"{{ order.id }}\",\"default_value\":\"order.id\"}"},{"config_field_id":"tags","value":"[\"b2b\", \"b2b-gift-attached\", \"b2b-gift-core-entry\"]"}],"task_id":"shopify::admin::add_order_tags","task_version":"0.1","task_type":"ACTION","description":null,"note":null,"name":null},{"step_id":"e46e8cd7-3c8e-4cbb-867f-e1faeaa97b7c","step_position":[1120,940],"config_field_values":[{"config_field_id":"public_api_key","value":"YOUR_KLAVIYO_PUBLIC_API_KEY"},{"config_field_id":"event","value":"B2B Order"},{"config_field_id":"email","value":"{{order.email}}"},{"config_field_id":"first_name","value":"{{order.customer.firstName}}"},{"config_field_id":"last_name","value":"{{order.customer.lastName}}"},{"config_field_id":"customer_properties","value":""},{"config_field_id":"properties","value":"{\"gift_tier\": \"core-entry\", \"is_tester\": false}"}],"task_id":"0175dd42-61d3-4d9e-a2c0-a9a37e9f7bb4","task_version":"1.0","task_type":"ACTION","description":null,"note":null,"name":null}],"links":[{"from_step_id":"b06b4e8d-f172-4cc4-92db-0ce72959af9e","from_port_id":"output","to_step_id":"73dec430-68ac-420d-997d-6dcd1f3b3754","to_port_id":"input"},{"from_step_id":"73dec430-68ac-420d-997d-6dcd1f3b3754","from_port_id":"true","to_step_id":"c2153a74-cf3e-4216-a1a7-290171d0e2a5","to_port_id":"input"},{"from_step_id":"c2153a74-cf3e-4216-a1a7-290171d0e2a5","from_port_id":"true","to_step_id":"7ea93cbb-366e-4dde-bb6e-7019479d04a3","to_port_id":"input"},{"from_step_id":"7ea93cbb-366e-4dde-bb6e-7019479d04a3","from_port_id":"true","to_step_id":"211b7836-8584-4e19-a8b6-2e0172c4541f","to_port_id":"input"},{"from_step_id":"211b7836-8584-4e19-a8b6-2e0172c4541f","from_port_id":"output","to_step_id":"94acb8c0-c445-4c87-a9d4-7753d92b8f53","to_port_id":"input"},{"from_step_id":"94acb8c0-c445-4c87-a9d4-7753d92b8f53","from_port_id":"output","to_step_id":"1b7fa4da-d86f-4ecc-9ddd-11bf0baa121e","to_port_id":"input"},{"from_step_id":"7ea93cbb-366e-4dde-bb6e-7019479d04a3","from_port_id":"false","to_step_id":"018de935-8df6-472c-b42f-43709d4cbfb4","to_port_id":"input"},{"from_step_id":"018de935-8df6-472c-b42f-43709d4cbfb4","from_port_id":"output","to_step_id":"2466a16f-69d0-4dac-8dc1-9cd7136ce889","to_port_id":"input"},{"from_step_id":"2466a16f-69d0-4dac-8dc1-9cd7136ce889","from_port_id":"output","to_step_id":"15e25a54-26cd-4801-9327-b2a8558ef529","to_port_id":"input"},{"from_step_id":"c2153a74-cf3e-4216-a1a7-290171d0e2a5","from_port_id":"false","to_step_id":"257332b6-a742-4a56-9f3e-2cc58f16f591","to_port_id":"input"},{"from_step_id":"257332b6-a742-4a56-9f3e-2cc58f16f591","from_port_id":"true","to_step_id":"d8c4d943-014c-4e19-88a8-fed54992be82","to_port_id":"input"},{"from_step_id":"d8c4d943-014c-4e19-88a8-fed54992be82","from_port_id":"output","to_step_id":"d3bbd133-f729-4302-9f5c-41d335198a5b","to_port_id":"input"},{"from_step_id":"d3bbd133-f729-4302-9f5c-41d335198a5b","from_port_id":"output","to_step_id":"8666123a-3ae8-4aaf-a901-602f853fa548","to_port_id":"input"},{"from_step_id":"257332b6-a742-4a56-9f3e-2cc58f16f591","from_port_id":"false","to_step_id":"a180a4cb-397c-4293-8329-d7d1c487704d","to_port_id":"input"},{"from_step_id":"a180a4cb-397c-4293-8329-d7d1c487704d","from_port_id":"output","to_step_id":"2e39c15b-b55e-4685-bcc6-8d3c5a9c72e7","to_port_id":"input"},{"from_step_id":"2e39c15b-b55e-4685-bcc6-8d3c5a9c72e7","from_port_id":"output","to_step_id":"e46e8cd7-3c8e-4cbb-867f-e1faeaa97b7c","to_port_id":"input"}],"patched_fields":[{"id":"7191b21a-1658-4bde-8676-ef7a4543cf43","handle":"b2bStatus","field":"metafield","patched_type":"Customer","arguments":"{\"key\":\"b2b_status\",\"namespace\":\"custom\"}","merchant_configured":true},{"id":"2b23cda3-4263-4da8-8437-c97c3fd7fdd8","handle":"isTester","field":"metafield","patched_type":"Customer","arguments":"{\"key\":\"is_tester\",\"namespace\":\"custom\"}","merchant_configured":true}],"variables":[],"note":null,"vertical_layout_enabled":true,"workflow_name":"B2B Free Gift Auto-Attach"}}
31251393228bdfcb888dd23609d7be50a4d1ccfd74e1cca74675d046f562397a:{"__metadata":{"version":0.1},"root":{"steps":[{"step_id":"50b0c854-61e7-4230-90f0-da11a83dced7","step_position":[0,0],"config_field_values":[],"task_id":"shopify::admin::order_paid","task_version":"0.1","task_type":"TRIGGER","description":null,"note":null,"name":null},{"step_id":"4e213160-9169-4a9a-b3ae-d9aaea2bc288","step_position":[0,180],"config_field_values":[{"config_field_id":"condition","value":"{\"uuid\":\"01KPX1BZNXX7ZWMM4SEHZQ5E1E\",\"lhs\":{\"uuid\":\"01KPX1BZNXJ2ESYA9XMNX5RVPP\",\"parent_uuid\":\"01KPX1BZNXX7ZWMM4SEHZQ5E1E\",\"lhs\":{\"uuid\":\"01KPX1BZNYB4A2RQ4F3Y9AJGG9\",\"parent_uuid\":\"01KPX1BZNXJ2ESYA9XMNX5RVPP\",\"value\":\"order.customer.b2bStatus.value\",\"comparison_value_type\":\"EnvironmentValue\",\"full_environment_path\":\"order.customer.b2bStatus.value\"},\"rhs\":{\"uuid\":\"01KPX1BZNXS0YCZAMTYZD02ZKY\",\"parent_uuid\":\"01KPX1BZNXJ2ESYA9XMNX5RVPP\",\"value\":\"true\",\"comparison_value_type\":\"LiteralValue\"},\"value_type\":\"EnvironmentScalarDefinition:String\",\"operator\":\"==\",\"operation_type\":\"Comparison\"},\"operator\":\"AND\",\"operation_type\":\"LogicalExpression\"}"}],"task_id":"shopify::flow::condition","task_version":"0.1","task_type":"CONDITION","description":null,"note":null,"name":null},{"step_id":"efac71b4-59a3-4001-87fe-ffd48bc666e7","step_position":[0,340],"config_field_values":[{"config_field_id":"condition","value":"{\"uuid\":\"01KPX1BZR98CBCRJBE48232DQ1\",\"lhs\":{\"uuid\":\"01KPX1BZR9570EMMB8FMM2KDQN\",\"parent_uuid\":\"01KPX1BZR98CBCRJBE48232DQ1\",\"array_path\":{\"uuid\":\"01KPX1BZRAF8KXR48YETDWEDRX\",\"parent_uuid\":\"01KPX1BZR9570EMMB8FMM2KDQN\",\"value\":\"order.lineItems\",\"comparison_value_type\":\"EnvironmentValue\",\"full_environment_path\":\"order.lineItems\"},\"array_item_key\":{\"uuid\":\"01KPX1BZRAMK9GMKXBZNX8V2JD\",\"parent_uuid\":\"01KPX1BZR9570EMMB8FMM2KDQN\",\"value\":\"lineItems_item\",\"comparison_value_type\":\"EnvironmentValue\"},\"operation\":{\"uuid\":\"01KPX1BZR9S5K8MXT53GCJDB6K\",\"parent_uuid\":\"01KPX1BZR9570EMMB8FMM2KDQN\",\"lhs\":{\"uuid\":\"01KPX1BZRAC9KX6SAW02DEKPQ3\",\"parent_uuid\":\"01KPX1BZR9S5K8MXT53GCJDB6K\",\"value\":\"lineItems_item.product.id\",\"comparison_value_type\":\"EnvironmentValue\",\"full_environment_path\":\"order.lineItems.product.id\"},\"rhs\":{\"uuid\":\"01KPX1BZRAQAH3XZRY00RQ5MPW\",\"parent_uuid\":\"01KPX1BZR9S5K8MXT53GCJDB6K\",\"value\":\"gid://shopify/Product/8942034583836\",\"comparison_value_type\":\"LiteralValue\"},\"value_type\":\"EnvironmentScalarDefinition:ID\",\"operator\":\"==\",\"operation_type\":\"Comparison\"},\"operator\":\"ANY\",\"operation_type\":\"ArrayExpression\"},\"operator\":\"AND\",\"operation_type\":\"LogicalExpression\"}"}],"task_id":"shopify::flow::condition","task_version":"0.1","task_type":"CONDITION","description":null,"note":null,"name":null},{"step_id":"d253dc2d-dc06-4566-9dc2-461a0871cbb9","step_position":[0,520],"config_field_values":[{"config_field_id":"condition","value":"{\"uuid\":\"01KPX1BZSFPPXJCE0914MYE0AE\",\"lhs\":{\"uuid\":\"01KPX1BZSFM0VGGGNG7XJ6TAVB\",\"parent_uuid\":\"01KPX1BZSFPPXJCE0914MYE0AE\",\"lhs\":{\"uuid\":\"01KPX1BZSF8XPP1NW5WV231TAJ\",\"parent_uuid\":\"01KPX1BZSFM0VGGGNG7XJ6TAVB\",\"value\":\"order.customer.isTester.value\",\"comparison_value_type\":\"EnvironmentValue\",\"full_environment_path\":\"order.customer.isTester.value\"},\"rhs\":{\"uuid\":\"01KPX1BZSFX9RS3T5M6423BJAN\",\"parent_uuid\":\"01KPX1BZSFM0VGGGNG7XJ6TAVB\",\"value\":\"true\",\"comparison_value_type\":\"LiteralValue\"},\"value_type\":\"EnvironmentScalarDefinition:String\",\"operator\":\"!=\",\"operation_type\":\"Comparison\"},\"operator\":\"AND\",\"operation_type\":\"LogicalExpression\"}"}],"task_id":"shopify::flow::condition","task_version":"0.1","task_type":"CONDITION","description":null,"note":null,"name":null},{"step_id":"1b0da63c-8ff5-4a8b-bca4-3b4473525d2f","step_position":[0,680],"config_field_values":[{"config_field_id":"customer_id","value":"{\"value\":\"{{ order.customer.id }}\",\"default_value\":\"order.customer.id\"}"},{"config_field_id":"metafield","value":"{\"namespace\": \"custom\", \"key\": \"is_tester\", \"type\": \"boolean\"}"},{"config_field_id":"value","value":"true"}],"task_id":"shopify::admin::add_customer_metafield","task_version":"1.0","task_type":"ACTION","description":null,"note":null,"name":null}],"links":[{"from_step_id":"50b0c854-61e7-4230-90f0-da11a83dced7","from_port_id":"output","to_step_id":"4e213160-9169-4a9a-b3ae-d9aaea2bc288","to_port_id":"input"},{"from_step_id":"4e213160-9169-4a9a-b3ae-d9aaea2bc288","from_port_id":"true","to_step_id":"efac71b4-59a3-4001-87fe-ffd48bc666e7","to_port_id":"input"},{"from_step_id":"efac71b4-59a3-4001-87fe-ffd48bc666e7","from_port_id":"true","to_step_id":"d253dc2d-dc06-4566-9dc2-461a0871cbb9","to_port_id":"input"},{"from_step_id":"d253dc2d-dc06-4566-9dc2-461a0871cbb9","from_port_id":"true","to_step_id":"1b0da63c-8ff5-4a8b-bca4-3b4473525d2f","to_port_id":"input"}],"patched_fields":[{"id":"c109c0f2-41a0-4b4b-9cbe-38eb2c63232b","handle":"b2bStatus","field":"metafield","patched_type":"Customer","arguments":"{\"key\":\"b2b_status\",\"namespace\":\"custom\"}","merchant_configured":true},{"id":"a97bb89e-1e62-4ba3-bd25-991a639b7683","handle":"isTester","field":"metafield","patched_type":"Customer","arguments":"{\"key\":\"is_tester\",\"namespace\":\"custom\"}","merchant_configured":true}],"variables":[],"note":null,"vertical_layout_enabled":true,"workflow_name":"B2B Tester Signal Setter"}}

Shopify Flow — B2B Koşullu Hediye Bundle

Bu gist iki Shopify Flow workflow export'u içeriyor. İlgili makaleler:

Dosyalar

B2B Tester Signal Setter.flow

Tester ürününü satın alan müşteriyi custom.is_tester = true olarak kalıcı işaretleyen setter workflow'u.

  • Trigger: order_paid
  • Guard zinciri: b2bStatus == truelineItems.any(product.id == <TESTER_PRODUCT_GID>)isTester != true
  • Action: add_customer_metafield custom.is_tester = true

B2B Free Gift Auto-Attach.flow

4 dallı koşullu hediye workflow'u. Tester durumu ve sepet tutarına göre 4 farklı variant'ı ücretsiz ekler.

is_tester subtotal Eklenen variant (örnek GID)
true >= 500 Tester Premium Pack
true < 500 Tester Sample Pack
false >= 500 Core Premium Kit
false < 500 Core Entry Kit

Her dal: add_order_line_item (add_for_free: true) → add_order_tags → Klaviyo Track an event.

İlgili gist'ler (aynı pipeline'ın diğer katmanları)

Flow workflow'ları müşteri context'ini order.customAttributes üzerinden okuyor. Bu context'in kaynağı theme.liquid + custom pixel köprüsü:

Bu iki gist'in tam kuruluş rehberi için Shopify Metafield ile Custom Pixel Arası Köprü makalesi.

Kurulum

1. Customer metafield'larını tanımla

Admin → Settings → Custom data → Customers:

  • custom.b2b_status — Boolean, Admin access
  • custom.is_tester — Boolean, Admin access

Native B2B kullanıyorsan (Companies ve Company Locations üzerinden satıyorsan): custom.b2b_status metafield'ına gerek yok. Flow'da guard'ı order.purchasingEntity.__typename == 'PurchasingCompany' olarak değiştir (Shopify'ın resmi "Tag B2B orders" template'indeki koşulun aynısı). custom.is_tester metafield'ı yine korunmalı; tester ayrımı B2B'den bağımsız bir sinyal.

2. Product metafield'ını tanımla (opsiyonel güvenlik katmanı)

Admin → Settings → Custom data → Products:

  • custom.is_gift_eligible — Boolean

4 hediye product'ına elle true işaretle.

3. Workflow'ları import et

Admin → Flow → Workflows → Import. Her iki .flow dosyasını ayrı ayrı yükle.

4. Placeholder'ları değiştir

Tester Signal Setter'da:

  • Tester ürün GID'si (gid://shopify/Product/<id>) mağazanın tester ürününün gerçek ID'si ile değişmeli.

Free Gift Auto-Attach'ta:

  • 4 variant GID'sini (gid://shopify/ProductVariant/<id>) gerçek hediye variant'larının ID'leri ile değiştir.
  • Klaviyo action'larında public_api_key: "YOUR_KLAVIYO_PUBLIC_API_KEY" placeholder'ını gerçek Klaviyo Public API Key ile değiştir (Klaviyo → Account → Settings → API Keys → Public API Key).

5. Test

Bogus gateway ile test order at; Flow → Activity log'da her workflow'un tetiklendiğini ve action'ların success döndüğünü doğrula.

Plan uyumluluğu

Shopify B2B (Companies + catalogs) artık Basic, Grow, Advanced ve Shopify Plus planlarının tamamında ek ücretsiz geliyor. Plan farkı aktif katalog sayısında: Basic/Grow/Advanced üç aktif katalog, Plus sınırsız + company/location'a doğrudan atama. Flow'un send_http_request ve send_admin_api_request action'ları ise yalnızca Grow, Advanced ve Plus'ta; Basic'te Klaviyo connector alternatifi kullanılabiliyor.

Lisans

MIT. Kullan, değiştir, paylaş. Kaynak belirtmen rica olunur.

Güncelleme takibi

Workflow'ların güncel versiyonu bu gist üzerinde tutulacak. Şema değişiklikleri ilgili makalelerde notlanır.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment