n8n Integration
n8n is a workflow automation tool that you can use as a service or self-host. NetLicensing does not provide a dedicated n8n node. The generic Webhook and HTTP Request nodes cover both directions.
React to NetLicensing events: Webhook node
The Webhook node starts a workflow when a request arrives. It supports the methods DELETE, GET, HEAD, PATCH, POST and PUT.
- Add a Webhook node with the method
POST. n8n shows a Test URL and a Production URL: the production webhook is registered when you publish the workflow. - In the Management Console, open Settings / Notifications and create a notification of type
WEBHOOK. Use the Production URL as the endpoint, and select the events you need. NetLicensing requires an HTTPS endpoint with a public certificate, so your n8n instance must be reachable that way. - Continue the workflow after the Webhook node. The event name is in the payload at
entities.Event[0].name:LICENSEE_CREATED,LICENSE_CREATED,PAYMENT_TRANSACTION_PROCESSEDorWARNING_LEVEL_CHANGED. See Notifications for each payload.
Notes on the Webhook node:
- Respond quickly. The option Respond: Immediately returns the response code and the message “Workflow got started” at once; When Last Node Finishes returns the data of the last node. Use the first so NetLicensing gets its answer without waiting for the workflow.
- Protect the URL. By default the node uses a randomly generated path. The node supports Basic auth, Header auth, JWT auth and n8n User Auth, but the notification settings in NetLicensing have no field for authentication headers (a notification has a name, number, events, type, endpoint and payload). Keep the random path secret, and check the event data in the workflow before you act on it.
- Size. The maximum payload is 16 MB, far above a notification.
Act in NetLicensing: HTTP Request node
The HTTP Request node calls any REST API endpoint. Create a credential of the type Basic Auth with the user name apiKey and your API key as the password (n8n lists Basic auth and Header auth among its generic credential types).
Create a license:
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://go.netlicensing.io/core/v2/rest/license |
| Authentication | Generic credential type, Basic Auth |
| Send Body | On, content type Form URLencoded |
| Body parameters | licenseeNumber, licenseTemplateNumber |
| Header | Accept: application/json |
The same node creates a customer (POST /licensee with productNumber) and deactivates a license (POST /license/{licenseNumber} with active=false, see License Services). The API expects form-encoded bodies, which is why Form URLencoded is the content type to choose.
Example: tell your team when a warning level changes
- Webhook node, with a NetLicensing notification on
WARNING_LEVEL_CHANGED. - Any n8n node that sends a message, such as Send Email, using the customer
nameandnumberfrom the payload.
Example: create a license when a payment succeeds elsewhere
- A trigger node for the payment platform.
- HTTP Request: create the licensee.
- HTTP Request: create the license for that licensee.
Platforms differ in how they sign their webhooks. Check the platform’s method in the billing platform guides before you rely on an unsigned receiver.
Example: the calls
NetLicensing Automation tool Other apps / NetLicensing
| | |
| notification (POST) -->| trigger: webhook |
| | steps: filter, map |
| | action: HTTP request ------->| e.g. POST /license
| | |
1. Test the Webhook node
curl --request POST "https://n8n.example.com/webhook/<path>" \
--header "Content-Type: application/json" \
--data '{
"timestamp": "2024-09-19T04:30:26.006Z",
"origin": "Notification",
"entities": {
"Event": [ { "name": "LICENSE_CREATED" } ],
"License": [ { "number": "LN2TD47QY", "active": true, "licensee": "IKWUYQ9GR", "licenseTemplate": "E27NV3IQD" } ]
}
}'
Use the Test URL that n8n shows while you build the workflow, and the Production URL (/webhook/<path>) in the NetLicensing notification.
2. The call behind the HTTP Request node
The node settings above send this request; with the event from step 1, licenseeNumber comes from {{ $json.body.entities.License[0].licensee }} or from your own data:
curl --user "apiKey:$NETLICENSING_API_KEY" --header "Accept: application/json" \
--data "licenseeNumber=IKWUYQ9GR&licenseTemplateNumber=EUJK1BXQ52" \
https://go.netlicensing.io/core/v2/rest/license