ModNexus

AI-Workflows

Predictive Maintenance POC for Manufacturing

Workflow Description

This n8n workflow tests predictive maintenance for manufacturing equipment, using machine learning to predict failures based on IoT sensor data. A multi-agent system processes data, generates predictions, and logs results for POC validation, integrating with Qdrant for maintenance protocols.

Technical Specifications

  • Platform: n8n (cloud-hosted, AWS).
  • Trigger: Cron node for periodic data pulls.
  • Multi-Agent System:
    • Gatekeeper: Routes tasks (data preprocessing, prediction, reporting).
    • Specialized Agents: Handle preprocessing, ML predictions, and reporting.
  • Vector Database: Qdrant for maintenance protocol retrieval.
  • Integrations:
    • IoT platform API (e.g., AWS IoT Core).
    • PostgreSQL for logging.
    • Slack for alerts.
  • Output: JSON with predictions and reports.
  • Error Handling: Error Trigger node with Slack notifications.
  • Security: API keys in AWS Secrets Manager, HTTPS.

API Payload (Input):

{
  "equipment_id": "EQ123",
  "sensor_data": {
    "vibration": 0.15,
    "temperature": 75.2,
    "timestamp": "2025-05-28T19:07:00+05:30"
  }
}

API Payload (Output):

{
  "equipment_id": "EQ123",
  "prediction": "Failure risk: 85% in 48 hours",
  "maintenance_action": "Inspect bearings",
  "timestamp": "2025-05-28T19:07:00+05:30"
}

Workflow Configuration

  1. Cron Node (Trigger):

    • Settings: Every 10 minutes (0 */10 * * * *).
    • Output: Initiates data pull.
  2. Gatekeeper AI Agent Node:

    • Settings:
      • Model: Grok (xAI)
      • Prompt: “Route task: preprocess data, predict failure, or generate report. Return { task: string }.”
    • Output{ "task": "preprocess" }.
  3. Switch Node:

    • Settings: Routes for task == 'preprocess'task == 'predict'task == 'report', Else.
    • Output: Passes equipment_idsensor_data.
  4. Preprocessing AI Agent Node:

    • Settings:
      • Model: Grok
      • Prompt: “Clean sensor data, normalize values. Return cleaned JSON.”
    • Tools:
      • Set Node: Normalizes vibration (0-1 scale), temperature (°C).
    • Output: Cleaned JSON.
  5. Prediction AI Agent Node:

    • Settings:
      • Model: Grok
      • Prompt: “Predict equipment failure risk using sensor data and Qdrant protocols.”
    • Tools:
      • Qdrant Node:
        • Collection: maintenance_protocols
        • Query: Embed sensor_data, top_k=2
      • HTTP Request Node:
        • URL: https://iot.modnexus.in/data/{equipment_id}
        • Method: GET
      • PostgreSQL Node:
        • Table: predictions
        • Columns: equipment_idpredictiontimestamp
    • Output{ prediction: string, maintenance_action: string }.
  6. Structured Output Parser Node:

    • Settings: Schema as per output payload.
    • Output: Formatted JSON.
  7. Slack Node:

    • Settings: Channel #maintenance-poc, Message: “Prediction: {{ prediction }}”.
    • Output: Confirms delivery.

Visual Workflow Diagram

[Cron] --> [Gatekeeper AI]
              |
              v
           [Switch]
         /   |   |   \
        /    |   |    \
[Preprocess] [Predict] [Report] [Default]
    |           |          |
    v           v          v
[Qdrant, HTTP, PostgreSQL] --> [Structured Output] --> [Slack]

Diagram Explanation: Cron triggers data pulls, Gatekeeper routes to preprocessing, prediction, or reporting agents, which use Qdrant and PostgreSQL, outputting to Slack.

Graphical Mockup Description

  • Layout: Vertical flowchart, 800x600px, white background.
  • Elements:
    • Nodes: Rounded rectangles (blue for agents, green for tools, red for output).
    • Connections: Black arrows with labels (e.g., “task: predict”).
    • Annotations: Text labels for nodes (e.g., “Gatekeeper AI: Grok”).
    • Title: “Predictive Maintenance POC Workflow” at top, bold 24px.
  • Colors: Blue (#1a73e8) for ModNexus branding, grey for connectors.
  • Tools: Qdrant, PostgreSQL icons in bottom nodes.

🍪 This website uses cookies to improve your web experience.