This workflow combines web research with AI image generation. It searches the web for current information about your topic, then uses that research to generate a contextually accurate and up-to-date infographic.
Perfect for: Creating images about current events, trending technologies, or topics requiring accurate real-world information.
- 🔍 Web research integration - Uses Firecrawl to search for current information
- 🎨 Context-aware generation - Images reflect real-world data
- 📊 Automatic prompt building - Combines topic + research into detailed prompts
- ⚡ Smart error handling - Continues even if search fails
- 🏷️ Topic-based filenames - Images named after your search topic
Manual Trigger
↓
Set Search Topic (Code Node)
↓
Firecrawl Web Search
↓
Build Prompt (Code Node)
↓
Generate Image (Gemini)
↓
Decode Image (Code Node)
↓
Output: Image Binary
- manual_trigger: Start the workflow manually
- set_search_topic: Define topic and description for research
- firecrawl_search: Search web for relevant content
- build_prompt: Combine topic + research into image prompt
- generate_image: Generate image using Gemini
- decode_image: Convert output to usable image file
- ✅ n8n instance (self-hosted or cloud)
- ✅ Google Gemini API key (Get here)
- ✅ Firecrawl API key (Get here)
- n8n version 1.0+ with LangChain nodes
- Firecrawl integration:
@mendable/n8n-nodes-firecrawl - Google Gemini node:
@n8n/n8n-nodes-langchain
- Go to firecrawl.dev
- Sign up for a free account
- Navigate to API Keys in your dashboard
- Copy your API key
Free Tier: Firecrawl offers a free tier with limited searches per month
- Go to Google AI Studio
- Sign in with Google account
- Navigate to API Keys
- Create an API key
- Copy the key
- In n8n, go to Credentials → Add Credential
- Search for Firecrawl API
- Enter your Firecrawl API key
- Test and save
- In n8n, go to Credentials → Add Credential
- Search for Google PaLM API or Google Gemini
- Enter your Google API key
- Test and save
- Download or copy
web_search_image_generation.json - In n8n, click Import from File
- Select the JSON file
- Click Import
- Click on firecrawl_search node
- Select your Firecrawl credential
- Save
- Click on generate_image node
- Select your Google Gemini credential
- Save
- Open the workflow in n8n
- Click on the set_search_topic node
- Edit
TOPICandDESCRIPTIONvariables:
const TOPIC = 'Your search topic here';
const DESCRIPTION = `Detailed description of what you want to research and visualize`;- Click Execute Workflow
- View generated image in final node output
const TOPIC = 'The rise of AI agents in 2026';
const DESCRIPTION = `Research how autonomous AI agents are being used in
software development, customer service, and business automation. Focus on
real tools and platforms that launched in 2025-2026.`;Result: Image showing current AI agent platforms with accurate logos and names from web research.
const TOPIC = 'Remote work statistics 2026';
const DESCRIPTION = `Find latest data on remote work adoption rates,
productivity metrics, and popular tools. Show percentage breakdowns and
growth trends from 2020 to 2026.`;Result: Infographic with actual statistics from recent studies and reports.
const TOPIC = 'Top project management tools comparison';
const DESCRIPTION = `Compare features, pricing, and user bases of leading
project management platforms: Asana, Monday.com, ClickUp, Notion.
Show current market positions and key differentiators.`;Result: Comparison chart with accurate current information about each platform.
The firecrawl_search node:
- Combines your topic + description into a search query
- Adds keywords like "visual infographic 2026" for relevant results
- Returns up to 6 web pages with titles and descriptions
The build_prompt node:
- Extracts titles and snippets from search results
- Combines topic, description, and research context
- Creates a detailed image generation prompt including:
- Visual requirements (size, style, colors)
- Research context for accuracy
- Design specifications
The generate_image node:
- Sends the enriched prompt to Google Gemini
- Receives image data (base64 or binary)
- Handles different response formats automatically
The decode_image node:
- Converts Gemini output to downloadable image file
- Creates filename from topic + timestamp
- Adds metadata (size, mime type, generation time)
In firecrawl_search node, change the limit parameter:
"limit": 6 // Default (balance speed vs context)
"limit": 3 // Faster, less context
"limit": 10 // Slower, more contextIn build_prompt node, customize the image prompt template:
const imagePrompt = `Create a professional, editorial-quality infographic...
// Add your custom instructions here
// Example: Emphasize specific colors, layouts, or styles
`;In firecrawl_search node, modify the query construction:
"query": "={{ $json.topic + ' ' + $json.description + ' visual infographic 2026' }}"
// Change to:
"query": "={{ $json.topic + ' statistics data visualization' }}"
// or
"query": "={{ $json.topic + ' architecture diagram blueprint' }}"- Format: JPEG or PNG (automatic detection)
- Filename:
{topic-slug}_{timestamp}.jpg- Example:
remote_work_statistics_2026_2026-05-05-143022.jpg
- Example:
- Dimensions: As specified in prompt (default 1440x756px)
{
"filename": "ai_trends_2026_2026-05-05-143000.jpg",
"mimeType": "image/jpeg",
"size_bytes": 245890,
"generated_at": "2026-05-05T14:30:00.000Z"
}Symptoms: "No web research available" in logs
Solutions:
- Check Firecrawl API key is valid
- Verify you haven't exceeded API quota
- Try a more specific search topic
- Check Firecrawl service status
Note: Workflow continues even if search fails, using only topic/description
Cause: Prompt building might not emphasize research context enough
Solutions:
- Edit build_prompt node to give more weight to search results
- Increase search result limit from 6 to 10
- Make topic and description more specific
Cause: Gemini's training data vs web search results
Solutions:
- Add "2026" or "latest" to your topic
- Include "current data" in description
- Modify prompt to emphasize "use research context for accuracy"
Cause: Topic too broad or vague
Solutions:
- Make topic more specific
- Add clarifying keywords to description
- Adjust the search query in firecrawl_search node
✅ Good topics:
- "State of AI infrastructure in 2026"
- "Docker vs Kubernetes adoption rates 2025-2026"
- "Top 5 CRM platforms market share 2026"
❌ Avoid vague topics:
- "Technology stuff"
- "Business things"
- "Some data"
- Be specific: Mention exact aspects you want researched
- Include timeframes: "2025-2026", "latest", "current"
- Name entities: "OpenAI GPT-4", "Microsoft Azure", "GitHub Copilot"
- Request data types: "statistics", "comparisons", "architecture", "workflow"
Add style instructions to your description:
- "Use modern isometric 3D style"
- "Create a professional comparison chart"
- "Design a timeline visualization"
- "Show as a hub-and-spoke diagram"
- Web search: 2-5 seconds
- Prompt building: < 1 second
- Image generation: 5-15 seconds
- Total: ~10-25 seconds per execution
- Firecrawl: Free tier available, paid plans for high volume
- Google Gemini: Usage-based pricing, check current rates at ai.google.dev/pricing
Try the Enhanced Prompt Engineering workflow which adds:
- AI-powered prompt optimization
- Style selection based on content structure
- Multi-variation generation
- Advanced visual analysis
Modify the workflow to:
- Read topics from a CSV or Google Sheets
- Loop through each topic
- Generate multiple images automatically
- Webhook trigger: Generate images from external requests
- Schedule trigger: Daily trend visualization
- Slack integration: Post generated images to channels
- Google Drive: Auto-save images to Drive folders
Improvements and variations welcome! Share your customizations with the community.
This workflow is provided as-is for community use. Modify as needed for your use case.
Part of the n8n-selfhosting-workflows collection