Skip to content
FlowHubFluxonLab
A
AI Automationfree

Optimize n8n workflow JSON using Azure OpenAI GPT-4o-mini

by Rahul Joshiadapted from n8n official workflow galleryUpdated Aug 2026
RequiresAAI AgentAzure OpenAI Chat ModelAzure OpenAI Chat ModelCCode
Share Post Share
WeReceive Workflow JSONReceive Workflo…CoExtract & Validate Workflow BodyExtract & Valid…AgOptimize Workflow via AI AgentOptimize Workfl…CoParse, Strip & Validate Optimized JSONParse, Strip & …CTConvert Optimized Workflow to FileConvert Optimiz…RTReturn Optimized File to CallerReturn Optimize…Azure OpenAI Chat Model1Azure OpenAI Ch…123456
1/5
STEPS · 6
Starts on an incoming request

📊 Description Automate the optimization of your n8n workflows using AI-powered analysis and restructuring 🤖. This workflow receives any existing n8n JSON via webhook, analyzes it using Azure OpenAI, and returns a fully optimized, import-ready workflow file. It improves execution speed, reduces redundant nodes, enhances API efficiency, and ensures structural cleanliness — all while preserving the original logic. Perfect for automation builders who want cleaner, faster, and production-ready workflows instantly. 🚀 What This Template Does 📥 Receives an n8n workflow JSON via a secure POST webhook. 🔍 Extracts and validates the workflow body to ensure proper structure. 🤖 Sends the workflow to Azure OpenAI for performance and structural optimization. 🧹 Strips markdown, parses, and validates the AI-returned JSON. 📄 Converts the optimized workflow into a downloadable .json file. 📤 Returns the optimized workflow file directly to the caller.

Tags

n8nreference-onlyagentlm-chat-azure-open-ai
Connects
AAI AgentazureopenaichatmodelAzure OpenAI Chat ModelCCode
CategoryAI Automation
Triggermanual
Complexitymedium
Nodes7
AddedMar 2, 2026

Related workflows

See all AI Automation
ACDgmail
free

AI: Summarize podcast episode and enhance using Wikipedia

The workflow automates the process of creating a summarized and enriched podcast digest, which is then sent via email. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
ACembeddingsopenai
free

Route WhatsApp support requests with Claude, Supabase, HubSpot and Slack

Quick overview This workflow turns incoming WhatsApp messages (text, audio, images, and documents) into actionable support interactions by extracting content, detecting sentiment, and using an AI agent with a Supabase knowledge base to route requests to Google Calendar, HubSpot, Slack, Gmail, and back to WhatsApp. How it works Receives incoming WhatsApp messages via a WhatsApp webhook trigger. Routes the message by type and converts it into text using OpenAI Whisper for audio, OpenAI GPT-4o Vision for images, or a PDF extractor for documents (or passes text messages through). Loads the sender’s session context from Supabase and runs sentiment/language detection on the extracted text. Uses a LangChain AI agent (Claude) with Supabase vector search (with OpenAI embeddings and Cohere reranking) plus tool access (Google Calendar, HubSpot, Slack, and Gmail) to produce a structured intent, response, and metadata. Logs conversation analytics (intent, sentiment, message type, and response length) to an n8n Data Table. Routes by intent to either create a Google Calendar event, create/update a HubSpot contact, email a document via Gmail (and upload it to Google Drive), create a HubSpot ticket

by Multifly
ACsheets
free

Create TikTok carousel posts with Upload Post, Google Sheets, Gemini, GPT-4.1

Quick overview This workflow runs daily to pull TikTok post and profile analytics from Upload Post, updates a Google Sheets performance log, uses Google Gemini and OpenAI to generate a new carousel concept and caption, creates four images via fal.ai, publishes to TikTok, and updates a persistent “Agent Skill” sheet. How it works Runs on a daily schedule (or manually) and loads product, Upload Post, and Google Sheets configuration values. Reads the Google Sheets “Performance Log,” selects posts missing stats or posted recently, fetches TikTok post analytics from the Upload Post API, and writes updated metrics back to the sheet. Aggregates the refreshed history, fetches TikTok profile analytics from Upload Post, reads the “Agent Skill” sheet, and compiles a single context summary. Uses Google Gemini (via a structured JSON output) to generate a TikTok carousel plan including caption, strategy notes, four slide prompts, hashtags, and an engagement question. Sends the four prompts to fal.ai to generate four 9:16 PNG carousel images and collects their hosted image URLs. Uses OpenAI (GPT-4.1) to write a short TikTok photo-post description, publishes the carousel to TikTok via Upload Post

by amanullah