{
  "name": "Automation Reliability Command Center | n8n TAM Portfolio",
  "nodes": [
    {
      "id": "tam-demo-01",
      "name": "Manual Replay",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        260
      ],
      "parameters": {},
      "notes": "Run with synthetic data only. No customer credentials, API keys or production changes."
    },
    {
      "id": "tam-demo-02",
      "name": "Generate Synthetic Telemetry",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        240,
        120
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const samples = [\n {account:\"Atlas Health (fictional)\",tenant:\"atlas-demo\",workflow:\"Critical intake sync\",runtime:\"self-hosted\",successRate:87.4,errorRate:12.6,p95Ms:5100,queueDepth:410,lastSuccessMin:95,importance:\"critical\",incidents30d:4},\n {account:\"Northstar Logistics (fictional)\",tenant:\"northstar-demo\",workflow:\"Shipment exception routing\",runtime:\"cloud\",successRate:96.2,errorRate:3.8,p95Ms:2800,queueDepth:160,lastSuccessMin:18,importance:\"high\",incidents30d:2},\n {account:\"Cedar Analytics (fictional)\",tenant:\"cedar-demo\",workflow:\"Invoice reconciliation\",runtime:\"self-hosted\",successRate:99.8,errorRate:0.2,p95Ms:760,queueDepth:14,lastSuccessMin:2,importance:\"normal\",incidents30d:0},\n {account:\"Harbor Services (fictional)\",tenant:\"harbor-demo\",workflow:\"Customer entitlement checks\",runtime:\"cloud\",successRate:93.5,errorRate:6.5,p95Ms:3200,queueDepth:245,lastSuccessMin:45,importance:\"high\",incidents30d:3},\n {account:\"Meridian Retail (fictional)\",tenant:\"meridian-demo\",workflow:\"Order confirmation pipeline\",runtime:\"self-hosted\",successRate:99.2,errorRate:0.8,p95Ms:1300,queueDepth:26,lastSuccessMin:5,importance:\"normal\",incidents30d:1}\n];\nreturn samples.map((sample,index)=>({json:{...sample,eventId:\"SYN-\"+String(index+1).padStart(3,\"0\"),synthetic:true,capturedAt:new Date().toISOString()}}));"
      },
      "notes": "TAM reliability demonstration. Review outputs and approval boundaries."
    },
    {
      "id": "tam-demo-03",
      "name": "Validate & Sanitize",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        480,
        260
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const allowed=[\"account\",\"tenant\",\"workflow\",\"runtime\",\"successRate\",\"errorRate\",\"p95Ms\",\"queueDepth\",\"lastSuccessMin\",\"importance\",\"incidents30d\",\"eventId\",\"synthetic\",\"capturedAt\"];\nreturn $input.all().map((item)=>{const v=item.json; const clean={};for(const k of allowed)clean[k]=v[k];const bad=[\"successRate\",\"errorRate\",\"p95Ms\",\"queueDepth\",\"lastSuccessMin\",\"incidents30d\"].filter(k=>!Number.isFinite(Number(clean[k]))||Number(clean[k])<0);\nreturn {json:{...clean,valid:bad.length===0,validationIssues:bad,secretFree:true}};});"
      },
      "notes": "TAM reliability demonstration. Review outputs and approval boundaries."
    },
    {
      "id": "tam-demo-04",
      "name": "Calculate Health & SLO Risk",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        720,
        120
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return $input.all().map(({json:x})=>{const drivers=[];if(x.errorRate>=5)drivers.push(\"elevated failure rate\");if(x.p95Ms>2500)drivers.push(\"p95 latency above 2.5s\");if(x.queueDepth>200)drivers.push(\"queue accumulation\");if(x.lastSuccessMin>30)drivers.push(\"last successful run overdue\");if(x.incidents30d>=3)drivers.push(\"repeated incidents\");\nconst score=Math.min(100,Math.round(x.errorRate*3.2+Math.max(0,x.p95Ms-1500)/125+x.queueDepth/14+x.lastSuccessMin/5+x.incidents30d*4));\nconst severity=!x.valid?\"INVALID\":score>=75?\"SEV1\":score>=42?\"SEV2\":\"HEALTHY\";\nreturn {json:{...x,healthScore:100-score,riskScore:score,severity,drivers,slo:{targetSuccessRate:99.5,meetsTarget:x.successRate>=99.5},policyVersion:\"tam-reliability-v1\"}};});"
      },
      "notes": "TAM reliability demonstration. Review outputs and approval boundaries."
    },
    {
      "id": "tam-demo-05",
      "name": "Choose Escalation Policy",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        960,
        260
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return $input.all().map(({json:x})=>{const critical=x.severity===\"SEV1\";const warning=x.severity===\"SEV2\";const owner=critical?\"TAM + Incident Commander\":warning?\"TAM + Support\":\"TAM\";return {json:{...x,escalation:{required:critical,channel:critical?\"incident bridge\":warning?\"support investigation\":\"proactive account review\",owner,customerUpdateMinutes:critical?15:warning?60:1440,priority:critical?\"P1\":warning?\"P2\":\"P4\",customerImpact:critical?\"Likely business workflow disruption\":warning?\"Degraded throughput / retry pressure\":\"Within monitored tolerance\"}}};});"
      },
      "notes": "TAM reliability demonstration. Review outputs and approval boundaries."
    },
    {
      "id": "tam-demo-06",
      "name": "Draft Customer Status",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1200,
        120
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return $input.all().map(({json:x})=>{const e=x.escalation; const headline=x.severity===\"HEALTHY\"?\"Monitoring is healthy\":x.severity===\"SEV1\"?\"High-priority workflow incident\":\"Performance investigation underway\";\nconst note=x.severity===\"HEALTHY\"?\"No action needed from your team. We will continue routine checks.\":(\"We have identified \"+x.drivers.slice(0,2).join(\" and \")+\". We are validating impact, coordinating technical owners, and will provide the next update within \"+e.customerUpdateMinutes+\" minutes.\");\nreturn {json:{...x,customerComms:{subject:\"[\"+x.eventId+\"] \"+headline,summary:note,nextUpdateMins:e.customerUpdateMinutes,tone:\"plain-language / no unsupported root-cause claims\",approvalRequired:true}}};});"
      },
      "notes": "TAM reliability demonstration. Review outputs and approval boundaries."
    },
    {
      "id": "tam-demo-07",
      "name": "Propose Safe Recovery",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1440,
        260
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return $input.all().map(({json:x})=>{const actions=x.severity===\"HEALTHY\"?[\"Review 30-day incident trend\",\"Validate next quarterly capacity forecast\"]:[\"Inspect the failed execution IDs and recent deployment changes\",\"Check worker concurrency, queue length and backend dependencies\",\"Use idempotent replay only for confirmed safe-to-retry jobs\",\"Prepare rollback proposal and request change approval\",\"Validate p95 latency, error-rate recovery and customer business outcome\"];\nreturn {json:{...x,recovery:{recommended:actions,automationWritesPerformed:0,productionChangeRequiresHumanApproval:true,rollback:\"Restore last known-good workflow version only after owner approval\",verification:[\"Successful synthetic replay\",\"Backlog trending down\",\"Customer update acknowledged\"],preventive:[x.incidents30d>=3?\"Open a recurring-issue problem record\":\"Track trend weekly\",\"Set threshold-based alert before SLA breach\",\"Capture an explicit owner and due date\"]}}};});"
      },
      "notes": "TAM reliability demonstration. Review outputs and approval boundaries."
    },
    {
      "id": "tam-demo-08",
      "name": "Create Audit Receipt",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1680,
        120
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return $input.all().map(({json:x})=>{const pass=x.synthetic===true&&x.secretFree===true&&x.recovery.automationWritesPerformed===0&&x.customerComms.approvalRequired===true;\nreturn {json:{...x,proof:{scenario:\"synthetic demonstration\",pass,controls:[\"no external customer data\",\"no credentials\",\"no automatic production change\",\"customer messages require approval\"],at:new Date().toISOString(),workflowVersion:\"1.0.0\"}}};});"
      },
      "notes": "TAM reliability demonstration. Review outputs and approval boundaries."
    },
    {
      "id": "tam-demo-09",
      "name": "Executive Rollup",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1920,
        260
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const records=$input.all().map(i=>i.json);const bySeverity={SEV1:0,SEV2:0,HEALTHY:0,INVALID:0};for(const r of records)bySeverity[r.severity]=(bySeverity[r.severity]||0)+1;const passed=records.every(r=>r.proof?.pass===true);\nreturn [{json:{title:\"Automation Reliability Command Center\",runAt:new Date().toISOString(),mode:\"synthetic-evidence-replay\",accountsReviewed:records.length,bySeverity,customerUpdatesPrepared:records.filter(r=>r.severity!==\"HEALTHY\").length,productionChanges:0,allPolicyChecksPassed:passed,gate:passed?\"PASS\":\"FAIL\",incidents:records.map(r=>({account:r.account,severity:r.severity,riskScore:r.riskScore,drivers:r.drivers,priority:r.escalation.priority,customerComms:r.customerComms,playbook:r.recovery.recommended,proof:r.proof})),nextStep:\"Review recommendations with a human owner; do not automate customer communications or changes without authorization.\"}}];"
      },
      "notes": "TAM reliability demonstration. Review outputs and approval boundaries."
    }
  ],
  "connections": {
    "Manual Replay": {
      "main": [
        [
          {
            "node": "Generate Synthetic Telemetry",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Synthetic Telemetry": {
      "main": [
        [
          {
            "node": "Validate & Sanitize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate & Sanitize": {
      "main": [
        [
          {
            "node": "Calculate Health & SLO Risk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Health & SLO Risk": {
      "main": [
        [
          {
            "node": "Choose Escalation Policy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Choose Escalation Policy": {
      "main": [
        [
          {
            "node": "Draft Customer Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Draft Customer Status": {
      "main": [
        [
          {
            "node": "Propose Safe Recovery",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Propose Safe Recovery": {
      "main": [
        [
          {
            "node": "Create Audit Receipt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Audit Receipt": {
      "main": [
        [
          {
            "node": "Executive Rollup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false,
  "tags": [],
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "description": "Importable synthetic replay: detects error spikes, scores SLO risk, prepares customer-safe incident communications, recommends guarded recovery and emits an audit receipt. No production writes.",
  "id": "TamReliabilityDemo261110"
}
