Perplexity-style iterative research with Gemini and Google Search
Ready for 3.0What this workflow does
This AI workflow has 31 nodes and runs when a chat message arrives. Along the way it connects Google Gemini Chat Model and Redis. It also calls generativelanguage.googleapis.com over HTTP.
How it runs
Trigger: When a chat message arrives.
- Configs (Edit Fields (Set)): sets 4 fields: number_of_initial_queries, max_research_loops, current_date…
- generate_query (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model; output parser: Structured Output Parser
- set search_query (Edit Fields (Set)): sets or maps fields
- Split Out: splits a list into separate items
- search_query (Edit Fields (Set)): sets or maps fields
- number_of_ran_queries (Redis): incr
- attach index as id (Code): runs custom JavaScript code
- GeminiSearch (HTTP Request): calls generativelanguage.googleapis.com (POST)
- web_search (Code): runs custom JavaScript code
- merge web_search_result (Aggregate): combines items into one
…plus 17 more steps. See the full node list below.
Services it uses
HTTP calls to: generativelanguage.googleapis.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (12)
- Edit Fields (Set)
n8n-nodes-base.set - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Split Out
n8n-nodes-base.splitOut - Code
n8n-nodes-base.code - Aggregate
n8n-nodes-base.aggregate - Redis
n8n-nodes-base.redis - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Merge
n8n-nodes-base.merge - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger
From the author
AI Comprehensive Research on User's Query with Gemini and Web Search What is this? Perform comprehensive research on a user's query by dynamically generating search terms, querying the web using Google Search (by Gemini) , reflecting on the results to…