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

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

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 }}


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 Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free