{
  "name": "SheetsToLabels - Generate a print-ready PDF",
  "nodes": [
    {
      "parameters": {},
      "id": "d104962d-12de-4724-8cf6-1902336140b1",
      "name": "Run workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [-360, 0]
    },
    {
      "parameters": {
        "jsCode": "return [{ json: { body: { templateId: 'custom-REPLACE_ME', layout: { type: 'single' }, records: [{ variables: { name: 'Alex Morgan', code: 'ag193', qrUrl: 'https://example.com/ag193' } }] }, idempotencyKey: 'sample-ag193-v1' } }];"
      },
      "id": "e394cb4a-3c42-4d28-88dc-0c818fa1c667",
      "name": "Prepare request",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [-120, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://sheetstolabels.com/api/v1/generate-pdf",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Idempotency-Key",
              "value": "={{ $json.idempotencyKey }}"
            },
            {
              "name": "X-Integration-Source",
              "value": "n8n"
            }
          ]
        },
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ JSON.stringify($json.body) }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "data"
            }
          }
        }
      },
      "id": "57089fc6-06c4-40e9-b036-4b756f643507",
      "name": "Generate PDF",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [140, 0]
    }
  ],
  "pinData": {},
  "connections": {
    "Run workflow": {
      "main": [[{ "node": "Prepare request", "type": "main", "index": 0 }]]
    },
    "Prepare request": {
      "main": [[{ "node": "Generate PDF", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "versionId": "a6d96ac2-c8b1-47d7-8df5-0050589ca595",
  "meta": { "templateCredsSetupCompleted": false },
  "tags": []
}
