Description
n8n-NETPIE
Community node for n8n to read from and publish to NETPIE.
- 2 nodes included: NETPIE Read (Shadow → Get) and NETPIE Send (Message → Publish)
- Uses header auth:
Authorization: Device <clientId>:<token> - Follows n8n UX guidelines (Resource + Operation, clean copy, Title Case)
- Includes Simplify output and Options → Timeout
📦 Installation
A) Install via Community Nodes (recommended)
- In n8n go to Settings → Community Nodes
- Click Install, search for your package name (e.g.
n8n-nodes-netpie) - Restart n8n if prompted
B) Install from npm into the custom folder
mkdir -p ~/.n8n/custom
cd ~/.n8n/custom
npm init -y
npm i n8n-nodes-netpie
n8n start
Requires n8n v1+ and Node.js 18+ (Node 20+ recommended).
🔐 Credentials (NETPIE API)
Create a new credential: NETPIE API
| Field | Description |
|---|---|
| Client ID | Device client ID from NETPIE |
| Token | Device token (stored securely as a password field) |
The node automatically sends:
Authorization: Device <clientId>:<token>
Accept: application/json
🧩 Nodes
1) NETPIE Read
Reads a device shadow value by alias.
- Resource:
Shadow - Operation:
Get
Parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| Alias | String | ✅ | led |
Shadow alias to retrieve |
| Simplify | Boolean | – | true |
Return compact { alias, value } |
| Options → Timeout | Number | – | 15000 |
Request timeout in milliseconds |
Output (Simplify = On)
{
"alias": "led",
"value": {
"deviceid": "10e2968a-...",
"data": { "Temperature": 25.62, "Timestamp": "00:10:37" },
"rev": 1466,
"timestamp": 1760932094846,
"modified": 1760932094849
}
}
2) NETPIE Send
Publishes a message to a topic.
- Resource:
Message - Operation:
Publish
Parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| Topic | String | ✅ | led |
Topic to publish to |
| Payload | String | ✅ | ledon |
Message payload (JSON string allowed) |
| Simplify | Boolean | – | true |
Return { published, topic, result } |
| Options → Content Type | Options | – | text/plain |
application/json |
| Options → Timeout | Number | – | 15000 |
Request timeout in milliseconds |
Output (Simplify = On)
{ "published": true, "topic": "led", "result": "ok" }
🚀 Example Workflow
- NETPIE Read — Shadow:Get (
alias=led) - NETPIE Send — Message:Publish (
topic=led,payload=ledon)
Click Execute workflow and inspect the node outputs.
🛠 Local Development
# Build the package
npm run build
# Link locally
npm link
cd ~/.n8n/custom
npm init -y
npm link n8n-nodes-netpie
n8n start
Ensure your package.json includes:
{
"files": ["dist", "README.md", "LICENSE"],
"n8n": {
"nodes": [
"dist/nodes/NetpieRead/NetpieRead.node.js",
"dist/nodes/NetpieSend/NetpieSend.node.js"
],
"credentials": ["dist/credentials/NetpieApi.credentials.js"]
}
}
📑 API Reference (quick)
-
Base:
https://api.netpie.io/v2/device -
Read shadow:
GET /shadow/data?alias=<alias> -
Publish message:
PUT /message?topic=<topic>- Header:
Content-Type: text/plainorapplication/json - Body: payload (valid JSON if
application/json)
- Header:
🔍 Troubleshooting
-
401/403 Unauthorized
VerifyClient IDandTokenbelong to the correct device and are active. -
404 alias not found
Make sure the device shadow actually contains the alias you are querying. -
Invalid JSON payload
WhenContent Type = application/json, thePayloadmust be valid JSON (e.g.{"cmd":"ledon"}). -
Timeouts
Increase Options → Timeout and confirm the NETPIE service is reachable from your n8n host.
🧑💻 Maintainer
Developed by Phoovadet Noobdev