Task: Create OFN product on Open Batra product published event

n8n workflow:
{"id":4,"name":"product openbatra published to ofn creation","nodes":[{"name":"Product published","type":"n8n-nodes-base.webhook","position":[300,640],"webhookId":"6d7ebf45-97c0-4d40-8303-178fc9b337c5","parameters":{"path":"batra/productPublished","options":{},"httpMethod":"POST","authentication":"basicAuth"},"credentials":{"httpBasicAuth":{"id":"2","name":"Batra publisher"}},"typeVersion":1},{"name":"Lookup gtin in index","type":"n8n-nodes-base.googleSheets","position":[740,490],"parameters":{"range":"products-openbatra-ofn!A:B","options":{},"sheetId":"1pO1T_BKa0hw_bchBCVYGqPDR_Gfc0vdcMoU3Jn5viaw","operation":"lookup","lookupValue":"={{$json[\"gtin\"]}}","lookupColumn":"gtin"},"credentials":{"googleApi":{"id":"3","name":"Digicirco Google"}},"typeVersion":1,"alwaysOutputData":true},{"name":"NoOp","type":"n8n-nodes-base.noOp","position":[1090,830],"parameters":{},"typeVersion":1},{"name":"Get openbatra product","type":"n8n-nodes-base.httpRequest","position":[520,490],"parameters":{"url":"=https://www.batra.link/01/{{$json[\"body\"][\"id\"]}}/{{$json[\"body\"][\"id\"]}}.json","options":{}},"typeVersion":1},{"name":"Map product batra to ofn","type":"n8n-nodes-base.function","position":[1280,630],"parameters":{"functionCode":"const batraProducts = $items(\"Get openbatra product\")\nconst batraProduct = batraProducts[0]\n\nconst ofnProductCreate = {\n  name: \"test with html dscription\",\n  price: \"0\", // default\n  shipping_category_id: 1, // default\n  supplier_id: $item(0).$node[\"Lookup gln in index\"].json.ofnId,\n  primary_taxon_id: 1, // default\n  variant_unit: \"1\",\n  variant_unit_name: \" unité\"\n  // all above is mandatory\n  //sku: \"test\", // gtin\n  //display_name: \"test\",\n  //category_id: 2, // map gs1 ofn categories\n  //description: \"test\",\n  //description_html: \"test\",\n  //tax_category_id: 1,\n  //meta_description: \"test\",\n  //meta_keywords: \"test\",\n  //variant_unit_scale: 0.1\n}\n\nconst outputItem = {\n  json: ofnProductCreate  \n}\n\n// You can write logs to the browser console\nconsole.log('Done!');\n\nreturn [outputItem];"},"typeVersion":1},{"name":"Lookup gln in index","type":"n8n-nodes-base.googleSheets","position":[1100,500],"parameters":{"range":"organizations-openbatra-ofn!A:B","options":{},"sheetId":"1pO1T_BKa0hw_bchBCVYGqPDR_Gfc0vdcMoU3Jn5viaw","operation":"lookup","lookupValue":"={{$node[\"Get openbatra product\"].json[\"manufacturer\"][\"gln\"]}}","lookupColumn":"gln"},"credentials":{"googleApi":{"id":"3","name":"Digicirco Google"}},"typeVersion":1},{"name":"Create ofn product","type":"n8n-nodes-base.httpRequest","position":[1690,500],"parameters":{"url":" http://localhost:3000/api/v0/products","options":{},"requestMethod":"POST","authentication":"headerAuth","jsonParameters":true,"bodyParametersJson":"={{$json}}"},"credentials":{"httpHeaderAuth":{"id":"4","name":"OFN api key"}},"typeVersion":1},{"name":"Ofn product request","type":"n8n-nodes-base.functionItem","position":[1490,630],"parameters":{"functionCode":"return {\n  product: item\n}"},"typeVersion":1},{"name":"Product index","type":"n8n-nodes-base.functionItem","position":[1870,630],"parameters":{"functionCode":"return {\n  gtin: $item(0).$node[\"Get openbatra product\"].json.gtin,\n  ofnId: item.id.toString()\n}"},"typeVersion":1},{"name":"Append to product index","type":"n8n-nodes-base.googleSheets","position":[2060,500],"parameters":{"range":"products-openbatra-ofn!A:B","options":{"valueInputMode":"=RAW"},"sheetId":"1pO1T_BKa0hw_bchBCVYGqPDR_Gfc0vdcMoU3Jn5viaw","operation":"append"},"credentials":{"googleApi":{"id":"3","name":"Digicirco Google"}},"typeVersion":1},{"name":"Gtin not found","type":"n8n-nodes-base.if","position":[940,640],"parameters":{"conditions":{"number":[],"string":[{"value1":"={{$json[\"gtin\"]}}","operation":"isEmpty"}],"boolean":[]}},"typeVersion":1,"alwaysOutputData":false},{"name":"Create ofn image","type":"n8n-nodes-base.httpRequest","position":[2110,300],"parameters":{"url":"=http://localhost:3000/api/v0/product_images/{{$json[\"id\"]}}","options":{"bodyContentType":"multipart-form-data"},"requestMethod":"POST","authentication":"headerAuth","jsonParameters":true,"sendBinaryData":true},"credentials":{"httpHeaderAuth":{"id":"4","name":"OFN api key"}},"typeVersion":1},{"name":"Get product image","type":"n8n-nodes-base.httpRequest","position":[1890,300],"parameters":{"url":"={{$node[\"Get openbatra product\"].json[\"referencedFiles\"][\"referencedFile\"][0][\"uniformResourceIdentifier\"]}}","options":{},"responseFormat":"file"},"typeVersion":1}],"active":false,"settings":{},"connections":{"Product index":{"main":[[{"node":"Append to product index","type":"main","index":0}]]},"Gtin not found":{"main":[[{"node":"Lookup gln in index","type":"main","index":0}],[{"node":"NoOp","type":"main","index":0}]]},"Create ofn image":{"main":[[]]},"Get product image":{"main":[[{"node":"Create ofn image","type":"main","index":0}]]},"Product published":{"main":[[{"node":"Get openbatra product","type":"main","index":0}]]},"Create ofn product":{"main":[[{"node":"Product index","type":"main","index":0},{"node":"Get product image","type":"main","index":0}]]},"Lookup gln in index":{"main":[[{"node":"Map product batra to ofn","type":"main","index":0}]]},"Ofn product request":{"main":[[{"node":"Create ofn product","type":"main","index":0}]]},"Lookup gtin in index":{"main":[[{"node":"Gtin not found","type":"main","index":0}]]},"Get openbatra product":{"main":[[{"node":"Lookup gtin in index","type":"main","index":0}]]},"Map product batra to ofn":{"main":[[{"node":"Ofn product request","type":"main","index":0}]]}}}