{
  "name": "GreenQubyte \u2014 stamp new files in a folder",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 1
            }
          ]
        }
      },
      "name": "Every hour",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "fileSelector": "/data/lab-outputs/**/*",
        "options": {}
      },
      "name": "Read lab output files",
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "type": "SHA256",
        "binaryData": true,
        "binaryPropertyName": "data",
        "dataPropertyName": "sha256"
      },
      "name": "SHA-256 locally",
      "type": "n8n-nodes-base.crypto",
      "typeVersion": 1,
      "position": [
        440,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.greenqubyte.com/api/stamp",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ sha256: $json.sha256, filename: $binary.data.fileName, size: Number($binary.data.fileSize) || undefined, publisher: 'n8n lab pipeline' }) }}",
        "options": {}
      },
      "name": "Stamp on GreenQubyte",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        660,
        0
      ],
      "notes": "Credential: Header Auth, name X-Api-Key, value = your GreenQubyte API key. Only the hash is sent."
    }
  ],
  "connections": {
    "Every hour": {
      "main": [
        [
          {
            "node": "Read lab output files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read lab output files": {
      "main": [
        [
          {
            "node": "SHA-256 locally",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SHA-256 locally": {
      "main": [
        [
          {
            "node": "Stamp on GreenQubyte",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}