{
  "name": "Content Brief Agent",
  "nodes": [
    {
      "parameters": {},
      "id": "5597b5cc-24a2-4156-9300-048c7e8c9692",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        220,
        320
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "agent_slug",
              "value": "content-brief-agent"
            },
            {
              "name": "agent_title",
              "value": "Content Brief Agent"
            },
            {
              "name": "agent_description",
              "value": "Erstellt SEO- und conversion-orientierte Content-Briefs f\u00fcr Blogartikel oder Landingpages."
            },
            {
              "name": "system_prompt",
              "value": "Du bist ein hochspezialisierter Business-Agent. Arbeite pr\u00e4zise, strukturiert, umsetzungsorientiert und ohne Halluzinationen. Nutze ausschlie\u00dflich die bereitgestellten Eingaben. Wenn Daten fehlen oder unsicher sind, markiere sie explizit als offen. Antworte standardm\u00e4\u00dfig auf Deutsch, au\u00dfer die Eingabe verlangt etwas anderes. Liefere Ergebnisse so, dass ein Team sie direkt weiterverwenden kann.\n\nRolle: Content Brief Agent. Aufgabe: Erstellt SEO- und conversion-orientierte Content-Briefs f\u00fcr Blogartikel oder Landingpages. Arbeite immer in diesem Output-Rahmen: Article angle, Target audience, Search intent, Proposed H1/H2, Questions to answer, Internal link ideas, CTA strategy."
            },
            {
              "name": "task",
              "value": "Erstelle einen vollst\u00e4ndigen Content-Brief f\u00fcr einen Autor oder Copywriter."
            },
            {
              "name": "goal",
              "value": "Redaktion und SEO mit einem klaren Briefing versorgen."
            },
            {
              "name": "context",
              "value": "Zielgruppe: Gesch\u00e4ftsf\u00fchrer von KMU im DACH-Raum. Thema: AI Automatisierung. Tone of voice: kompetent, klar, modern."
            },
            {
              "name": "input_data",
              "value": "{\n  \"primary_keyword\": \"KI Agenten im Kundenservice\",\n  \"secondary_keywords\": [\n    \"AI Support Automation\",\n    \"Kundenservice automatisieren\",\n    \"n8n AI Agent\"\n  ],\n  \"search_intent\": \"commercial informational\",\n  \"target_length_words\": 1800,\n  \"target_country\": \"DE/AT/CH\",\n  \"cta\": \"Kostenloses Strategiegespr\u00e4ch buchen\"\n}"
            },
            {
              "name": "output_format",
              "value": "Markdown mit klaren \u00dcberschriften und Bulletpoints"
            },
            {
              "name": "output_schema",
              "value": "\n- Article angle\n- Target audience\n- Search intent\n- Proposed H1/H2\n- Questions to answer\n- Internal link ideas\n- CTA strategy"
            },
            {
              "name": "extra_rules",
              "value": "Kein Keyword-Stuffing. Fokus auf Praxisbezug und Conversion."
            },
            {
              "name": "sample_customer_value",
              "value": "Dieser Agent erstellt einen vollst\u00e4ndigen SEO-Content-Brief."
            }
          ]
        }
      },
      "id": "573a1ed1-5fd5-4180-b75d-3582825ec131",
      "name": "Set Agent Input",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        480,
        320
      ]
    },
    {
      "parameters": {
        "jsCode": "const user_message = `Aufgabe: ${$json.task}\n\nZiel: ${$json.goal}\n\nKontext: ${$json.context}\n\nEingabedaten (JSON oder Text):\n${$json.input_data}\n\nErwartete Ausgabebausteine:\n${$json.output_schema}\n\nZusatzregeln:\n${$json.extra_rules}`;\n\nreturn [{\n  json: {\n    ...$json,\n    user_message,\n    import_note: 'Nach dem Import nur OPENAI_API_KEY bzw. HTTP Credential und optional OPENAI_MODEL anpassen.'\n  }\n}];"
      },
      "id": "78539126-e8a7-4d36-a2f7-33b57be1860b",
      "name": "Build Prompt",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        760,
        320
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/responses",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{$env.OPENAI_API_KEY}}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ model: $env.OPENAI_MODEL || 'gpt-4.1', instructions: $json.system_prompt, input: $json.user_message }) }}",
        "options": {}
      },
      "id": "b0f8346a-3b40-4034-a04d-cca4225eafe7",
      "name": "Call OpenAI Responses API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1040,
        320
      ]
    },
    {
      "parameters": {
        "jsCode": "const body = $json;\n                let text = '';\n                if (Array.isArray(body.output)) {\n                  for (const item of body.output) {\n                    if (Array.isArray(item.content)) {\n                      for (const c of item.content) {\n                        if (c.type === 'output_text' && c.text) text += c.text + '\n';\n                      }\n                    }\n                  }\n                }\n                return [{\n                  json: {\n                    agent: $('Set Agent Input').first().json.agent_title,\n                    result: text.trim(),\n                    raw_response: body\n                  }\n                }];"
      },
      "id": "2d75a4f7-8127-4888-b99b-c49ce8c9ca5e",
      "name": "Extract Result",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1300,
        320
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Set Agent Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Agent Input": {
      "main": [
        [
          {
            "node": "Build Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Prompt": {
      "main": [
        [
          {
            "node": "Call OpenAI Responses API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call OpenAI Responses API": {
      "main": [
        [
          {
            "node": "Extract Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "active": false,
  "versionId": "ec1658f1-7207-455d-b3ba-423bdcdbb904",
  "id": "d44d316e-d9ba-4b1b-a691-9ccb5d640099",
  "tags": [
    "ai",
    "template",
    "content-brief-agent"
  ]
}