{
  "name": "Pixelixe - CSV to personalized certificate PNGs",
  "nodes": [
    {
      "id": "fa3e6349-c15d-576d-b945-5684f3231af9",
      "name": "Run the three-row example",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        260
      ],
      "parameters": {}
    },
    {
      "id": "ac889f24-9aa4-5b52-b1cb-53d686d1af92",
      "name": "Download certificate CSV",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        240,
        260
      ],
      "parameters": {
        "url": "https://pixelixe.com/downloads/certificates/certificate-example.csv",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "data"
            }
          }
        }
      }
    },
    {
      "id": "b17ccbf3-a0e3-5ee9-96fd-52716d2cf5cb",
      "name": "Extract recipient rows",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1.1,
      "position": [
        480,
        260
      ],
      "parameters": {
        "operation": "csv",
        "options": {
          "headerRow": true
        }
      }
    },
    {
      "id": "c585899a-4010-5281-a1e9-5f6bba344dd8",
      "name": "Configure your template",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        260
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "document_uid",
              "name": "document_uid",
              "value": "YOUR_CERTIFICATE_DOCUMENT_UID",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      }
    },
    {
      "id": "548e45c9-32e2-53a9-baa2-a3f24b0ea9c4",
      "name": "Render certificate with Pixelixe",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        960,
        260
      ],
      "parameters": {
        "method": "POST",
        "url": "https://studio.pixelixe.com/api/graphic/automation/v2",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "form-urlencoded",
        "bodyParameters": {
          "parameters": [
            {
              "name": "json",
              "value": "={{ JSON.stringify({document_uid:$json.document_uid,format:\"json\",image_type:\"png\",modifications:[{element_name:\"recipient_name\",type:\"text\",text:$json.recipient_name,\"font-size\":\"auto\"}, {element_name:\"course_title\",type:\"text\",text:$json.course_title}, {element_name:\"issue_date\",type:\"text\",text:$json.issue_date}, {element_name:\"issuer_name\",type:\"text\",text:$json.issuer_name}]}) }}"
            }
          ]
        },
        "options": {
          "timeout": 90000,
          "batching": {
            "batch": {
              "batchSize": 1,
              "batchInterval": 0
            }
          }
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "SELECT_YOUR_PIXELIXE_CREDENTIAL",
          "name": "Pixelixe API"
        }
      }
    },
    {
      "id": "6eed10b3-b304-523f-98c6-9d0a81282cf6",
      "name": "Return certificate URLs",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1200,
        260
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "recipient_name",
              "name": "recipient_name",
              "value": "={{ $('Configure your template').item.json.recipient_name }}",
              "type": "string"
            },
            {
              "id": "status",
              "name": "status",
              "value": "={{ $json.status }}",
              "type": "string"
            },
            {
              "id": "image_url",
              "name": "image_url",
              "value": "={{ $json.image_url }}",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": false,
        "options": {}
      }
    }
  ],
  "connections": {
    "Run the three-row example": {
      "main": [
        [
          {
            "node": "Download certificate CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download certificate CSV": {
      "main": [
        [
          {
            "node": "Extract recipient rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract recipient rows": {
      "main": [
        [
          {
            "node": "Configure your template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure your template": {
      "main": [
        [
          {
            "node": "Render certificate with Pixelixe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Render certificate with Pixelixe": {
      "main": [
        [
          {
            "node": "Return certificate URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false,
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
