Skip to main content

Overview

N8N is a powerful workflow automation tool. Here’s how to set up automatic device syncing from your RMM to SPHUD.

Example Workflow

This workflow syncs devices from your RMM to SPHUD every night.

Step 1: Fetch Devices from RMM

Add an HTTP Request node to fetch devices from your RMM’s API.
Method: GET
URL: https://your-rmm.com/api/devices
Authentication: (your RMM's auth method)

Step 2: Transform Data

Add a Code node to transform RMM data into SPHUD format:
// Transform RMM data to SPHUD format
return items.map(item => ({
  json: {
    name: item.json.hostname,
    deviceType: item.json.device_type || 'Workstation',
    externalId: item.json.id,
    serialNumber: item.json.serial_number
  }
}));
Adjust the field names (hostname, device_type, etc.) to match your RMM’s API response structure.

Step 3: Send to SPHUD

Add another HTTP Request node to import devices into SPHUD:
Method: POST
URL: https://dashboard.sphud.com/api/external/devices
Headers:
X-API-Key: your-sphud-api-key
Content-Type: application/json
Body:
{
  "customerId": "cust-uuid-1234",
  "devices": {{$json}},
  "mode": "merge"
}
Replace cust-uuid-1234 with your actual customer ID from the List Customers endpoint.

Step 4: Schedule It

Add a Schedule Trigger node at the start:
Run: Daily
Time: 2:00 AM
Timezone: Your timezone

Complete Workflow

Your N8N workflow should look like this:
Schedule Trigger → Fetch RMM Devices → Transform Data → Send to SPHUD

Error Handling

Add an Error Trigger node to handle failures:
// Send notification if sync fails
const error = $input.item.json;
return [{
  json: {
    message: `SPHUD sync failed: ${error.message}`,
    timestamp: new Date().toISOString()
  }
}];
Connect this to a notification service (email, Slack, etc.) to get alerted if syncs fail.

Advanced: Multi-Customer Sync

To sync devices for multiple customers, add a loop:
  1. Fetch Customers from SPHUD
  2. Loop through each customer
  3. Fetch Devices for that customer from RMM
  4. Transform and Import to SPHUD

Other Automation Tools

The same logic applies to other automation platforms:

Zapier

Use webhooks and code steps similar to N8N

Make (Integromat)

Visual workflow builder with HTTP modules

PowerAutomate

Microsoft’s automation platform for M365 users

Custom Scripts

Use Python, Node.js, or PowerShell with HTTP requests

Need Help?

Contact Support

Questions about integrations? We can help you set it up.