🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Shopify + OpenAI: smarter related articles for SEO

Lisa Granqvist Partner Workflow Automation Expert

Your Shopify blog quietly leaks SEO value when posts don’t point to anything useful. Readers hit the end, bounce, and Google gets one more signal that your content isn’t keeping people around.

Shopify marketers feel it when traffic rises but pages per visit stays flat. SEO leads notice it in crawling and internal link reports. And if you run a small ecommerce team, you’re probably the one doing the “add related posts” cleanup. This Shopify OpenAI SEO automation keeps your blog connected without babysitting every article.

Below, you’ll see how the workflow finds the best matches, updates Shopify automatically, and stays fresh as you publish new content.

How This Automation Works

See how this solves the problem:

n8n Workflow Template: Shopify + OpenAI: smarter related articles for SEO

The Challenge: Related posts that never stay relevant

“Related articles” sounds simple until you try to maintain it at scale. You publish new posts, old posts become outdated, and suddenly your “related” section is linking to whatever someone picked months ago. Then it gets worse: different writers follow different rules, someone pastes a block with the wrong CSS class, and now half your posts have duplicate related sections or none at all. It’s not just annoying. It’s lost internal link equity, shorter sessions, and more manual QA every time you refresh content.

The friction compounds. Here’s where it breaks down.

  • Manual “pick three links” decisions turn into a recurring editing job that never ends once your blog passes a few dozen posts.
  • Old related blocks stick around, so posts end up with two “related articles” sections or links that no longer match the content.
  • Teams forget to update internal links after a new cornerstone post launches, which means your best content doesn’t get distributed traffic.
  • Rules-based tagging helps a bit, but it misses nuance (and it breaks the moment categories get messy).

The Fix: Auto-insert context-aware related articles in Shopify

This workflow pulls every published post from a selected Shopify blog using the Admin API, then cleans each article so it can “read” the real content instead of your theme markup. It removes any existing .related-articles block, extracts the text, and generates OpenAI embeddings using text-embedding-3-small. Those embeddings get stored in n8n Data Tables so you’re not re-processing everything from scratch every run. From there, the workflow calculates semantic similarity (cosine distance) between articles, selects the top three matches, and builds a fresh HTML “Related articles” section. Finally, it updates each Shopify article automatically, on a weekly schedule, so new posts start influencing the network without you touching anything.

The workflow starts on a schedule (weekly by default). It fetches Shopify articles, generates and stores embeddings, then computes similarity to identify the best matches. At the end, it injects a consistent related section and pushes the update back to Shopify.

What Changes: Before vs. After

Real-World Impact

Say your Shopify blog publishes 5 posts a week and you keep a backlog of 120 older posts. Manually adding and checking three related links takes maybe 10 minutes per post, plus another 5 minutes to make sure you didn’t duplicate a block, so you’re spending about 1–2 hours a week just on “related” housekeeping. With this workflow, you trigger nothing; the schedule runs weekly, rebuilds the top 3 matches, and updates posts only when relations actually changed. Your time drops to near-zero, and the blog stays woven together.

Requirements

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Shopify Admin API to read and update blog articles.
  • OpenAI API for embeddings and content similarity.
  • Shopify Admin API access token (create a custom app in Shopify admin).

Skill level: Intermediate. You’ll paste API keys, set a few environment variables, and test on a small blog first.

Need help implementing this? Talk to an automation expert (free 15-minute consultation).

The Workflow Flow

A weekly schedule kicks it off. The default trigger runs every week at 20:00, but you can change it to daily while you’re rolling out a new blog strategy.

Shopify articles are pulled and cleaned. The workflow retrieves all published posts from the chosen Shopify blog, removes any existing .related-articles section, then extracts readable text so the matching is based on actual content.

OpenAI creates embeddings, then n8n compares them. Each article is converted into an embedding via OpenAI (text-embedding-3-small), stored in n8n Data Tables, and compared using cosine similarity to find the closest matches.

Related HTML is built and injected back into Shopify. The workflow selects the top 3 related articles (configurable), builds a consistent HTML block, checks whether the relations changed, and only then updates the Shopify article through the Admin API.

You can easily modify the number of related links from 3 to 5 based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Schedule Trigger

