WordPress Category Mapping Transformer with Azure AI - n8n Workflow

Automate WordPress category ID mapping using this powerful n8n workflow. Integrate Azure OpenAI (GPT-5 Mini) via LangChain n8n nodes to transform category data into precise JSON definitions.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Content strategists managing large WordPress installations.
Developers needing to automate category ID synchronization.
Users looking for specialized n8n templates for AI-driven data transformation.
Professionals utilizing Azure OpenAI services within an n8n workflow environment.

Overview

Managing and correctly mapping category IDs across a dynamic WordPress installation can be error-prone and labor-intensive. This specialized n8n workflow solves this problem by integrating a powerful LLM—GPT-5 Mini via Azure OpenAI—to handle the logic.

This robust n8n automation template is designed to fetch all current categories from your WordPress site and, based on custom AI instructions, generate the required mapping script (a conditional JSON structure). This ensures that new posts or synchronized content always link to the correct category ID, providing accuracy and saving significant development time. Utilizing this n8n solution ensures your data transformation is both scalable and intelligent.

How it Works

This automation process begins with a simple manual n8n trigger. The step-by-step logic ensures a clean data flow for the AI transformation:


  1. Trigger Activation: The workflow starts manually using the Start n8n trigger. For production use, this could easily be converted to a scheduled n8n trigger if needed.

  2. Data Fetching: The Get All Categories n8n node executes an HTTP Request using predefined WordPress API credentials. It queries the site's REST API to retrieve up to 100 category entries.

  3. Data Preparation: The Aggregate to Process n8n node collects all individual category items retrieved in the previous step and bundles them into a single comprehensive JSON payload, preparing it for the AI.

  4. AI Transformation Chain: The aggregated data is passed to the Category-Mapping n8n node. This node (a LangChain LLM component) uses a custom system prompt that instructs the AI to analyze the incoming category JSON and output a specific JavaScript conditional structure used for mapping (e.g., category == "Technology" ? [3] : ...).

  5. LLM Execution: The AI logic is processed by the Gpt-5-mini n8n node, which connects to the Azure OpenAI service. This powerful n8n node generates the precise, cleaned mapping output based on the provided instructions, completing the primary function of this n8n workflow.

Installation Guide

To deploy and run this effective n8n workflow template, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance.

  2. WordPress Credentials: Update the Get All Categories n8n node with your specific WordPress URL (as noted in the sticky note instructions) and ensure you have a valid 'WordPress API' credential set up in n8n for authentication.

  3. Azure OpenAI Credentials: Configure the Gpt-5-mini n8n node by setting up the necessary 'Azure OpenAI Api' credentials, pointing to your deployment of the GPT-5 Mini model.

  4. Mapping Customization: Review the system prompt within the Category-Mapping n8n node. You will need to paste the raw category JSON output from your WordPress API call into the 'Text' field and adjust the mapping structure within the system message to match your desired final category IDs and names. This is the core setup required for this n8n template.

Node Details

Start (n8n trigger): A manualTrigger node used to initiate the n8n workflow on demand.
Get All Categories (httpRequest n8n node): Connects to the WordPress REST API using a wordpressApi credential to fetch a list of categories (up to 100) from the target URL. Crucial for gathering the initial category data for the n8n workflow.
Aggregate to Process (aggregate n8n node): Consolidates all individual category JSON items fetched by the previous n8n node into a single item, which is essential for passing the complete dataset efficiently to the AI chain.
Category-Mapping (chainLlm n8n node): This LangChain node manages the prompt and overall transformation logic. It receives the aggregated JSON and uses a system prompt that dictates the AI's role: generating a clean, conditional category mapping structure based on the input data. The input text is dynamically set using the expression ={{JSON.stringify($json)}}.


  • Gpt-5-mini (lmChatAzureOpenAi n8n node): The large language model provider for this n8n workflow. Configured to use the 'gpt5mini' model via Azure OpenAI credentials, providing the intelligence required to execute the transformation logic defined in the Category-Mapping n8n node.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

Featured*