Quick overview
This workflow receives GoHighLevel (LeadConnector) opportunity webhooks, pulls the opportunity’s related product records via the LeadConnector API, builds an SAP-style sales order XML file with product SAP codes and quantities, and sends the XML to a Make.com webhook that uploads it to a warehouse system via SFTP.
How it works
- Receives a POST webhook from GoHighLevel containing an
opportunity_id.
- Calls the LeadConnector API to fetch the opportunity details and then fetches the opportunity’s association relations.
- Splits the relations into individual records, filters out non-product relations, and retrieves full details for each associated opportunity product record from LeadConnector.
- Builds an SAP sales order XML document using the opportunity ID as the order number and adds one sales line per product that has both an SAP code and a quantity.
- Converts the XML text into a binary file and posts it to a Make.com webhook for SFTP delivery to the warehouse/ERP.
Setup
- Configure your GoHighLevel workflow/automation to send a POST request to this n8n webhook URL and include
opportunity_id in the request body.
- Add your LeadConnector (GoHighLevel) API token to the Authorization header in all three LeadConnector HTTP requests and set the required
locationId query parameter.
- Update the SAP placeholders in the XML builder step (
YOUR_SAP_CUSTOMER_NUMBER, YOUR_SAP_COMPANY_CODE, YOUR_SAP_PARTNER_ID) to match your SAP configuration.
- Create a Make.com scenario that accepts the incoming binary file via webhook and uploads it to your warehouse SFTP server, then replace
YOUR_MAKE_SCENARIO_WEBHOOK_ID in the Make.com webhook URL.