{
 "id": "RhR5Fixed0000001",
 "name": "R5 N8 ตัวอย่างหลังแก้",
 "active": false,
 "nodes": [
  {
   "id": "b1",
   "name": "Webhook",
   "type": "n8n-nodes-base.webhook",
   "typeVersion": 2,
   "position": [
    0,
    300
   ],
   "parameters": {
    "httpMethod": "POST",
    "path": "r5-broken",
    "responseMode": "responseNode",
    "options": {}
   },
   "webhookId": "00000000-0000-4000-8000-0000000000b1"
  },
  {
   "id": "b2",
   "name": "Set order",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    220,
    300
   ],
   "parameters": {
    "jsCode": "const o = $('Webhok').first().json.body;\nreturn [{ json: { id: o.id, total: o.total } }];"
   }
  },
  {
   "id": "b3",
   "name": "Charge",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    440,
    300
   ],
   "parameters": {
    "method": "POST",
    "url": "https://api.example.test/charges",
    "sendHeaders": true,
    "headerParameters": {
     "parameters": [
      {
       "name": "Authorization",
       "value": "Bearer {{ $env.API_TOKEN }}"
      }
     ]
    },
    "sendBody": true,
    "specifyBody": "json",
    "jsonBody": "={{ JSON.stringify({ key: '{{ $env.API_TOKEN }}', amount: $json.total }) }}"
   },
   "onError": "continueErrorOutput",
   "retryOnFail": true,
   "maxTries": 3
  },
  {
   "id": "b4",
   "name": "Set order",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    660,
    300
   ],
   "parameters": {
    "jsCode": "return $input.all();"
   }
  }
 ],
 "connections": {
  "Webhook": {
   "main": [
    [
     {
      "node": "Set order",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Set order": {
   "main": [
    [
     {
      "node": "Charge",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Charge": {
   "main": [
    []
   ]
  }
 },
 "settings": {
  "executionOrder": "v1"
 },
 "pinData": {}
}