Generate AI Responses with Perplexity Sonar Models (Reusable Module)
Workflow preview
$20/month : Unlimited workflows
2500 executions/month
THE #1 IN WEB SCRAPING
Scrape any website without limits
HOSTINGER
Early Deal
DISCOUNT 20% Try free
DISCOUNT 20%
Self-hosted n8n
Unlimited workflows - from $4.99/mo
#1 hub for scraping, AI & automation
6000+ actors - $5 credits/mo
Important notice
This workflow is provided as-is. Please review and test before using in production.
Overview
Perplexity API Module
This reusable workflow allows you to interact with the Perplexity API using the sonar or sonar-pro models. It is designed to be triggered from other workflows and accepts dynamic prompts via input parameters.
Features
- 🧱 Modular: Triggered using
Execute Workflowfrom any other workflow - 📥 Inputs:
SystemPrompt: Set your system-level instruction for the LLMUserPrompt: The main user prompt for the conversation
- 🧠 Uses Perplexity’s
chat/completionsendpoint - 🔐 Built with API authentication in mind (Bearer token or header auth)
- 🔁 Easily extendable for any model in the Perplexity suite
Models supported
sonarsonar-pro
See full model list and capabilities
Usage
- Set up your credentials in n8n under HTTP Bearer or Header Auth.
- Add this workflow as a subworkflow using the “Execute Workflow” node.
- Pass the desired
SystemPromptandUserPromptas input variables. - Receive the model response in return.
Notes
- This template is inactive by default and safe to import.
- Includes sticky notes with API references and model info.