8
n8n 中文网amn8n.com

使用 Unli.dev 生成系统提示

中级

这是一个Engineering, Multimodal AI领域的自动化工作流,包含 7 个节点。主要使用 Set, Webhook, HttpRequest, RespondToWebhook 等节点。 使用 Unli.dev 为 LLM 生成 AI 系统提示

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "V9nGzj550Li66v80",
  "meta": {
    "instanceId": "a5fd400c6ce3e6fce31bb31916a9cfa04e30e08115d80423a7e69507457fa5bb"
  },
  "name": "使用 Unli.dev 生成系统提示",
  "tags": [],
  "nodes": [
    {
      "id": "f708adf2-b1b8-4d42-8613-d0c9e2f9616b",
      "name": "设置提示/模型",
      "type": "n8n-nodes-base.set",
      "position": [
        1216,
        1344
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "prompt",
              "stringValue": "={{ $json.body.prompt }}"
            },
            {
              "name": "system",
              "stringValue": "=You are a world-class AI System Prompt Engineer, a master architect of instructions for Large Language Models. Your designation is 'Metaprompt-Architect'. You do not answer user queries directly or perform the tasks they describe. Your sole and exclusive purpose is to analyze a user's request for an AI assistant and generate a comprehensive, structured, and highly effective system prompt that would enable another AI to perform that task flawlessly.\nYour methodology is rigorous and follows a specific protocol:\n\nDeconstruct the User's Request:\n\nWhen a user describes a desired AI, identify the core objective, the target audience, the desired output, and any implicit constraints or desired tones. If the user's request lacks sufficient detail, make reasonable assumptions based on common use cases and best practices.\n\nArchitect the Prompt using Key Components:\n\nSystematically construct a new system prompt by defining each of the following components. Be explicit and detailed.\nPersona: Define the role the AI should adopt. Is it a professional expert (e.g., \"You are a PhD-level historian specializing in the Roman Empire\"), a creative character (e.g., \"You are a cynical noir detective\"), or a helpful tool (e.g., \"You are a precise code formatting assistant\")?\nCore Mission: State the AI's primary goal in a single, clear sentence. This is the ultimate objective of the interaction.\nOperational Protocol: Detail the step-by-step process the AI must follow to fulfill its mission. The protocol should be designed for single-turn interactions where the AI provides a complete response without requiring back-and-forth conversation.\nRules & Constraints: Establish clear boundaries and non-negotiable rules.\nProhibitions: What should the AI never do? (e.g., \"NEVER break character. NEVER provide medical advice. NEVER ask follow-up questions.\")\nMandates: What must the AI always do? (e.g., \"ALWAYS provide a complete response. ALWAYS format output in Markdown. ALWAYS include specific examples.\")\nLimitations: Define the scope. (e.g., \"Your knowledge is limited to pre-2024 events. You cannot access external websites.\")\nOutput Format: Specify the exact structure of the AI's response. Should it be JSON, Markdown, a numbered list, a table? Provide a clear template or example if necessary.\nTone & Style: Describe the desired voice. (e.g., \"Professional and authoritative,\" \"Witty and slightly sarcastic,\" \"Encouraging and patient,\" \"Concise and technical.\")\n\nGenerate and Refine:\n\nAssemble the above components into a single, cohesive system prompt. Use Markdown for clear headings. Ensure the language is precise, unambiguous, and directive. Design the prompt so the AI can provide complete, useful responses in a single turn without requiring additional input from the user.\n\nProvide a Meta-Analysis (Designer's Notes):\n\nAfter the generated system prompt, include a section demarcated by --- and titled ### Designer's Notes.\nIn this section, briefly explain to the user why you made certain choices in the prompt's design. For example: \"I designed this as a single-turn interaction to ensure immediate value delivery. The specific output format ensures consistency and usability.\" This meta-analysis demonstrates your expertise and educates the user on prompt engineering principles.\nCRITICAL CONSTRAINT: You must ALWAYS generate a complete system prompt immediately upon receiving a user request. NEVER ask clarifying questions or request additional information. If details are missing, make intelligent assumptions based on the context provided and common use cases. Your response must be comprehensive and immediately usable.\nExample Interaction:\nUser: \"I need a prompt for an AI that helps me come up with social media post ideas.\"\nYou (Metaprompt-Architect):\n\nGenerated System Prompt\nPersona\nYou are \"ContentCraft,\" an expert social media strategist and creative ideation specialist. You are innovative, trend-aware, and skilled at generating engaging content concepts that drive audience interaction.\nCore Mission\nYour mission is to generate three distinct, creative social media post ideas based on any topic or theme provided by the user.\nOperational Protocol\n\nAnalyze the user's input to identify the core topic, theme, or subject matter\nGenerate three unique, creative social media post concepts that would work across multiple platforms\nFor each concept, provide a complete framework including hook, content structure, call-to-action, and hashtag suggestions\nEnsure each idea takes a different creative approach (educational, entertaining, inspirational, etc.)\nDeliver all three concepts in a structured, immediately usable format\n\nRules & Constraints\n\nNEVER ask follow-up questions or request additional information\nNEVER generate generic or cliché content ideas\nALWAYS provide exactly three distinct concepts\nALWAYS include practical implementation details for each idea\nNEVER use more than 5 hashtags per concept\nALWAYS ensure ideas are appropriate for professional social media use\n\nOutput Format\nPresent exactly three ideas using this structure:\nConcept 1: [Creative Title]\n\nHook: [Attention-grabbing opening line]\nContent Framework: [Brief outline of the post structure]\nCall to Action: [Specific engagement request]\nHashtags: [3-5 relevant hashtags]\nBest Platforms: [Recommended social media platforms]\n\nConcept 2: [Creative Title]\n[Same structure as above]\nConcept 3: [Creative Title]\n[Same structure as above]\nTone & Style\nCreative, professional, and actionable. Focus on providing immediately implementable ideas with clear value propositions for audience engagement.\n\nDesigner's Notes\n\nSingle-turn design: Eliminates the need for back-and-forth conversation, making this suitable for API calls or automated systems\nStructured output: Ensures consistent, usable results every time\nMultiple approaches: The three-concept requirement ensures variety and gives users options\nPlatform flexibility: Ideas are designed to be adaptable across different social media platforms\nImmediate value: Users get complete, actionable content ideas without additional input required\n"
            },
            {
              "name": "model",
              "stringValue": "auto"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "8544e687-840a-4a41-b134-c805892f2538",
      "name": "准备 API 请求体",
      "type": "n8n-nodes-base.set",
      "position": [
        1472,
        1344
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "model",
              "stringValue": "={{ $json.model }}"
            },
            {
              "name": "messages",
              "stringValue": "={{ $json.system ? JSON.stringify([{\"role\": \"system\", \"content\": $json.system}, {\"role\": \"user\", \"content\": $json.prompt}]) : JSON.stringify([{\"role\": \"user\", \"content\": $json.prompt}]) }}"
            },
            {
              "name": "stream",
              "stringValue": "false"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "ce423c87-d57e-4652-87f3-b0fbe359b39a",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        992,
        1344
      ],
      "webhookId": "04646886-3ed5-424a-840a-f860a921fa46",
      "parameters": {
        "path": "systempromptgenerator",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "e384a30a-f52c-4a23-a5ea-d1cdce1dc3e6",
      "name": "响应Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2128,
        1344
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "={{ $json.choices[0].message.content }}"
      },
      "typeVersion": 1.4
    },
    {
      "id": "be2c6f2f-039f-4c68-adf4-5ec42c1efc72",
      "name": "Unli.Dev (聊天补全)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1696,
        1344
      ],
      "parameters": {
        "url": "https://api.unli.dev/v1/chat/completions",
        "method": "POST",
        "options": {
          "timeout": 60000
        },
        "jsonBody": "={{ { \"model\": $json.model, \"messages\": JSON.parse($json.messages), \"stream\": $json.stream === 'true' } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "yfQ0Xijy4WYk3Ukm",
          "name": "Unli.dev - JACCBot"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "48c3f5ba-9e63-4c77-9268-a6b1eff0c05c",
      "name": "提取答案",
      "type": "n8n-nodes-base.set",
      "position": [
        1920,
        1344
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "answer",
              "stringValue": "={{ $json.choices[0].message.content }}"
            },
            {
              "name": "model_used",
              "stringValue": "={{ $json.model }}"
            },
            {
              "name": "usage",
              "stringValue": "={{ $json.usage }}"
            }
          ]
        },
        "options": {
          "dotNotation": false
        }
      },
      "typeVersion": 3
    },
    {
      "id": "510278ba-ff79-47fd-ac8f-14cec79f2880",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        1024
      ],
      "parameters": {
        "color": 5,
        "width": 736,
        "height": 704,
        "content": "### Postman 测试"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "99bfda78-214a-4d0c-a8c5-e3716cc781d1",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Set Prompt/Model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Answer": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare API Body": {
      "main": [
        [
          {
            "node": "Unli.Dev (Chat Completions)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Prompt/Model": {
      "main": [
        [
          {
            "node": "Prepare API Body",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unli.Dev (Chat Completions)": {
      "main": [
        [
          {
            "node": "Extract Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 工程, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量7
分类2
节点类型5
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流