Connecting Tavily to n8n

Last updated: June 2, 2025

n8n is a powerful workflow automation tool that allows you to integrate different APIs and services. This guide explains how to connect Tavily to n8n.

Option 1: Tavily Node

Option 1: Use Tavily as a Node in n8n Workflows

  • In the node library, search for Tavily.

  • Add it to your workflow and choose between Search or Extract actions.

Option 2: Add Tavily as a Tool to an AI Agent

If you’re building an AI agent workflow, you can add Tavily as a tool to your agent. This allows your agent to use Tavily for web search or content extraction as part of its reasoning process.

Step 1: Add an AI Agent Node

  • Drag the AI Agent node into your workflow.

  • Configure the AI model and reasoning parameters as needed.

Step 2: Add Tavily as a Tool

  • Inside the AI Agent node, click Add Tool.

  • Select Tavily from the list of available tools.

  • Enter your Tavily API key to connect your account.

Step 3: Configure Tavily Parameters

  • For Search:

    • Provide a search query (manual input or dynamic from previous nodes).

    • Select a topic such as "general" or "news".

    • Optionally include/exclude domains, set search depth, and choose content options.

  • For Extract:

    • Provide one or more URLs to extract content from.

    • Choose extraction type ("basic" or "advanced").

Step 4: Use the Results

  • Use the AI Agent's output in your workflow to:

    • Process data with other nodes (filters, functions, merges).

    • Send notifications or emails.

    • Store results in databases or CRMs.

    • Pass results to other AI workflows for summarization or decision-making.


Option 2:

Step 1: Add an HTTP Request Node

  1. Open your n8n workflow.

  2. Add a new HTTP Request node.

  3. Set the method to POST.

  4. Choose the appropriate Tavily API endpoint:

    • Search API: https://api.tavily.com/search

    • Extract API: https://api.tavily.com/extract

Step 2: Configure the HTTP Request Node

URL

  • Use the chosen Tavily API endpoint.

Headers

  • Authorization: Bearer <tavily-api-key>

  • Content-Type: application/json

Body

  • Include the required parameters in JSON format.

For detailed API parameters, refer to our documentation:

Step 3: Import a cURL Request (Alternative Setup)

You can import a cURL request directly into n8n:

  1. Click "Import cURL" in the HTTP Request node.

  2. Copy and paste the following cURL command:

curl --request POST \
  --url https://api.tavily.com/search \
  --header 'Authorization: Bearer <your-api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "who is Leo Messi?"
}'

Step 4: Test and Execute

  1. Click "Execute Node" to test the request.

  2. If successful, use the response data in the next steps of your workflow.

Troubleshooting

  • Ensure your API key is valid and correctly added to the headers.

  • Check if the request body is formatted correctly according to the API documentation.