Intelligent Web Query and Semantic Re-Ranking Flow n8n Workflow Template

n8n workflow template · 16 nodes · Anthropic Claude

Intelligent Web Query and Semantic Re-Ranking Flow is a free n8n workflow template that starts when its webhook receives an HTTP request and works with Anthropic Claude, OpenAI and Google Gemini. It has 16 nodes, 10 of them AI nodes (Auto-fixing Output Parser, Structured Output Parser, Basic LLM Chain and Anthropic Chat Model). To run it, you add your own credentials for Anthropic API, Google Gemini (PaLM) API and OpenAI API.

At a glance

Trigger
Webhook (Webhook)
Nodes
16
Apps
Anthropic Claude, OpenAI and Google Gemini
AI nodes
10
Credentials
3 types
Category
AI agents and LLM tools

Apps and integrations

  • Anthropic Claude
  • OpenAI
  • Google Gemini

Node types used

  • Date & Time
  • Webhook
  • Auto-fixing Output Parser
  • Structured Output Parser
  • Code
  • Respond to Webhook
  • Basic LLM Chain
  • HTTP Request
  • Anthropic Chat Model
  • OpenAI Chat Model
  • Google Gemini Chat Model

Setup notes

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

If you require to change this Node to Webhook Or any Other Item

  • In case you want to change the input type from Webhook to any other item, Make sure to go to the Query 1 and Query 1 Ranker and replace the Webhook Input to your Node's input.

Step 1. Set Up a Free Brave Web Search Query API Key

To attain the free web search API tier from Brave, follow these steps

  1. Visit api.search.brave.com
  2. Create an account
  3. Subscribe to the free plan (no charge)
  4. Navigate to the API Keys section
  5. Generate an API key. For the subscription type, choose "Free".
  6. Go to the "Query" Nodes and change the "X-Subscription-Token" value to your API Key.

Step 2. Setup the Webhook Call Node

Instructions for Setting Up the Webhook Call and Using It in Your Workflow

This node is designed to send a web search query to the workflow (partly built in this chart) and return the results. Follow these steps to correctly configure and use it

  1. Locate the "Webhook" Node in the Workflow
  • Navigate to the workflow above, the first item, the "Webhook" node.
  • In the "Webhook" node, change the Webhook URL option from "Test URL" to "Production URL."
  • Copy the generated Production URL.
  1. Paste the Webhook URL in the HTTP Node
  • In your target workflow, locate the HTTP Request node.
  • Paste the copied Production URL into the URL field of the HTTP Request node. This connects the two workflows.
  1. Send the Research Request
  • When sending the request to this workflow, make sure to include your web search query in the "Research Question" parameter of the HTTP Request node.
  1. Move the Webhook Call Node
  • Move this Webhook Call Node into the workflow where you need the research results. Ensure that it’s correctly connected and configured to send the data to the main workflow.

Customized Models to Replace

In case you rather to use another LLM Model to Perform the Semantic Search and Re-Ranking, These nodes below are Optimized based on the LLM Structure of OpenAI GPT4o & Anthropic Claude.

Nodes in this workflow

The 16 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. Date & Time (Date & Time)
  2. Webhook (Webhook)
  3. Auto-fixing Output Parser6 (Auto-fixing Output Parser)
  4. Auto-fixing Output Parser (Auto-fixing Output Parser)
  5. Structured Output Parser1 (Structured Output Parser)
  6. Query-1 Combined (Code)
  7. Respond to Webhook (Respond to Webhook)
  8. Semantic Search - Result Re-Ranker (Basic LLM Chain)
  9. Query (HTTP Request)
  10. Webhook Call (HTTP Request)
  11. Semantic Search -Query Maker (Basic LLM Chain)
  12. Anthropic Chat Model (Anthropic Chat Model)
  13. OpenAI Chat Model (OpenAI Chat Model)
  14. Structured Output Parser2 (Structured Output Parser)
  15. Parser Model (Google Gemini Chat Model)
  16. Agent Model (Google Gemini Chat Model)

Credentials you need

  • Anthropic API – used by Anthropic Chat Model
  • Google Gemini (PaLM) API – used by Agent Model and Parser Model
  • OpenAI API – used by OpenAI Chat Model

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us