Perplexity(Sonar)公開モジュール
中級
これはBuilding Blocks, AI分野の自動化ワークフローで、6個のノードを含みます。主にSet, HttpRequest, ExecuteWorkflowTriggerなどのノードを使用、AI技術を活用したスマート自動化を実現。 Perplexity Sonar モデル でAI応答生成(再利用可能モジュール)
前提条件
- •ターゲットAPIの認証情報が必要な場合あり
カテゴリー
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "YUOkKLDiARiuwpTP",
"meta": {
"instanceId": "a178adf4fc552be53aea873908ce86641ce2cc90fc0083d4c400639e377ba9d2",
"templateCredsSetupCompleted": true
},
"name": "Perplexity(sonar) for publication",
"tags": [],
"nodes": [
{
"id": "33f3c51d-45f0-4c2b-9981-a413ae50772e",
"name": "付箋",
"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": "他ワークフロー実行時",
"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": "パラメータ",
"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": "付箋1",
"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": "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": "付箋2",
"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
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - ビルディングブロック, 人工知能
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
Anthropic Claude API を使用したバッチプロンプト処理
Anthropic Claude API を使ってプロンプトをバッチ処理
If
Set
Code
+
If
Set
Code
39 ノードGreg Evseev
ビルディングブロック
Mistral での音声文字起こし
Googleカレンダーとカスタム関数を使用してMCPサーバーを構築
Set
Switch
Debug Helper
+
Set
Switch
Debug Helper
32 ノードSolomon
ビルディングブロック
YouTube MCP サーバーのカスタム構築
カスタム YouTube MCP サーバーの構築
Set
Switch
Aggregate
+
Set
Switch
Aggregate
20 ノードJimleuk
ビルディングブロック
API MCP サーバーのカスタム構築
カスタム API MCP サーバーの構築
If
Set
Filter
+
If
Set
Filter
25 ノードJimleuk
エンジニアリング
GitHub MCP サーバーのカスタム構築
カスタム GitHub MCP サーバーの構築
Set
Github
Switch
+
Set
Github
Switch
19 ノードJimleuk
エンジニアリング
カスタムQdrantベクタース토アMCPサーバーを構築
カスタムQdrantベクターストアMCPサーバーを構築する
If
Set
Code
+
If
Set
Code
44 ノードJimleuk
ビルディングブロック