5 simple workflows to get started with ChatGPT in n8n
5 simple workflows to get started with ChatGPT in n8n
Learn how to integrate ChatGPT into your n8n workflows with 5 practical examples. This tutorial covers text processing, role-based interactions, prompt chaining, code generation, and multimodal AI capabilities using OpenAI's GPT models.
This tutorial introduces fundamental concepts for working with ChatGPT in n8n, including prompt engineering, prompt chaining, and multimodal AI interactions.
Before building workflows, configure your OpenAI credentials in n8n.
Start with simple text summarization and translation tasks using GPT-3.
Prompt: Summarize the following text in 2-3 sentences:
{{$json.text}}Prompt: Translate the following text to Spanish:
{{$json.text}}
Provide only the translation without explanations.Configure system and user message roles to customize AI behavior.
{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant that adds relevant emojis to every response. Be cheerful and friendly."
},
{
"role": "user",
"content": "{{$json.userMessage}}"
}
],
"model": "gpt-3.5-turbo",
"temperature": 0.7
}Connect multiple AI models to create sophisticated workflows. Generate image prompts from text summaries.
Step 1 - Summarization:
"Summarize this article in one paragraph: {{$json.article}}"
Step 2 - Image Prompt Generation:
"Convert this summary into a detailed image prompt for DALL-E. Include style, mood, colors, and composition: {{$node.ChatGPT1.json.output}}"
Step 3 - Image Generation:
DALL-E prompt: "{{$node.ChatGPT2.json.output}}"Use ChatGPT to generate HTML, SVG, JavaScript, and other code snippets.
Prompt: Generate an HTML form with the following fields:
- Name (text input)
- Email (email input)
- Message (textarea)
- Submit button
Include basic CSS styling to make it look professional. Provide only the code without explanations.Combine multiple AI models: transcribe audio with Whisper, then generate related images.
// Whisper Configuration
{
"operation": "transcribe",
"file": "{{$binary.audio}}",
"model": "whisper-1",
"language": "en"
}
// ChatGPT Processing
{
"prompt": "Create a visual description based on this transcript: {{$json.text}}"
}
// DALL-E Generation
{
"prompt": "{{$json.description}}",
"size": "1024x1024"
}These 5 workflows demonstrate the flexibility and power of integrating ChatGPT into n8n. Start with simple text processing, then gradually explore advanced techniques like prompt chaining and multimodal interactions. Remember that AI is a tool to augment human capabilities, not replace human judgment.