Set the workflow to run on a weekly schedule so it can fetch and update Shopify blog articles automatically.

  1. Add and open Planned Schedule Start.
  2. Set the trigger rule to run weekly by confirming the interval uses weeks and set triggerAtHour to 20.
  3. Keep the output connected to Workflow Settings to initialize environment values before API calls.

Step 2: Connect Shopify and Define Workflow Settings

Provide Shopify details and connect the Shopify credential to both read and update posts.

  1. Open Workflow Settings and set shopifyBlogId to your blog ID (currently empty).
  2. Set shopifyBlogDomain to https://example.com/blogs/ (replace with your live blog domain).
  3. Set shopifyStoreName to <domain_before_myshopify.com> and shopApiVersion to 2025-07.
  4. Set percent_minimum_similarity to 70 to control the similarity threshold.
  5. Open Retrieve Shopify Posts and confirm the URL is =https://{{ $('Workflow Settings').first().json.shopifyStoreName }}.myshopify.com/admin/api/{{ $('Workflow Settings').first().json.shopApiVersion }}/blogs/{{ $('Workflow Settings').first().json.shopifyBlogId }}/articles.json.
  6. In Retrieve Shopify Posts, keep the query parameter published_status set to published.
  7. Credential Required: Connect your shopifyAccessTokenApi credentials in Retrieve Shopify Posts.
  8. Open Update Shopify Article and confirm the URL is =https://{{ $('Workflow Settings').first().json.shopifyStoreName }}.myshopify.com/admin/api/{{ $('Workflow Settings').first().json.shopApiVersion }}/blogs/{{ $('Workflow Settings').first().json.shopifyBlogId }}/articles/{{ $json.article.id }}.json.
  9. Credential Required: Connect your shopifyAccessTokenApi credentials in Update Shopify Article.

Tip: Ensure shopifyBlogDomain ends with a trailing slash so URLs built in Normalize Article Text are valid.

Step 3: Normalize, Map, and Embed Article Content

Clean the article HTML, map fields for storage, and generate embeddings using OpenAI.

  1. Review Normalize Article Text to ensure it removes existing related sections and produces text_for_embedding.
  2. In Map Article Fields, confirm the mapping values use expressions like {{ $json.shopify_id }}, {{ $json.title }}, and {{ $json.content }}.
  3. Set embedding to {{ $json.text_for_embedding }}) and analyzed_at to {{new Date().toISOString()}} in Map Article Fields.
  4. Open OpenAI Embedding Request and set URL to https://api.openai.com/v1/embeddings and Method to POST.
  5. In OpenAI Embedding Request, set model to text-embedding-3-small and input to {{ $json.embedding }}.
  6. Credential Required: Connect your openAiApi credentials in OpenAI Embedding Request.

⚠️ Common Pitfall: The embedding field in Map Article Fields currently includes an extra closing parenthesis. If embeddings fail, correct it to {{ $json.text_for_embedding }}.

Step 4: Store Articles and Build Similarity Relations

Persist article data, calculate similarity, and save relation records. This is where the data table operations and similarity logic happen.

  1. In Upsert Article Records, confirm Operation is upsert and Match Type is allConditions, with filter shopify_id set to {{ $('Map Article Fields').item.json.shopify_id }}.
  2. Ensure the embedding is saved using {{ JSON.stringify($json.data[0].embedding) }} in Upsert Article Records.
  3. Iterate Records outputs to both Compute Similarity Scores and Map Article Fields in parallel.
  4. In Compute Similarity Scores, verify the similarity filter uses {{ $('Workflow Settings').first().json.percent_minimum_similarity }}.
  5. In Upsert Relation Records, keep Operation set to upsert and map fields like {{ $json.source_shopify_id }} and {{ $json.related_shopify_id }}.

Tip: This workflow uses multiple dataTable nodes to store articles, relations, and snapshots. Ensure the underlying tables exist and their schemas match the fields configured.

Step 5: Select Related Articles and Update Shopify Content

