{
  "name": "Bitavu Generate PDF playground",
  "nodes": [
    {
      "parameters": {
        "content": "# Bitavu PDF playground\n\nUse a key with access to your report in the **Bitavu API** credential. On the key, enable **Generate PDFs** to render and **Read templates** to load the template and version pickers.\n\nThis example uses **Studio invoice**, pinned to version 1. Pick your template and version **From List** and update the data if needed.\n\nRun the workflow and open **Generate PDF → Binary → pdf** to download the file.",
        "width": 432,
        "height": 336,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -496,
        -64
      ],
      "id": "e02ad026-a2fd-4bf8-aaaa-ce7d680c4ed6",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Manual Trigger\n\nRuns the PDF example.",
        "width": 216,
        "height": 384,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -64
      ],
      "id": "e3782b18-ad62-4fdb-9cf3-02cfed62ff42",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Set Custom Fields\n\nSupplies fictional invoice data in the `data` object.",
        "width": 216,
        "height": 384,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        240,
        -64
      ],
      "id": "e40d4d8d-1c99-4129-ad3d-15bb2c219fff",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## Generate PDF\n\nFills the saved template with the incoming data and returns the PDF.",
        "width": 352,
        "height": 384,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        480,
        -64
      ],
      "id": "0c27e2cd-5af8-4784-819b-9c9e2840fcb3",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "content": "## Optional template actions\n\nConnect one separately when you need to browse templates, read a version or save example JSON.",
        "width": 1008,
        "height": 288,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        368
      ],
      "id": "53b97a4d-c17a-4df4-9b31-0ae0260f2828",
      "name": "Sticky Note4"
    },
    {
      "parameters": {},
      "id": "460fa940-20c0-431e-a9ca-406788bddaa5",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        48,
        176
      ]
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "{\n  \"data\": {\n    \"notes\": \"Example notes\",\n    \"items\": [\n      {\n        \"quantity\": 1,\n        \"unitPrice\": 1,\n        \"description\": \"Example description\"\n      }\n    ],\n    \"invoice\": {\n      \"due\": \"2026-10-08\",\n      \"date\": \"2026-10-08\",\n      \"number\": \"Example number\"\n    },\n    \"client\": {\n      \"name\": \"Example name\",\n      \"address\": \"Example address\"\n    }\n  }\n}",
        "options": {}
      },
      "id": "d6c0d8b5-96d6-4525-bebc-ae0c7f761b71",
      "name": "Set Custom Fields",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.5,
      "position": [
        288,
        176
      ]
    },
    {
      "parameters": {
        "templateId": {
          "__rl": true,
          "mode": "list",
          "value": "invoice",
          "cachedResultName": "Studio invoice"
        },
        "versionSelection": "pinned",
        "revision": {
          "__rl": true,
          "mode": "list",
          "value": "1",
          "cachedResultName": "Version 1"
        },
        "data": "={{ $json.data }}",
        "options": {}
      },
      "id": "9cd297ea-fc19-4941-91d8-adc2d18d5b6f",
      "name": "Generate PDF",
      "type": "@bitavu/n8n-nodes-bitavu.bitavu",
      "typeVersion": 1,
      "position": [
        528,
        176
      ]
    },
    {
      "parameters": {},
      "id": "c75bd696-01b5-4761-96d8-0a6c85949206",
      "name": "List Templates",
      "type": "@bitavu/n8n-nodes-bitavu.bitavuListTemplates",
      "typeVersion": 1,
      "position": [
        48,
        512
      ]
    },
    {
      "parameters": {
        "templateId": {
          "__rl": true,
          "mode": "id",
          "value": "invoice"
        },
        "versionOptions": {}
      },
      "id": "41c39204-646e-44a9-b8ac-b5bd1854836e",
      "name": "List Template Versions",
      "type": "@bitavu/n8n-nodes-bitavu.bitavuListTemplateVersions",
      "typeVersion": 1,
      "position": [
        288,
        512
      ]
    },
    {
      "parameters": {
        "templateId": {
          "__rl": true,
          "mode": "id",
          "value": "invoice"
        },
        "templateRevision": {
          "__rl": true,
          "mode": "number",
          "value": "1"
        }
      },
      "id": "ac0bf49d-5449-4f0b-83a9-7da73008812e",
      "name": "Get Template Version",
      "type": "@bitavu/n8n-nodes-bitavu.bitavuGetTemplateVersion",
      "typeVersion": 1,
      "position": [
        528,
        512
      ]
    },
    {
      "parameters": {
        "templateId": {
          "__rl": true,
          "mode": "id",
          "value": "invoice"
        }
      },
      "id": "b9b282b2-ed03-4a12-8b81-2349679f57bc",
      "name": "Save Template Example",
      "type": "@bitavu/n8n-nodes-bitavu.bitavuSaveTemplateExample",
      "typeVersion": 1,
      "position": [
        768,
        512
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Set Custom Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Custom Fields": {
      "main": [
        [
          {
            "node": "Generate PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false,
  "pinData": {},
  "tags": []
}
