Automate content generation using Perplexity's powerful Sonar models. This reusable n8n workflow template handles API calls, dynamic prompting, and secure authentication.
Download this n8n workflow template and start using it instantly.
This n8n workflow template solves the complexity of integrating external LLM APIs by wrapping the Perplexity API call into a clean, modular structure. Designed specifically as a sub-workflow, it accepts required system and user prompts, handles the necessary JSON body construction, and ensures secure authentication using HTTP headers. This reusable design dramatically simplifies maintenance and allows you to call the LLM service from any other parent n8n workflow using the "Execute Workflow" n8n node, ensuring separation of concerns and robust error handling across your main n8n automation.
The execution of this robust n8n workflow starts with the When Executed by Another Workflow n8n trigger. This trigger is configured to receive two critical inputs: SystemPrompt (to define the AI's behavior) and UserPrompt (the specific instruction).
Parameters n8n node immediately sets the desired Perplexity model, defaulting to sonar. This value is easily changeable to sonar-pro if required.Perplexity API Request n8n node (an HTTP Request node). This n8n node constructs the complex JSON payload required by the Perplexity /chat/completions endpoint. It securely injects the defined model name and maps the incoming SystemPrompt and UserPrompt into the standardized messages array.To use this powerful n8n workflow template, follow these steps:
Perplexity API Request n8n node, select Authentication: Generic Credential Type.Authorization. The Header Value should be your Perplexity API Key, usually prefixed with Bearer (e.g., Bearer pp-xxxxxxxx).SystemPrompt and UserPrompt test data. When Executed by Another Workflow (n8n trigger):
Function: Serves as the entry point, enabling this n8n workflow to function as a reusable API module callable from any other n8n workflow.
Key Configuration: Defines two required inputs: SystemPrompt and UserPrompt.
Parameters (Set n8n node):
Function: Sets a static variable (model) for the LLM model used in the API call, ensuring easy configuration.
Key Configuration: Sets the field model to the default value of sonar.
Perplexity API Request (HTTP Request n8n node):
Function: Executes the core action: sending the secure chat completion request to the Perplexity API endpoint.
Key Configuration:
Method: POST.
Body: Dynamic JSON construction, referencing the model from the Parameters n8n node and the two prompts from the n8n trigger to form the message payload.
Authentication: Uses HTTP Header Auth for secure API key management, a vital security measure for this n8n automation.
Generate automated Meta Ads performance reports using the powerful n8n workflow, Anthropic Claude 4, and Pipeboard MCP. This specialized n8n node setup delivers deep, AI-driven insights directly to Slack, leveraging the schedule n8n trigger.

Use this specialized n8n workflow to automatically generate, categorize, and structure high-quality AI prompts using the Google Gemini model, storing them efficiently in an Airtable database.

Automate short social media video production using this powerful n8n workflow. Integrates GPT-4o, Fal.ai image/video generation, Cloudinary, and gotoHuman for critical human review steps, ensuring quality.

Use this powerful n8n workflow to automate sales outreach personalization. Scrape website data with Firecrawl, generate tailored GPT-4o pitches, and update Google Sheets automatically. Deploy faster with n8n templates.

Automate sales proposals end-to-end using n8n, Azure OpenAI, PandaDoc, and Slack. Use this n8n workflow to generate structured documents, manage approvals, and automate CRM updates.









































