Back to Nodes

NETPIE Read

Last updated Oct 19, 2025

NETPIE nodes for n8n — read device shadow and publish messages to NETPIE.

1 Weekly Downloads
6 Monthly Downloads

Included Nodes

NETPIE Read
NETPIE Send

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

Example n8n workflow using NETPIE Read and NETPIE Send


📦 Installation

A) Install via Community Nodes (recommended)

  1. In n8n go to Settings → Community Nodes
  2. Click Install, search for your package name (e.g. n8n-nodes-netpie)
  3. 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

NETPIE credential tested successfully


🧩 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
  }
}

NETPIE Read node output


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" }

NETPIE Send node output


🚀 Example Workflow

  1. NETPIE Read — Shadow:Get (alias=led)
  2. 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/plain or application/json
    • Body: payload (valid JSON if application/json)

🔍 Troubleshooting

  • 401/403 Unauthorized
    Verify Client ID and Token belong 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
    When Content Type = application/json, the Payload must 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


📝 License

MIT License