Choose the top related articles, compare existing relations, build HTML, and update Shopify posts only when changes are detected.

  1. Confirm Select Top Related returns the top 3 IDs per article and passes them to Iterate Source Articles.
  2. Use Fetch Prior Relations and Check Existing Relations to detect whether a previous snapshot exists for the article.
  3. In Compare Relation Lists, ensure it compares {{ $('Iterate Source Articles').item.json.related_shopify_ids.join() }} to {{ $('Fetch Prior Relations').item.json.related_shopify_ids }}.
  4. Allow the Skip Update Section path to bypass updates when relations have not changed.
  5. When changes exist, store the latest IDs in Save Relation Snapshot and expand with Expand Related IDs.
  6. Use Fetch Related Details and Build Related HTML to generate the related articles HTML block.
  7. In Inject Related Section, ensure the old related block is removed and the new block is appended to the article body.
  8. In Update Shopify Article, keep JSON Body set to {{ JSON.stringify($json) }} and Method to PUT.

⚠️ Common Pitfall: If Retrieve Shopify Posts does not return all published articles, the Inject Related Section node may not find the current article by ID.

Step 6: Test and Activate Your Workflow

Run a manual test to verify embeddings, relation storage, and Shopify updates, then activate the schedule.

  1. Click Execute Workflow to run from Planned Schedule Start.
  2. Confirm Retrieve Shopify Posts returns published articles and Normalize Article Text outputs clean text.
  3. Verify OpenAI Embedding Request returns embeddings and Upsert Article Records writes rows.
  4. Check that Compute Similarity Scores produces relation items and Upsert Relation Records stores them.
  5. Validate that updated articles in Shopify include the related articles block after Update Shopify Article.
  6. When satisfied, toggle the workflow to Active so Planned Schedule Start runs weekly.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Watch Out For

  • Shopify Admin API credentials can expire or need specific permissions. If things break, check your custom app scopes and token status in Shopify admin first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Common Questions

How quickly can I implement this Shopify OpenAI SEO automation?

About an hour if your Shopify and OpenAI keys are ready.

Can non-technical teams implement this Shopify OpenAI SEO automation?

Yes, but someone should be comfortable creating a Shopify custom app and pasting API keys into n8n. After that, it’s mostly configuring variables and testing on a small set of posts.

Is n8n free to use for this Shopify OpenAI SEO workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs for embeddings, which are usually low but depend on how many posts you process.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

How do I adapt this Shopify OpenAI SEO solution to my specific challenges?

You can tune it without rewriting the whole thing. Most teams start by changing the similarity threshold (the workflow uses a percent_minimum_similarity setting, default 70) and the “Top 3” selection so it shows 4–5 links on longer posts. If your theme uses different markup, swap the CSS class in the “clean HTML” and “build related HTML” parts so it removes and injects the right block. You can also keep the matching as-is and add a second OpenAI step that rewrites link titles or adds one-line summaries for a nicer UX.

Why is my Shopify connection failing in this workflow?

Usually it’s the Admin API token or scopes. Regenerate the Shopify Admin API access token in your custom app and confirm it has permission to read and write blog articles. Also double-check the workflow environment variables like store domain and API version, because one wrong value can make every HTTP request look “fine” but return nothing. If you’re processing a lot of posts in one run, you may also be hitting Shopify rate limits, so slowing batches down can help.

What’s the capacity of this Shopify OpenAI SEO solution?

In practice it scales with how many articles you have and how fast your n8n instance can run the batches. On n8n Cloud, the Starter plan supports a set number of monthly executions and the higher tiers handle more; this workflow will use multiple executions per run if you have lots of posts. If you self-host, you’re not capped by executions, but you are capped by server resources and API limits (Shopify and OpenAI). For many small Shopify blogs, weekly runs are comfortable on a modest VPS.

Is this Shopify OpenAI SEO automation better than using Zapier or Make?

Often, yes, because the core value here is the logic: storing embeddings, calculating similarity, comparing relation snapshots, and only updating Shopify when something changed. n8n is built for that kind of multi-step workflow and it’s easier to self-host when executions climb. Zapier or Make can work if you simplify the approach (for example, “choose from a tagged list”), but you’ll lose the semantic matching that makes this feel smart. If you’re unsure, Talk to an automation expert and we’ll sanity-check the best path.

Once this is running, your Shopify blog stops behaving like a pile of separate posts and starts acting like a connected library. Honestly, that’s the difference between “we publish” and “we compound.”

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal