Skip to main content

Auto-generate Shopify blog related articles with OpenAI text-embedding-3-small

Workflow preview

Workflow preview
100%
Auto-generate Shopify blog related articles with OpenAI text-embedding-3-small preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Use case Automatically surface and insert the three most relevant “Related articles” at the end of every Shopify blog post to boost session depth, SEO, and reader engagement. ️ What this workfl...

Best for

  • Content Creation automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.splitinbatches, n8n-nodes-base.datatable, n8n-nodes-base.if, n8n-nodes-base.noop

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Geoffroy.

Original n8n.io source

1.1 Workflow description

Title
Auto-generate Shopify blog related articles with OpenAI text-embedding-3-small
Workflow name
Auto-generate Shopify blog related articles with OpenAI text-embedding-3-small

🪐 Use case

Automatically surface and insert the three most relevant “Related articles” at the end of every Shopify blog post to boost session depth, SEO, and reader engagement.


⚙️ What this workflow does

  • Pulls all published articles from a selected Shopify Blog using the Admin API.
  • Cleans the HTML content (removes existing .related-articles blocks) and extracts text for embeddings.
  • Generates OpenAI embeddings (text-embedding-3-small) and stores them in n8n Data Tables.
  • Calculates semantic similarity (cosine distance) between articles to identify the top matches.
  • Selects the Top 3 most relevant related posts for each article (configurable).
  • Dynamically builds a <div> HTML section and updates the article on Shopify.
  • Runs on a weekly schedule to keep relations fresh as new content is added.

🧩 Setup

  1. Create 3 Data Tables:

    • articles
    • article_relations
    • article_related_links_snapshot
  2. Add credentials:

    • Shopify Admin API Access Token
    • OpenAI API Key
  3. Set environment variables in the Workflow Configuration node:

    • shopifyBlogId
    • shopifyBlogDomain
    • shopifyStoreName
    • shopApiVersion
    • percent_minimum_similarity (default 70)
  4. (Optional) Keep or modify the Schedule Trigger (default: every week at 20:00).


🛠️ How to adjust this template

  • Modify the similarity threshold or number of related posts displayed.
  • Edit the HTML snippet or CSS classes for the related section.
  • Integrate a second OpenAI model to rewrite link titles or summaries for better UX.

💡 Ideal for

Shopify content teams and SEO strategists who want automated, context-aware internal linking to improve engagement and organic ranking.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - Workflow Configuration

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Get articles from shopify

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Clean & Prepare Text

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 6 - OpenAI Get Embeddings

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - Set article fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Calculate similarities

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Upsert articles

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 10 - Upsert article_relations

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 11 - Top 3 related articles

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Loop for source articles

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 13 - Get previous related_articles

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 14 - Check if article already has related

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 15 - Upsert relations

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 16 - Prepare HTML for related articles

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Check if related articles are the same

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 18 - No need to change the related section

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 19 - Get related article details

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 20 - Split Related IDs

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 21 - Insert Related in Article

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 22 - Update article with related

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 23 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 26 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Auto-generate Shopify blog related articles with OpenAI text-embedding-3-small
Complexity advanced
Nodes 26
Categories Content Creation, AI Summarization
Author Geoffroy
Published 05 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10542/10542.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Auto-generate Shopify blog related articles with OpenAI text-embedding-3-small do?

Use case Automatically surface and insert the three most relevant “Related articles” at the end of every Shopify blog post to boost session depth, SEO, and reader engagement. ️ What this workfl...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, AI Summarization use case.