Effortlessly calculate geometric centroids using our n8n webhook API, streamlining vector analysis and enhancing your application's efficiency and productivity.
This n8n workflow provides a dedicated API endpoint (`/centroid`) to calculate the geometric centroid of a set of two-dimensional vectors. Upon receiving a POST request containing a JSON body with an array of `vectors` (e.g., `{"vectors": [[x1,y1], [x2,y2], ...]}`), the workflow extracts and parses the input data. It then utilizes a Code node to perform the centroid calculation by averaging the x-coordinates and y-coordinates of all provided vectors. Finally, the workflow formats a success response, including the calculated centroid (as `[centroidX, centroidY]`), and sends it back to the originating client via the webhook, providing a quick and efficient way to integrate centroid computation into other applications.
Free n8n workflow template ready to import
Just upload and configure
Tested and optimized
Complete setup guide
Effortlessly calculate geometric centroids using our n8n webhook API, streamlining vector analysis and enhancing your application's efficiency and productivity.
Click the "Download Workflow" button above to get the JSON file.
In your n8n instance, go to Workflows ā Import and select the JSON file.
Set up your Webhook and other service credentials in n8n.
Activate the workflow and test it to ensure everything works correctly.
Get a custom n8n workflow built specifically for your business needs.
Ready to transform your business?