{
  "id": "p2labok2377x0001",
  "name": "Project2 n8n 2.37.7 synthetic workload lab",
  "nodes": [
    {
      "parameters": {
        "inputSource": "passthrough"
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        -560,
        0
      ],
      "id": "6ab23770-78a0-42a4-aee9-373c4c8b5000",
      "name": "Execute Workflow Trigger"
    },
    {
      "parameters": {
        "jsCode": "const count = 2500;\nreturn Array.from({ length: count }, (_, index) => {\n  const id = index + 1;\n  return { json: { id, amount: (id % 100) + 1, bucket: `b${id % 20}`, label: `synthetic-${id}` } };\n});"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -300,
        0
      ],
      "id": "7ac23770-d48c-4555-b784-8f0454d6d001",
      "name": "Generate Synthetic Workload"
    },
    {
      "parameters": {
        "jsCode": "return $input.all().map((item) => ({ json: {\n  id: Number(item.json.id),\n  amount: Number(item.json.amount),\n  bucket: String(item.json.bucket).toUpperCase(),\n  label_length: String(item.json.label).length\n} }));"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -40,
        0
      ],
      "id": "b7223770-3b6a-474a-a3bb-3b34763c3002",
      "name": "Normalize Locally"
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nconst amountSum = items.reduce((sum, item) => sum + Number(item.json.amount), 0);\nconst idSum = items.reduce((sum, item) => sum + Number(item.json.id), 0);\nreturn [{ json: { item_count: items.length, amount_sum: amountSum, id_sum: idSum, unique_buckets: new Set(items.map((item) => item.json.bucket)).size } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        0
      ],
      "id": "c8323770-9118-4d9c-bdc2-8a8d5904a003",
      "name": "Aggregate Observations"
    },
    {
      "parameters": {
        "jsCode": "const expected = { item_count: 2500, amount_sum: 126250, id_sum: 3126250, unique_buckets: 20 };\nfor (const [key, value] of Object.entries(expected)) {\n  if ($json[key] !== value) throw new Error(`ASSERT_${key.toUpperCase()}_${$json[key]}_NE_${value}`);\n}\nreturn [{ json: { lab_pass: true, ...expected, external_calls: 0, credentials: 0 } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        480,
        0
      ],
      "id": "d9423770-b586-4ae6-a91d-a94c67bf4004",
      "name": "Assert Measured Contract"
    }
  ],
  "connections": {
    "Execute Workflow Trigger": {
      "main": [
        [
          {
            "node": "Generate Synthetic Workload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Synthetic Workload": {
      "main": [
        [
          {
            "node": "Normalize Locally",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Locally": {
      "main": [
        [
          {
            "node": "Aggregate Observations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Observations": {
      "main": [
        [
          {
            "node": "Assert Measured Contract",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "saveDataSuccessExecution": "all",
    "saveDataErrorExecution": "all",
    "saveManualExecutions": true
  },
  "versionId": "78f017bc-ce8d-4ffc-a73b-631643163bf7",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
