{
  "id": "n8n-http-retry-behavior",
  "name": "AI Brief Note - HTTP Retry Behavior",
  "nodes": [
    {
      "parameters": {},
      "id": "b5df4dc7-e477-4679-86f6-3ec46b319035",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const runId = $env.EXPERIMENT_RUN_ID;\nconst scenario = $env.EXPERIMENT_SCENARIO;\nconst port = Number($env.EXPERIMENT_FIXTURE_PORT || 43179);\nconst allowed = ['control_200', 'recover_429', 'recover_500', 'recover_timeout', 'persistent_429', 'persistent_500', 'persistent_timeout'];\nif (!runId || !allowed.includes(scenario) || !Number.isInteger(port)) {\n  throw new Error('INVALID_EXPERIMENT_INPUT');\n}\nconst base = `http://host.docker.internal:${port}/test?runId=${encodeURIComponent(runId)}&scenario=${encodeURIComponent(scenario)}`;\nreturn [{ json: { runId, scenario, noRetryUrl: `${base}&strategy=no_retry`, retryUrl: `${base}&strategy=retry_3` } }];"
      },
      "id": "654fcd31-b419-4a72-b60c-aed484b43eae",
      "name": "Prepare HTTP URLs",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "url": "={{ $json.noRetryUrl }}",
        "options": {
          "response": {
            "response": {
              "fullResponse": true,
              "responseFormat": "json"
            }
          },
          "timeout": 300
        }
      },
      "id": "e89a7796-8df4-4d4a-8520-8cfec6ca7a70",
      "name": "HTTP No Retry",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        -120
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "url": "={{ $json.retryUrl }}",
        "options": {
          "response": {
            "response": {
              "fullResponse": true,
              "responseFormat": "json"
            }
          },
          "timeout": 300
        }
      },
      "id": "c4cb553d-a4ed-46e3-b005-17667a4e7269",
      "name": "HTTP Retry 3",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        120
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 100,
      "continueOnFail": true
    }
  ],
  "pinData": {},
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Prepare HTTP URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare HTTP URLs": {
      "main": [
        [
          {
            "node": "HTTP No Retry",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Retry 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8210fdc7-c891-472b-aa71-191d5691692e",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "tags": []
}
