How to Use AI to Categorize Products Automatically

Let AI analyze your product catalog and assign categories, tags, and attributes automatically.

What This Integration Does

Manual product categorization is a chore that scales linearly with your catalog and gets worse every time you onboard a new supplier or import a new feed. Inconsistent categories break navigation, faceted search, and ad targeting. This Spojit workflow reads each product title and description with an AI agent and emits a category, subcategory, tag list, and attribute map in a predictable JSON shape.

The workflow runs on demand for a one-shot pass or on a schedule for incremental cleanup. It fetches a batch of products, loops over them, and passes each one to a Connector node in Agent Mode with a Response Schema that forces structured JSON. High-confidence results update the store directly; borderline ones pause at a Human approval step so your merchandising team can review before any change goes live. Re-running the workflow re-fetches whatever is still uncategorized, so a run that stops partway is safe to start again.

Prerequisites

  • A Shopify, WooCommerce, or BigCommerce connection with read and write product access.
  • Your category tree exported as a flat list of allowed paths (e.g. Apparel > Mens > Tops) so the AI agent cannot invent new categories.

Step 1: Trigger

Add a Trigger node. Use Manual (run via the Run button) for the initial pass, or Schedule with a cron expression such as 0 * * * * to keep new SKUs categorized as they come in. For near real-time categorization, a Webhook trigger that your store calls on product creation works too.

Step 2: Fetch Products

Add a Connector node in Direct mode pointing at shopify and the list-products tool (or the woocommerce / bigcommerce list-products tool). Filter to products with no category or with the default "Uncategorized" tag. Limit to 100 per run to keep AI cost and runtime bounded. Bind the result to an output variable such as products.

Step 3: Loop Over Products

Add a Loop node in ForEach mode over {{ products }}. Each iteration exposes the current product as {{ item }}, which the next steps categorize and write back one product at a time.

Step 4: AI Categorization with a Response Schema

Inside the loop body, add a Connector node in Agent Mode and set a Response Schema so the AI agent returns parseable JSON. Bind the result to an output variable such as ai. Define the schema:

{
  "category": "string",
  "subcategory": "string",
  "tags": ["string"],
  "attributes": { "material": "string", "season": "string", "gender": "string" },
  "confidence": "number"
}

Prompt:

Categorize this product.
Pick category and subcategory from this list only: {{ allowedCategoryTree }}
Product title: {{ item.title }}
Product description: {{ item.body_html }}
Return confidence as a number between 0 and 1.

Step 5: Confidence Gate

Add a Condition node that tests {{ ai.confidence }} >= 0.8. The true branch goes straight to the write step. The false branch routes to a Human approval node so a merchandiser can confirm before publish. Note that a rejected approval halts that iteration rather than branching to an alternate path, so use the gate to send only borderline cases for review.

Step 6: Update the Product

Add a Connector node in Direct mode calling update-product on the store connector. Map:

  • category + subcategory -> product type / collection / category
  • tags -> tags field
  • attributes -> metafields (Shopify) or custom fields (BigCommerce / WooCommerce)

Step 7: Log and Report

Add a Connector node calling mongodb insert-documents to write each categorization decision into a category_assignments collection (productId, oldCategory, newCategory, confidence, timestamp). After the loop completes, add a Connector node calling slack send-message to post a summary of the run counts to your team channel.

Tips

  • Pin the category tree. Without it, the AI agent will create new categories that don't exist in your store and the update step will fail.
  • Batch products with similar titles to reuse context and reduce token spend.
  • Start the confidence gate at 0.8 and tune up or down based on the first few hundred reviews.
  • Keep the MongoDB audit log so you can bulk-revert a bad run.
  • Scaffold the canvas fast by asking Miraxa, the intelligent layer across your automation, to "Add a Loop node over {{ products }} feeding a Connector node in Agent Mode," then fine-tune each node in the properties panel.

Common Pitfalls

  • Free-form output. Without a Response Schema on the Agent Mode step, parsing breaks every few hundred products and the loop silently drops them.
  • Stale category trees. Re-export the allowed list whenever merchandising adds new categories, or the AI agent will guess.
  • Overwriting curated tags. Have the AI return additive tags only and merge with existing tags rather than replacing.
  • Rate limits on the store API. update-product on Shopify costs 10 points; throttle the loop or you'll get 429s.

Testing

Run with list-products limit set to 5 and a known set of product IDs. Inspect the structured JSON, confirm the categories appear in the allowed list, and approve a few from the Human step. Once you're happy with the assignments, expand the limit and let it run.

Learn More

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.