Module de publication Perplexity (Sonar)

Intermédiaire

Ceci est unBuilding Blocks, AIworkflow d'automatisation du domainecontenant 6 nœuds.Utilise principalement des nœuds comme Set, HttpRequest, ExecuteWorkflowTrigger, combinant la technologie d'intelligence artificielle pour une automatisation intelligente. Générer des réponses IA réutilisables avec le modèle Perplexity Sonar

Prérequis
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "YUOkKLDiARiuwpTP",
  "meta": {
    "instanceId": "a178adf4fc552be53aea873908ce86641ce2cc90fc0083d4c400639e377ba9d2",
    "templateCredsSetupCompleted": true
  },
  "name": "Perplexity(sonar) for publication",
  "tags": [],
  "nodes": [
    {
      "id": "33f3c51d-45f0-4c2b-9981-a413ae50772e",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        -520
      ],
      "parameters": {
        "color": 4,
        "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 `SystemPrompt` and `UserPrompt`  \n🔐 Supports Header Auth\n\n📘 [API Docs](https://docs.perplexity.ai/api-reference/async-chat-completions-post)"
      },
      "typeVersion": 1
    },
    {
      "id": "19797db1-b7bb-47c9-b13f-983639639309",
      "name": "Lorsqu'exécuté par un autre workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "SystemPrompt"
            },
            {
              "name": "UserPrompt"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "58674959-f4bb-4bae-a6cd-600059072b6b",
      "name": "Paramètres",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "18e5ccd4-5538-4ace-9957-00a2c0c43518",
              "name": "model",
              "type": "string",
              "value": "sonar"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "cf181e63-9a9b-4ab0-a4cf-cf8e8ceba85f",
      "name": "Note adhésive1",
      "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."
      },
      "typeVersion": 1
    },
    {
      "id": "aed49866-4b61-4170-aafb-7c70b2312a3a",
      "name": "Requête Perplexity API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        460,
        0
      ],
      "parameters": {
        "url": "https://api.perplexity.ai/chat/completions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"{{$('Parameters').item.json.model}}\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"{{ $('When Executed by Another Workflow').item.json.SystemPrompt }}\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"{{ $('When Executed by Another Workflow').item.json.UserPrompt }}\"\n    }\n  ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "0ae885d9-e8bf-4974-9741-46875836e6d7",
      "name": "Note adhésive2",
      "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` 💬  \n  → The main user question or instruction for the model.\n\n📌 These inputs are used to construct the `messages` array for the Perplexity API.\n\nYou can pass them via the “Execute Workflow” node in your parent workflow."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a1639271-f212-461b-b661-b0ecad7e9ebb",
  "connections": {
    "58674959-f4bb-4bae-a6cd-600059072b6b": {
      "main": [
        [
          {
            "node": "aed49866-4b61-4170-aafb-7c70b2312a3a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "aed49866-4b61-4170-aafb-7c70b2312a3a": {
      "main": [
        []
      ]
    },
    "19797db1-b7bb-47c9-b13f-983639639309": {
      "main": [
        [
          {
            "node": "58674959-f4bb-4bae-a6cd-600059072b6b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Intermédiaire - Blocs de construction, Intelligence Artificielle

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Intermédiaire
Nombre de nœuds6
Catégorie2
Types de nœuds4
Description de la difficulté

Adapté aux utilisateurs expérimentés, avec des workflows de complexité moyenne contenant 6-15 nœuds

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34