{
  "name": "RenderHub: AI Agent / Markdown Report to Branded PDF",
  "nodes": [
    {
      "parameters": {},
      "id": "b2c3d4e5-0002-4000-8000-000000000001",
      "name": "Manual / AI Agent Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [220, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "field-title",
              "name": "title",
              "value": "Weekly AI Operations Brief",
              "type": "string"
            },
            {
              "id": "field-subtitle",
              "name": "subtitle",
              "value": "Automated Markdown-to-PDF Report via RenderHub",
              "type": "string"
            },
            {
              "id": "field-author",
              "name": "author",
              "value": "n8n AI Pipeline",
              "type": "string"
            },
            {
              "id": "field-markdown",
              "name": "markdown",
              "value": "# Executive Summary\n\nAll automated pipelines operated with **99.98% uptime**.\n\n| Metric | Current | Target |\n| :--- | ---: | ---: |\n| Invoices Rendered | 1,420 | 1,200 |\n| Median Latency | 410ms | <600ms |\n\n> Replace this field with `{{ $json.output }}` from an OpenAI / Claude AI Agent node.",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "b2c3d4e5-0002-4000-8000-000000000002",
      "name": "Prepare Markdown Report",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [460, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://render.softwarehub.vn/v1/markdown-pdf",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_RENDERHUB_API_KEY"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"title\": {{ JSON.stringify($json.title) }},\n  \"subtitle\": {{ JSON.stringify($json.subtitle) }},\n  \"author\": {{ JSON.stringify($json.author) }},\n  \"markdown\": {{ JSON.stringify($json.markdown) }},\n  \"theme\": \"executive\",\n  \"format\": \"A4\",\n  \"pageNumbers\": true,\n  \"responseFormat\": \"json\"\n}",
        "options": {
          "timeout": 30000
        }
      },
      "id": "b2c3d4e5-0002-4000-8000-000000000003",
      "name": "Render Markdown to PDF",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [720, 300]
    },
    {
      "parameters": {
        "mode": "jsonToBinary",
        "convertAllData": false,
        "sourceKey": "base64",
        "destinationKey": "data",
        "options": {
          "encoding": "base64",
          "fileName": "={{ $json.filename || 'renderhub-document.pdf' }}",
          "mimeType": "={{ $json.contentType || 'application/pdf' }}"
        }
      },
      "id": "b2c3d4e5-0002-4000-8000-000000000004",
      "name": "Move Binary Data",
      "type": "n8n-nodes-base.moveBinaryData",
      "typeVersion": 1.1,
      "position": [980, 300]
    }
  ],
  "pinData": {},
  "connections": {
    "Manual / AI Agent Trigger": {
      "main": [
        [
          {
            "node": "Prepare Markdown Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Markdown Report": {
      "main": [
        [
          {
            "node": "Render Markdown to PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Render Markdown to PDF": {
      "main": [
        [
          {
            "node": "Move Binary Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1.0.0",
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "renderhub-n8n-blueprint-markdown"
  },
  "tags": ["renderhub", "markdown", "ai-agent", "pdf"]
}
