What's your biggest current challenge? Have your say in Community Polls along the right column.

How can I automate product taxonomy with Flow based on category?

Solved

How can I automate product taxonomy with Flow based on category?

Vault_Ally
Tourist
7 1 2

We use a third-party inventory system that is synced with Shopify to list our product. Recently, we were told to fill out things like Age, Gender, color, and other metadata information that does not carry over from our third-party system. Doing this via Bulk Edit is too time-consuming for the volume we work with (and how many people we have), so I'm looking at Flow to automate as much as we can.

 

Basically, the entire flow will (hoepfully) work like this (The bolded/underlined section is already done and works)

  1. Create a Product (third-party system pushes item to shopify and lists it)
  2. Shopify identifies if product has image (sometimes we send draft orders without attaching images)
  3. If product has images, publish to Store, Facebook, Tiktok, Etc.
  4. Check the product information (Brand Name, Color, and Category/Product Type (ie. Totes, Shoulder Bags, Scarves, Etc)
  5. Assign the correct Shopify Taxonomy category based on our Product Type (I'm assuming?) (Metadata)
  6. Assign the proper color based on the color we provide (metadata)
  7. Automatically list everything as Adult and Women (metadata)

Right now, I'm focusing on having it automatically assigning the correct category as the first step. So if our product type/category is Crossbody Bags, then it will automatically fulfill the Taxonomy under gid://shopify/TaxonomyCategory/aa-5-4 (which is Handbags). 

 

So, I guess my question is how the heck do I do this??? Do I have it Get the Product Data, the Product Variant Data, or both (because it lists everything as a variant. I don't know why)?

 

I appreciate any help you can give! I'm going to continue researching and playing around with the flow, but making sure I"m getting the right information to then ensure I'm fulfilling the right thing is the tough part!

 

 

Accepted Solution (1)
Vault_Ally
Tourist
7 1 2

This is an accepted solution.

Aha! I figured it out! I will do my due diligence to help others. 😉

 

After my product is listed, I check the category. (Right now I only have handbags, but everything in our store can be narrowed down to 7 categories for sorting). Then I had it get the product data, and then I executed the code below.

 

info.png

 

I specifically had to use the productCategory and productTaxonomyNodeId, as seen below. (These are depreciated, as Paul stated above, but Flow hasn't updated to fully depreciate these yet, so once we're able to use the actual list we'll have to update this)

{
"input": {
  "id": "gid://shopify/Product/8606116380921",
   "productCategory": {
      "productTaxonomyNodeId": "gid://shopify/ProductTaxonomyNode/329"
}
}
}

 

However! All links to get to the node are depreciated. But, thanks to the Wayback Machine, I found a list of the numbers!

 

 Tested it, ran it, and it worked! Manually updating is now a thing of the past. :3

View solution in original post

Replies 9 (9)

paul_n
Shopify Staff
1433 157 332

It's not clear what you have built in Flow versus outside of Flow. The first question is what triggers this to happen and what information do you have in the workflow based on that trigger?

 

If you have a lot of categories this could get unwieldy pretty quickly. I'd probably use Run code as it would allow you to write complex logic all in one place.

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
Vault_Ally
Tourist
7 1 2

Everything is built inside the flow (so far).

 

Basically, now that I've had more time to think on it and tweak it: I need it to assign a category based on the collection it's in (so if a bag is in the Handbag collection, it would assign the Taxonomy category for handbags). 

 

I've narrowed it down to using the Send Admin API Request, and doing a productUpdate mutation, but I'm not 100% sure on where to add "category" so I can include the specific piece for the category. I'm THIS close to figuring it otu!

paul_n
Shopify Staff
1433 157 332

I think you probably need the productCategory { productTaxonomyNodeId } field. It's deprecated, so one risk there is you might need to fix it after Flow implements the next API version (it changes to just category). You'll need to know the node id for the category you want to assign. 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
Vault_Ally
Tourist
7 1 2

So I've tried both the productCategory as well as the category, and neither one seems to work. Not sure what or where I need to be doing this, but it either gives this error, or just flat out doesn't seem to work. 

 

api request error.png

 

Also, I have the list of the taxonomy IDs, but it's not specifically the one that goes gid://shopify/ProductTaxonomyNode/XXXX. The links to that list seem to be broken!

Vault_Ally
Tourist
7 1 2

This is an accepted solution.

Aha! I figured it out! I will do my due diligence to help others. 😉

 

After my product is listed, I check the category. (Right now I only have handbags, but everything in our store can be narrowed down to 7 categories for sorting). Then I had it get the product data, and then I executed the code below.

 

info.png

 

I specifically had to use the productCategory and productTaxonomyNodeId, as seen below. (These are depreciated, as Paul stated above, but Flow hasn't updated to fully depreciate these yet, so once we're able to use the actual list we'll have to update this)

{
"input": {
  "id": "gid://shopify/Product/8606116380921",
   "productCategory": {
      "productTaxonomyNodeId": "gid://shopify/ProductTaxonomyNode/329"
}
}
}

 

However! All links to get to the node are depreciated. But, thanks to the Wayback Machine, I found a list of the numbers!

 

 Tested it, ran it, and it worked! Manually updating is now a thing of the past. :3

Vault_Ally
Tourist
7 1 2

Slight update to this!

 

In order to get it to sort everything properly, I changed the Check If to see what the product type was (Backpacks OR Shoulder Bags OR totes, OR etc...) and then if it met those requirements, it assigns handbags. Otherwise, it checks for the next batch (jewelry Product Types), and so on and so forth. 

 

Next step: Assigning gender and age! \o/

thousandf
Visitor
1 0 0

This is amazing. Can you kindly screenshot your update. 

scottjderuyter
Shopify Partner
1 0 0

When is it expected that https://shopify.github.io/product-taxonomy/releases/2024-07/ will be incorporated into Flow? Working a launch now and trying to assess the change and even if it's even worth it to build at this time. This use case (using taxonomy to assign tags) is a huge opportunity for automation. In my spec, I'd like it to map each taxonomy node as a tag to allow for easier merchandising to department/categories. 

Thus, a Necklace at level 3 "necklace" also gets tagged with level 2 "Jewelry" and level 1 "apparel and accessories".

 

Thanks - SD

paul_n
Shopify Staff
1433 157 332

The product.category object in Flow should already contain the taxonomy. Not sure what you need from that specific release, but Flow is currently using 2024-04 as the API version. We are probably 1-2 months away from adopting 2024-07. 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.