{
  "name": "Generate AI Responses with Perplexity Sonar Models (Reusable Module)",
  "nodes": [
    {
      "id": "33f3c51d-45f0-4c2b-9981-a413ae50772e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        -520
      ],
      "parameters": {
        "width": 980,
        "height": 240,
        "content": "## 🔍 Perplexity API Integration\n\nThis workflow sends a request to Perplexity’s chat completion API using the `sonar` or `sonar-pro` model.\n\n➡️ Triggered via \"Execute Workflow\"  \n📤 Accepts dynamic `Sys"
      }
    },
    {
      "id": "19797db1-b7bb-47c9-b13f-983639639309",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "58674959-f4bb-4bae-a6cd-600059072b6b",
      "name": "Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        0
      ]
    },
    {
      "id": "cf181e63-9a9b-4ab0-a4cf-cf8e8ceba85f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -260
      ],
      "parameters": {
        "width": 330,
        "height": 240,
        "content": "## 🧠 Supported Models\n\n- `sonar`\n- `sonar-pro`\n\n📘 [Model cards and capabilities](https://docs.perplexity.ai/models/model-cards)\n\nTo switch models, change the `\"model\"` value in the **Parameters** node"
      }
    },
    {
      "id": "aed49866-4b61-4170-aafb-7c70b2312a3a",
      "name": "Perplexity API Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        460,
        0
      ]
    },
    {
      "id": "0ae885d9-e8bf-4974-9741-46875836e6d7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        -260
      ],
      "parameters": {
        "width": 380,
        "height": 460,
        "content": "## 🧩 Input Parameters\n\nThis workflow expects **two inputs** when triggered from another workflow:\n\n- `SystemPrompt` 🧠  \n  → Sets the system message (e.g., behavior or tone) for the LLM.\n\n- `UserPrompt"
      }
    }
  ],
  "connections": {
    "Parameters": {
      "main": [
        [
          {
            "node": "Perplexity API Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Perplexity API Request": {
      "main": [
        []
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}