Overview
This node monitors the status of a specified OPNSense gateway and triggers a workflow when the gateway's status changes. It periodically polls the OPNSense API to fetch the current status of the selected gateway. If the status differs from the last known state, it can delay triggering the workflow by a configurable amount of time (in minutes). This is useful for network administrators who want to automate responses to gateway status changes, such as alerting, failover procedures, or logging.
Practical examples:
- Automatically notify a team via email or messaging app when a gateway goes down.
- Trigger a failover script if the primary gateway becomes unavailable.
- Log gateway uptime and downtime events into a monitoring system.
Properties
| Name | Meaning |
|---|---|
| Gateway Name or ID | Select the gateway to monitor from a dynamically loaded list or specify an ID using an expression. |
| Trigger Delay (Minutes) | Number of minutes to wait after detecting a status change before triggering the workflow (0–60). |
Output
The node outputs JSON data with the following structure:
{
"gateway": "string", // The name or ID of the monitored gateway
"status": "string", // The current status of the gateway ("up" or other statuses, "down" if timeout)
"changedAt": "Date|null" // Timestamp of when the status last changed, or null if unknown
}
- The
statusfield reflects the gateway's operational state. If the API request times out, the status is reported as"down". - The
changedAtfield provides the exact time when the status last changed, parsed as a date object or null if not available. - The node does not output binary data.
Dependencies
- Requires access to an OPNSense instance with API enabled.
- Needs an API key credential with username and password (API key and secret).
- The node makes HTTP GET requests to the OPNSense API endpoint
/api/routes/gateway/status. - The node requires n8n credentials configured with the OPNSense API details (URL, API key, and secret).
- No additional external libraries beyond n8n core dependencies are used.
Troubleshooting
- Gateway not found error: If the specified gateway name or ID does not exist in the OPNSense API response, the node throws an error indicating the gateway was not found. Verify the gateway name/ID is correct and that the API user has permission to access it.
- Timeouts or connection errors: If the API request times out or cannot connect, the node treats the gateway status as
"down"and may trigger accordingly. Check network connectivity, API URL correctness, and firewall rules. - Invalid credentials: Authentication failures will cause the node to throw an API error. Ensure the API key and secret are valid and have sufficient permissions.
- Trigger delay misconfiguration: Setting a very high trigger delay may cause delayed reactions to status changes. Adjust the delay according to your use case.