Skip to content

Integration Guide

n8n is a powerful workflow automation tool integrated into the Sysadmin Anywhere ecosystem for creating alerts, monitoring, and automating administrative tasks.

Goal: Automatically notify administrators of critical security events.

Setup:

  1. Create webhook in n8n to receive events from Incident Service
  2. Filter events by severity level
  3. Add notification actions

Example workflow:

{
"nodes": [
{
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"parameters": {
"path": "security-events",
"method": "POST"
}
},
{
"name": "Filter Critical Events",
"type": "n8n-nodes-base.filter",
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.level }}",
"operation": "equal",
"value2": "critical"
}
]
}
}
},
{
"name": "Send Email Alert",
"type": "n8n-nodes-base.emailSend",
"parameters": {
"toEmail": "[email protected]",
"subject": "Critical Security Event: {{ $json.eventType }}",
"text": "Event detected: {{ $json.description }}"
}
}
]
}

Goal: Check availability of all Sysadmin Anywhere services and alert on issues.

Setup:

  1. Use HTTP Request node to check each service
  2. Add logic to determine status
  3. Configure notifications for failures

Example workflow:

{
"nodes": [
{
"name": "Check Directory Service",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"url": "http://directory:8080/actuator/health",
"method": "GET"
}
},
{
"name": "Check Inventory Service",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"url": "http://inventory:8080/actuator/health",
"method": "GET"
}
},
{
"name": "Check Incident Service",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"url": "http://incident:8080/actuator/health",
"method": "GET"
}
},
{
"name": "Evaluate Status",
"type": "n8n-nodes-base.function",
"parameters": {
"functionCode": "return items.map(item => ({ json: { service: item.node.name, status: item.json.status === 'UP' ? 'healthy' : 'unhealthy' } }))"
}
},
{
"name": "Alert on Unhealthy",
"type": "n8n-nodes-base.if",
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.status }}",
"operation": "equal",
"value2": "unhealthy"
}
]
}
}
},
{
"name": "Send Slack Notification",
"type": "n8n-nodes-base.slack",
"parameters": {
"channel": "#alerts",
"text": "🚨 Service {{ $json.service }} is down!"
}
}
]
}

Goal: Automatically create/update users based on events from external systems.

Setup:

  1. Configure webhook to receive user data
  2. Add validation and data transformation
  3. Integrate with Directory Service API

Goal: Automatically generate and send daily system status reports.

Setup:

  1. Use Cron trigger for daily execution
  2. Collect data from all services
  3. Generate report and send via email

API Endpoints:

  • GET /api/users - Get user list
  • POST /api/users - Create user
  • PUT /api/users/{id} - Update user
  • DELETE /api/users/{id} - Delete user

Example n8n usage:

{
"name": "Create User in AD",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"url": "http://directory:8080/api/users",
"method": "POST",
"body": {
"username": "={{ $json.username }}",
"email": "={{ $json.email }}",
"firstName": "={{ $json.firstName }}",
"lastName": "={{ $json.lastName }}"
}
}
}

API Endpoints:

  • GET /api/computers - Get computer list
  • GET /api/software - Get installed software
  • POST /api/scan - Start scanning

API Endpoints:

  • GET /api/incidents - Get incidents
  • POST /api/incidents - Create incident
  • GET /api/events - Get events
  1. Set up SMTP credentials in n8n settings
  2. Use Email Send node for sending notifications
  3. Configure templates for different event types
  1. Create Slack Bot and get token
  2. Add Slack credentials to n8n
  3. Configure channels for different notification types
  1. Connect SMS service (Twilio, etc.)
  2. Set up credentials for SMS API
  3. Use HTTP Request node to send SMS
  1. Open Sysadmin Anywhere interface
  2. Go to Automation → Workflows
  3. Select workflow to view details
  4. Track executions in Executions section
  1. Configure Error Trigger in workflow
  2. Add error logging to file or monitoring system
  3. Set up critical error notifications
  1. Use API keys for authentication
  2. Store credentials in Vault
  3. Limit workflow permissions
  4. Update n8n regularly
  1. Optimize API requests
  2. Use caching where possible
  3. Configure parallel task execution
  4. Monitor system load
  1. Add retry mechanisms for critical operations
  2. Configure error handling
  3. Use dead letter queues for failed messages
  4. Test workflows regularly
  1. Connection refused: Check service availability
  2. Authentication failed: Verify API keys and credentials
  3. Timeout errors: Increase timeouts or optimize workflow
  4. Memory issues: Limit concurrent executions
  1. Check n8n container logs: docker logs n8n
  2. Review execution logs in n8n interface
  3. Use service Health Check endpoints
  4. Monitor system resources
{
"name": "Disk Space Monitor",
"nodes": [
{
"name": "Get Disk Usage",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"url": "http://inventory:8080/api/computers/disk-usage",
"method": "GET"
}
},
{
"name": "Check Threshold",
"type": "n8n-nodes-base.if",
"parameters": {
"conditions": {
"number": [
{
"value1": "={{ $json.freeSpacePercent }}",
"operation": "smaller",
"value2": 10
}
]
}
}
},
{
"name": "Send Alert",
"type": "n8n-nodes-base.emailSend",
"parameters": {
"toEmail": "[email protected]",
"subject": "Low Disk Space Alert",
"text": "Computer {{ $json.computerName }} has only {{ $json.freeSpacePercent }}% free space"
}
}
]
}
{
"name": "Disable Inactive Users",
"nodes": [
{
"name": "Get Inactive Users",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"url": "http://directory:8080/api/users?inactiveDays=90",
"method": "GET"
}
},
{
"name": "Disable User",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"url": "http://directory:8080/api/users/{{ $json.id }}/disable",
"method": "POST"
}
},
{
"name": "Log Action",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"url": "http://incident:8080/api/audit-log",
"method": "POST",
"body": {
"action": "USER_DISABLED",
"userId": "={{ $json.id }}",
"reason": "Automatic inactive user cleanup"
}
}
}
]
}

n8n provides powerful automation capabilities for administrative tasks in the Sysadmin Anywhere ecosystem. Start with simple workflows and gradually increase complexity as needed.

For additional information and support, refer to the n8n documentation (https://docs.n8n.io) and create issues in the project repository.