Multi-Model OpenAI Automation Demonstrator - n8n Workflow

Explore advanced AI capabilities with this n8n workflow. It includes ChatGPT, Davinci, Whisper, and DALLE-2 examples for summarization, translation, image generation, and programmatic API calls.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Users looking for robust n8n templates integrating multiple OpenAI models (ChatGPT, DALLE-2).

  • Automation specialists needing examples of AI prompt chaining and programmatic API usage using the HTTP Request n8n node.

  • Content professionals aiming to automate summarization, translation, and cover image generation for long-form content.

  • Developers interested in comparing legacy OpenAI models (Davinci) against newer, more cost-effective Chat models.

Overview

This comprehensive n8n workflow serves as an extensive sandbox for showcasing nearly all major functionalities offered by the OpenAI API. It provides critical examples for migrating from older, expensive models like Davinci to the efficient Chat API, utilizing the dedicated OpenAI n8n node. The core value of this n8n template lies in its demonstration of sophisticated logic, such as using the Code n8n node to programmatically structure API requests and chaining AI steps—for instance, generating a summary, creating an image prompt based on that summary, and finally, generating a DALLE-2 image. Every part of this n8n workflow is designed to teach best practices for complex AI automation.

How it Works

The entire process is initiated by the Manual n8n trigger, labeled 'When clicking "Execute Workflow"'.


  1. Data Input: The flow starts by routing to the 'Text-example' Code n8n node, which contains a substantial text article acting as the main input data for the subsequent AI processes.

  2. Legacy & Simple Chat Operations: The input text feeds into several parallel branches. This includes legacy davinci-003 n8n node branches (for completion and edit/translation) and simple ChatGPT branches (ex1.1/1.2 for summarization and chained translation, and ex2 for summarization with specific system instructions).

  3. Programmatic API Call: The text also routes to the 'Code-ex3.1' n8n node, which dynamically constructs a complex message array required for the Chat Completions API. This array is then submitted via an HTTP Request n8n node ('ChatGPT-ex3.1') to ensure compliance with the latest API standards, demonstrating a powerful use case within the overall n8n workflow.

  4. AI Chaining for Visuals (DALLE-2): The summary generated in the previous step becomes the input for 'ChatGPT-ex3.2'. This specialized ChatGPT n8n node is instructed to act as a prompt generator, creating a descriptive prompt for image generation. This prompt is immediately passed to the 'DALLE-ex3.3' n8n node, which generates four relevant images, showcasing advanced n8n workflow chaining.

  5. Code and Multiple Reply Generation: Separate branches triggered by the Manual n8n trigger demonstrate generating HTML/SVG code using ChatGPT ('ChatGPT-ex4') and generating multiple quick email replies simultaneously ('ChatGPT-ex'), utilizing the n parameter in the OpenAI n8n node parameters.

Installation Guide

To install and use this n8n workflow, follow these steps:


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

  2. API Key Setup: You must configure the OpenAI credential used across all OpenAI n8n nodes. Click on any OpenAI n8n node (e.g., 'ChatGPT-ex1.1') and select or create a new 'OpenAI API' credential. Input your valid OpenAI API Key.

  3. Execution Caution: Note the sticky note warning: this n8n workflow is complex and running it in its entirety can be slow and use many tokens. It is recommended to execute individual branches or the final n8n node of a specific process line for testing.

  4. Whisper Transcription: The 'LoadMP3' and 'Whisper-transcribe' n8n nodes are disabled by default. To test Whisper transcription, you must enable these nodes and modify the 'LoadMP3' n8n node to point to a valid audio file location accessible by your n8n instance.

Node Details

Manual Trigger (When clicking "Execute Workflow"): The initial n8n trigger that starts the execution of the entire n8n workflow for manual testing purposes.
Code (Text-example): This n8n node acts as the data source, holding a long string of text used as input for all subsequent AI operations.
OpenAI (davinci-003-complete & davinci-003-edit): Demonstrates legacy text completion and editing operations (translation) using older models. Key configuration includes the use of prompt and instruction parameters.
OpenAI (ChatGPT-ex1.1, ChatGPT-ex2, ChatGPT-ex): Core nodes for text tasks using the modern Chat API. These n8n nodes show various prompting techniques, including basic user prompts and complex system prompts (like in 'ChatGPT-ex2' which enforces 5 emojis).
Code (Code-ex3.1): Crucial n8n node for advanced users. It structures the input data into a message array, preparing a payload suitable for programmatic API calls, proving flexibility beyond standard n8n node inputs.
HTTP Request (ChatGPT-ex3.1): Used to demonstrate how to call the OpenAI Chat API using a custom request, utilizing the programmatic structure created by the previous Code n8n node.
OpenAI (DALLE-ex3.3): Generates images based on the prompt generated by the preceding ChatGPT n8n node. Key settings include specifying the resource as 'image' and setting parameters like n (number of images, set to 4) and size (512x512).
Set (Set-ex4): Prepares the variables and prompt used to instruct ChatGPT to generate HTML/SVG code, demonstrating how to structure data for code generation tasks within an n8n workflow.

Related n8n Workflows

Free

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

Featured*