{
  "name": "Invoice to PDF Report",
  "nodes": [
    {
      "parameters": {
        "content": "## Invoice to PDF Report\n\nFinance teams and invoice processing platforms use this recipe to automate the extract-to-report pipeline. Upload an invoice, extract structured data with confidence scores, and generate a branded PDF summary \u2014 all through two API calls.\n\n**Note:** This workflow uses the Iteration Layer community node (`n8n-nodes-iterationlayer`). Install it via Settings > Community Nodes on self-hosted n8n, or add it directly on n8n Cloud with Verified Community Nodes enabled.",
        "height": 280,
        "width": 500,
        "color": 2
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        200,
        40
      ],
      "id": "cb1571ce-e625-45bf-9316-2617d43d6880",
      "name": "Overview"
    },
    {
      "parameters": {
        "content": "### Step 1: Extract Invoice Data\nResource: **Document Extraction**\n\nConfigure the Document Extraction parameters below, then connect your credentials.",
        "height": 160,
        "width": 300,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        475,
        100
      ],
      "id": "f226bc1b-1ad5-4dad-9e7f-d4245823f4d4",
      "name": "Step 1 Note"
    },
    {
      "parameters": {
        "content": "### Step 2: Generate PDF Report\nResource: **Document Generation**\n\nConfigure the Document Generation parameters below, then connect your credentials.",
        "height": 160,
        "width": 300,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        725,
        100
      ],
      "id": "b2f28ece-0a45-4498-86de-232f2763fce4",
      "name": "Step 2 Note"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ],
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Manual Trigger"
    },
    {
      "parameters": {
        "resource": "documentExtraction",
        "schemaInputMode": "rawJson",
        "schemaJson": "[\n  {\n    \"name\": \"invoice_number\",\n    \"type\": \"TEXT\",\n    \"description\": \"The unique invoice identifier\"\n  },\n  {\n    \"name\": \"vendor_name\",\n    \"type\": \"TEXT\",\n    \"description\": \"Name of the vendor or supplier\"\n  },\n  {\n    \"name\": \"invoice_date\",\n    \"type\": \"DATE\",\n    \"description\": \"Date the invoice was issued\"\n  },\n  {\n    \"name\": \"line_items\",\n    \"type\": \"ARRAY\",\n    \"description\": \"List of line items on the invoice\",\n    \"children\": [\n      {\n        \"name\": \"item_description\",\n        \"type\": \"TEXT\",\n        \"description\": \"Description of the line item\"\n      },\n      {\n        \"name\": \"amount\",\n        \"type\": \"CURRENCY_AMOUNT\",\n        \"description\": \"Amount for this line item\"\n      }\n    ]\n  },\n  {\n    \"name\": \"total_amount\",\n    \"type\": \"CURRENCY_AMOUNT\",\n    \"description\": \"Total invoice amount\"\n  }\n]",
        "files": {
          "fileValues": [
            {
              "inputMode": "url",
              "fileUrl": "https://example.com/invoices/2026-001.pdf"
            }
          ]
        }
      },
      "type": "n8n-nodes-iterationlayer.iterationLayer",
      "typeVersion": 1,
      "position": [
        500,
        300
      ],
      "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
      "name": "Extract Invoice Data",
      "credentials": {
        "iterationLayerApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "documentGeneration",
        "format": "pdf",
        "documentJson": "{\n  \"pages\": [\n    {\n      \"width_in_pt\": 595,\n      \"height_in_pt\": 842,\n      \"blocks\": [\n        {\n          \"type\": \"paragraph\",\n          \"text\": \"Invoice Report\",\n          \"font_size_in_pt\": 28,\n          \"font_weight\": \"bold\",\n          \"color\": \"#1a1a1a\",\n          \"margin_top_in_pt\": 60,\n          \"margin_left_in_pt\": 50,\n          \"margin_right_in_pt\": 50\n        },\n        {\n          \"type\": \"paragraph\",\n          \"text\": \"Invoice #{{ $json.invoice_number }} \u2014 {{ $json.vendor_name }}\",\n          \"font_size_in_pt\": 14,\n          \"color\": \"#444444\",\n          \"margin_top_in_pt\": 20,\n          \"margin_left_in_pt\": 50,\n          \"margin_right_in_pt\": 50\n        },\n        {\n          \"type\": \"paragraph\",\n          \"text\": \"Date: {{ $json.invoice_date }}\",\n          \"font_size_in_pt\": 12,\n          \"color\": \"#666666\",\n          \"margin_top_in_pt\": 8,\n          \"margin_left_in_pt\": 50,\n          \"margin_right_in_pt\": 50\n        },\n        {\n          \"type\": \"table\",\n          \"margin_top_in_pt\": 30,\n          \"margin_left_in_pt\": 50,\n          \"margin_right_in_pt\": 50,\n          \"columns\": [\n            {\n              \"header\": \"Description\",\n              \"width_fraction\": 0.7\n            },\n            {\n              \"header\": \"Amount\",\n              \"width_fraction\": 0.3,\n              \"align\": \"right\"\n            }\n          ],\n          \"rows\": \"{{ $json.line_items }}\"\n        },\n        {\n          \"type\": \"paragraph\",\n          \"text\": \"Total: {{ $json.total_amount }}\",\n          \"font_size_in_pt\": 16,\n          \"font_weight\": \"bold\",\n          \"color\": \"#1a1a1a\",\n          \"margin_top_in_pt\": 20,\n          \"margin_left_in_pt\": 50,\n          \"margin_right_in_pt\": 50,\n          \"text_align\": \"right\"\n        }\n      ]\n    }\n  ]\n}"
      },
      "type": "n8n-nodes-iterationlayer.iterationLayer",
      "typeVersion": 1,
      "position": [
        750,
        300
      ],
      "id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
      "name": "Generate PDF Report",
      "credentials": {
        "iterationLayerApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Extract Invoice Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Invoice Data": {
      "main": [
        [
          {
            "node": "Generate PDF Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}