{
  "id": "00000000-0000-4000-8000-000000000100",
  "name": "Reliability Handoff Proof",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "Run Synthetic Fixture",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [-900, 0]
    },
    {
      "parameters": {
        "jsCode": "__FIXTURE_CODE__"
      },
      "id": "fixture",
      "name": "Synthetic Fixture",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [-680, 0]
    },
    {
      "parameters": {
        "jsCode": "const event = $input.first().json; const required = ['event_id', 'email', 'message']; const missing = required.filter((key) => typeof event[key] !== 'string' || !event[key].trim()); if (missing.length) return [{ json: { valid: false, outcome: 'rejected', reason: 'missing_required_field', missing } }]; return [{ json: { valid: true, event_id: event.event_id.trim(), email: event.email.trim().toLowerCase(), message: event.message.trim(), failure_mode: event.failure_mode || 'none' } }];"
      },
      "id": "normalize",
      "name": "Validate and Normalize",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [-460, 0]
    },
    {
      "parameters": {
        "conditions": {
          "options": {"caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 2},
          "conditions": [
            {
              "id": "valid-condition",
              "leftValue": "={{ $json.valid }}",
              "rightValue": true,
              "operator": {"type": "boolean", "operation": "true", "singleValue": true}
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "is-valid",
      "name": "Is Valid?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [-350, 0]
    },
    {
      "parameters": {
        "jsCode": "return [{ json: $input.first().json }];"
      },
      "id": "rejected",
      "name": "Build Rejected Outcome",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [-120, -160]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "__BASE_URL__/claim",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ JSON.stringify($json) }}",
        "options": {}
      },
      "id": "claim",
      "name": "Claim Event",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [-240, 0]
    },
    {
      "parameters": {
        "conditions": {
          "options": {"caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 2},
          "conditions": [
            {
              "id": "duplicate-condition",
              "leftValue": "={{ $json.duplicate }}",
              "rightValue": true,
              "operator": {"type": "boolean", "operation": "true", "singleValue": true}
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "is-duplicate",
      "name": "Is Duplicate?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [-20, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "__BASE_URL__/enrich",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ JSON.stringify($json) }}",
        "options": {}
      },
      "id": "enrich",
      "name": "Enrich Event",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [200, 80],
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 100,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "jsCode": "return [{ json: { outcome: 'duplicate', event: $input.first().json.event } }];"
      },
      "id": "duplicate",
      "name": "Build Duplicate Outcome",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [200, -120]
    },
    {
      "parameters": {
        "jsCode": "const input = $input.first().json; return [{ json: { outcome: 'failed', reason: 'dependency_failure_after_retries', error: input.error || input.message || input } }];"
      },
      "id": "failed",
      "name": "Build Failed Outcome",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [420, 180]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "__BASE_URL__/destination",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ JSON.stringify($json) }}",
        "options": {}
      },
      "id": "destination",
      "name": "Write Destination",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [200, 0]
    },
    {
      "parameters": {
        "jsCode": "return [{ json: { outcome: 'accepted', record: $input.first().json.record } }];"
      },
      "id": "accepted",
      "name": "Build Accepted Outcome",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [420, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "__BASE_URL__/audit",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ JSON.stringify($json) }}",
        "options": {}
      },
      "id": "audit",
      "name": "Write Audit Outcome",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [640, 0]
    }
  ],
  "connections": {
    "Run Synthetic Fixture": {"main": [[{"node": "Synthetic Fixture", "type": "main", "index": 0}]]},
    "Synthetic Fixture": {"main": [[{"node": "Validate and Normalize", "type": "main", "index": 0}]]},
    "Validate and Normalize": {"main": [[{"node": "Is Valid?", "type": "main", "index": 0}]]},
    "Is Valid?": {"main": [[{"node": "Claim Event", "type": "main", "index": 0}], [{"node": "Build Rejected Outcome", "type": "main", "index": 0}]]},
    "Claim Event": {"main": [[{"node": "Is Duplicate?", "type": "main", "index": 0}]]},
    "Is Duplicate?": {"main": [[{"node": "Build Duplicate Outcome", "type": "main", "index": 0}], [{"node": "Enrich Event", "type": "main", "index": 0}]]},
    "Enrich Event": {"main": [[{"node": "Write Destination", "type": "main", "index": 0}], [{"node": "Build Failed Outcome", "type": "main", "index": 0}]]},
    "Write Destination": {"main": [[{"node": "Build Accepted Outcome", "type": "main", "index": 0}]]},
    "Build Accepted Outcome": {"main": [[{"node": "Write Audit Outcome", "type": "main", "index": 0}]]},
    "Build Duplicate Outcome": {"main": [[{"node": "Write Audit Outcome", "type": "main", "index": 0}]]},
    "Build Rejected Outcome": {"main": [[{"node": "Write Audit Outcome", "type": "main", "index": 0}]]},
    "Build Failed Outcome": {"main": [[{"node": "Write Audit Outcome", "type": "main", "index": 0}]]}
  },
  "settings": {"executionOrder": "v1"},
  "pinData": {},
  "active": false,
  "versionId": "00000000-0000-4000-8000-000000000001",
  "meta": {"templateCredsSetupCompleted": false},
  "tags": []
}
