Automate Research with Perplexity AI in n8n Workflow

Discover how this unique n8n workflow automates gathering in-depth research using Perplexity AI’s Sonar model. Save hours on content search and synthesis with a seamless AI-driven automation designed for focused knowledge discovery.
executeWorkflowTrigger
set
httpRequest
+1
Workflow Identifier: 1601
NODES in Use: Execute Workflow Trigger, Set, HTTP Request, Sticky Note
Automate research with Perplexity AI in n8n

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow helps you find recent and useful information fast.
The main problem it solves is wasting hours searching on many websites for relevant, up-to-date research content.
It gives you a clear answer with sources from the last month.
This saves a lot of time and gives a better research result.

The input is a research question from another workflow.
The workflow sends this question to Perplexity AI’s Sonar model with special instructions.
Then it gets a focused answer with citations.
Finally, it cleans the answer so you get only the useful text ready to use.


Who Should Use This Workflow

This is made for anyone who needs to research topics often and quickly.
Users like content writers, researchers, students, or knowledge workers can benefit.
If you spend hours searching manually, this workflow can save time.
It fits well for non-technical users who want faster research with recent and credible info.


Tools and Services Used

  • n8n workflow automation: Run and control the steps.
  • Perplexity AI Sonar model: Answers the research questions with recent web content.
  • HTTP Request node: Sends questions and gets answers from Perplexity API.
  • Execute Workflow Trigger node: Starts the process when it gets a question.
  • Set nodes: Format messages and extract response text.

Inputs, Processing, and Outputs

Inputs

The input is a simple text question about research.
It comes from another workflow using the Execute Workflow Trigger node.
It must send the question under the key query.

Processing Steps

  1. Take the input question and place it inside a user message with a fixed system prompt.
  2. Make a POST request to Perplexity AI chat API with the Sonar model.
  3. Ask the AI to focus on recent information from the last month, filter by sources, and return citations.
  4. Receive the full JSON reply from the API.
  5. Extract only the answer text from the response JSON.

Outputs

The output is a plain text answer message.
The message includes cited, recent, relevant research information.
This output can go to another workflow or a display tool.


Beginner step-by-step: How to Use This Workflow in n8n

Import and Setup

  1. Download the workflow file using the Download button on this page.
  2. Open n8n editor (if using self-host n8n, open that instance).
  3. Use “Import from File” to bring in the downloaded workflow.
  4. After import, configure the following:
    1. Add the Perplexity AI API Key in the HTTP Request node under HTTP Header Authentication.
    2. If needed, update any IDs, emails, channels, or tables depending on your workflow connection.
    3. Confirm the Execute Workflow Trigger node is set to accept the query input.
    4. Copy any example queries you want to test into the input for manual run.
  5. Run a test execution to confirm the workflow gets a proper response.
  6. Activate the workflow with the toggle switch to start using in production.

Testing and Running

  1. Trigger the workflow manually or from another workflow by sending a question.
  2. The workflow will return the recent answer with citations.
  3. Use this output in your content, documents, or further automation.

Customization Ideas

  • Change parameters like temperature or max_tokens in the HTTP Request node for shorter or more creative answers.
  • Add more context messages by editing the Set node before the API call.
  • Allow image return by switching return_images to true if visual data needed.
  • Adjust search_recency_filter to week, month, or year for fresher or wider results.
  • Connect this workflow with other automation tasks using the trigger node.

Troubleshooting Common Issues

Authentication Failed in HTTP Request

The API Key might be missing or wrong in the HTTP Header Authentication.

Fix by adding the correct Perplexity API Key or generating a new one.

No Content in Extracted Message Field

The JSON path {{ $json.choices[0].message.content }} might have a typo.

Check and update the expression exactly as provided.

Workflow Not Triggering

The Execute Workflow Trigger might not be connected properly or lacks passthrough input.

Ensure the node is set to passthrough and other workflows send input correctly.


Pre-Production Checklist

  • Check the Perplexity API Key is valid and active.
  • Test the HTTP Request node alone with a sample query.
  • Make sure the User field in the Set node uses {{ $json.query }} dynamically.
  • Run the full workflow manually to confirm output is correct.
  • Consider adding error handling nodes for stability in production.

Deployment Guide

Enable the workflow in n8n after all configurations.

Trigger it manually or from other workflows to run research queries.

Watch execution logs in n8n to check for errors or issues.

Schedule triggers or API calls if needing automatic periodic research.


Summary

✓ Saves time by automating research queries.

✓ Provides recent, cited, focused answers.

✓ Easy to use inside n8n by importing and configuring API keys.

✓ Fits writers, researchers, or knowledge workers needing faster info.

→ Makes researching simple and efficient.

→ Outputs clean, usable answers for other automation.


Code and Prompt Sample

The HTTP Request node sends this JSON payload to Perplexity API:

{
  "model": "sonar",
  "messages": [
    { "role": "system", "content": "{{ $json.System }}" },
    { "role": "user", "content": "{{ $json.User }}" }
  ],
  "max_tokens": 4000,
  "temperature": 0.2,
  "top_p": 0.9,
  "return_citations": true,
  "search_domain_filter": ["perplexity.ai"],
  "return_images": false,
  "return_related_questions": false,
  "search_recency_filter": "month",
  "top_k": 0,
  "stream": false,
  "presence_penalty": 0,
  "frequency_penalty": 1
}

Use the expression {{ $json.query }} to pass the research question dynamically.

After receiving response, extract content:

{{ $json.choices[0].message.content }}


Automate research with Perplexity AI in n8n

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The input is a text query sent as JSON with the key ‘query’ to the Execute Workflow Trigger node.
The workflow uses the Perplexity AI API with a search recency filter set to ‘month’ to get information from the last month.
The API Key must be set in the HTTP Header Authentication section of the HTTP Request node.
Use the expression ‘{{ $json.choices[0].message.content }}’ in a Set node to extract the answer text.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.