This workflow corresponds to n8n.io template #12991 — we link there as the canonical source.
This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "cxfYVaocOI4v2UK5",
"name": "Dual-Agent Predictive Vehicle Health and Maintenance Prioritization System",
"tags": [],
"nodes": [
{
"id": "f1c73a67-d7eb-4305-9c1f-894ac0697543",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-448,
96
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes"
}
]
}
},
"typeVersion": 1.3
},
{
"id": "7ed83566-3aef-4029-af69-55eee768015c",
"name": "Workflow Configuration",
"type": "n8n-nodes-base.set",
"position": [
-224,
96
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "telemetryApiUrl",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Vehicle Telemetry API Endpoint URL__>"
},
{
"id": "id-2",
"name": "historicalApiUrl",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Historical Vehicle Data API Endpoint URL__>"
},
{
"id": "id-3",
"name": "anomalyThreshold",
"type": "number",
"value": 0.75
},
{
"id": "id-4",
"name": "criticalUrgencyLevel",
"type": "string",
"value": "critical"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "69c11ff8-291b-4797-9c58-6bde5584c053",
"name": "Fetch Real-Time Vehicle Telemetry",
"type": "n8n-nodes-base.httpRequest",
"position": [
0,
0
],
"parameters": {
"url": "={{ $('Workflow Configuration').first().json.telemetryApiUrl }}",
"options": {
"response": {
"response": {
"responseFormat": "json"
}
}
}
},
"typeVersion": 4.3
},
{
"id": "5d6743dc-8249-4e9d-90df-3d154e552c44",
"name": "Fetch Historical Vehicle Data",
"type": "n8n-nodes-base.httpRequest",
"position": [
0,
192
],
"parameters": {
"url": "={{ $('Workflow Configuration').first().json.historicalApiUrl }}",
"options": {
"response": {
"response": {
"responseFormat": "json"
}
}
}
},
"typeVersion": 4.3
},
{
"id": "be28613f-457a-4ab1-9fc9-1a53dd8ee0d3",
"name": "Merge Telemetry and Historical Data",
"type": "n8n-nodes-base.merge",
"position": [
224,
96
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineAll"
},
"typeVersion": 3.2
},
{
"id": "77a4e133-563b-4ae6-a53e-b6e00fdfbe18",
"name": "Anthropic Model - Anomaly Detection Agent",
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"position": [
456,
320
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "claude-3-5-sonnet-20241022"
},
"options": {}
},
"credentials": {
"anthropicApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "ec24740a-4c6d-49dd-b4f8-1f5b21bbbeeb",
"name": "Anomaly Detection Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
624,
320
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"vehicle_id\": {\"type\": \"string\"},\n \"component_id\": {\"type\": \"string\"},\n \"anomaly_detected\": {\"type\": \"boolean\"},\n \"anomaly_type\": {\"type\": \"string\"},\n \"anomaly_severity\": {\"type\": \"string\", \"enum\": [\"low\", \"medium\", \"high\", \"critical\"]},\n \"sensor_readings\": {\"type\": \"object\"},\n \"confidence_score\": {\"type\": \"number\", \"minimum\": 0, \"maximum\": 1}\n },\n \"required\": [\"vehicle_id\", \"component_id\", \"anomaly_detected\", \"confidence_score\"]\n}"
},
"typeVersion": 1.3
},
{
"id": "ee2321dc-5456-4370-a9e8-ebbaec536464",
"name": "Anomaly Detection Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
448,
96
],
"parameters": {
"text": "={{ $json }}",
"options": {
"systemMessage": "You are an advanced vehicle anomaly detection AI agent specialized in analyzing real-time telemetry and historical vehicle data.\n\nYour task is to:\n1. Analyze sensor readings from the merged telemetry and historical data\n2. Detect anomalies in component behavior, performance degradation, or unusual patterns\n3. Correlate real-time data with historical trends to identify deviations\n4. Assess the severity of detected anomalies (low, medium, high, critical)\n5. Calculate confidence scores based on data quality and pattern consistency\n6. Identify the specific component and anomaly type\n\nReturn structured JSON output with vehicle_id, component_id, anomaly_detected (boolean), anomaly_type, anomaly_severity, sensor_readings, and confidence_score."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3.1
},
{
"id": "3c45a377-6314-40cc-ada2-807326fa47d1",
"name": "Anthropic Model - Maintenance Prioritization Agent",
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"position": [
800,
320
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "claude-3-5-sonnet-20241022"
},
"options": {}
},
"credentials": {
"anthropicApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "149838be-9219-42e6-a799-b33cedb7731e",
"name": "Maintenance Prioritization Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1120,
320
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"vehicle_id\": {\"type\": \"string\"},\n \"component_id\": {\"type\": \"string\"},\n \"anomaly_detected\": {\"type\": \"boolean\"},\n \"predicted_failure_date\": {\"type\": \"string\", \"format\": \"date\"},\n \"remaining_useful_life_days\": {\"type\": \"number\"},\n \"recommended_action\": {\"type\": \"string\"},\n \"urgency_level\": {\"type\": \"string\", \"enum\": [\"low\", \"medium\", \"high\", \"critical\"]},\n \"confidence_score\": {\"type\": \"number\", \"minimum\": 0, \"maximum\": 1},\n \"maintenance_priority\": {\"type\": \"number\", \"minimum\": 1, \"maximum\": 10}\n },\n \"required\": [\"vehicle_id\", \"component_id\", \"anomaly_detected\", \"recommended_action\", \"urgency_level\", \"confidence_score\"]\n}"
},
"typeVersion": 1.3
},
{
"id": "064d7af5-3317-4263-9102-45ebfff8b9a9",
"name": "RUL Calculation Tool",
"type": "@n8n/n8n-nodes-langchain.toolCode",
"position": [
960,
320
],
"parameters": {
"jsCode": "const anomalySeverity = $input.first().json.anomaly_severity;\nconst componentId = $input.first().json.component_id;\nconst confidenceScore = $input.first().json.confidence_score;\n\n// RUL calculation based on severity\nconst rulMapping = {\n 'critical': 7,\n 'high': 30,\n 'medium': 90,\n 'low': 180\n};\n\nconst baseRUL = rulMapping[anomalySeverity] || 90;\nconst adjustedRUL = Math.round(baseRUL * confidenceScore);\n\nconst predictedFailureDate = new Date();\npredictedFailureDate.setDate(predictedFailureDate.getDate() + adjustedRUL);\n\nreturn {\n remaining_useful_life_days: adjustedRUL,\n predicted_failure_date: predictedFailureDate.toISOString().split('T')[0],\n calculation_timestamp: new Date().toISOString()\n};",
"description": "Calculates the remaining useful life (RUL) of vehicle components based on anomaly severity, sensor data, and historical degradation patterns. Returns RUL in days and predicted failure date."
},
"typeVersion": 1.3
},
{
"id": "196132d1-7add-4533-a840-b186f40e2b0e",
"name": "Maintenance Prioritization Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
856,
96
],
"parameters": {
"text": "={{ $json }}",
"options": {
"systemMessage": "You are an advanced maintenance prioritization AI agent specialized in predictive vehicle maintenance and fleet management.\n\nYour task is to:\n1. Analyze anomaly detection results from the previous agent\n2. Use the RUL Calculation Tool to estimate remaining useful life and predicted failure dates\n3. Assess vehicle health status and component criticality\n4. Prioritize maintenance tasks based on urgency, safety impact, and operational criticality\n5. Generate deterministic, audit-ready recommendations\n6. Assign urgency levels (low, medium, high, critical) and maintenance priority scores (1-10)\n7. Provide specific recommended actions for each detected issue\n\nReturn structured JSON output with vehicle_id, component_id, anomaly_detected, predicted_failure_date, remaining_useful_life_days, recommended_action, urgency_level, confidence_score, and maintenance_priority."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3.1
},
{
"id": "dd32d853-3965-44ef-b997-ce6965b4c6a8",
"name": "Check Urgency Level",
"type": "n8n-nodes-base.if",
"position": [
1264,
96
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": false,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "id-1",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Maintenance Prioritization Agent').item.json.urgency_level }}",
"rightValue": "={{ $('Workflow Configuration').first().json.criticalUrgencyLevel }}"
}
]
}
},
"typeVersion": 2.3
},
{
"id": "44e044ea-5eca-41ff-85f4-a84da5440211",
"name": "Format Urgent Alert",
"type": "n8n-nodes-base.set",
"position": [
1488,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "alert_type",
"type": "string",
"value": "URGENT"
},
{
"id": "id-2",
"name": "notification_required",
"type": "boolean",
"value": true
},
{
"id": "id-3",
"name": "escalation_level",
"type": "string",
"value": "immediate"
},
{
"id": "id-4",
"name": "timestamp",
"type": "string",
"value": "={{ $now.toISO() }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "eb52a987-9f1b-4f81-a0fc-813b4d6ab1e3",
"name": "Format Standard Maintenance Record",
"type": "n8n-nodes-base.set",
"position": [
1488,
192
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "alert_type",
"type": "string",
"value": "STANDARD"
},
{
"id": "id-2",
"name": "notification_required",
"type": "boolean",
"value": false
},
{
"id": "id-3",
"name": "escalation_level",
"type": "string",
"value": "scheduled"
},
{
"id": "id-4",
"name": "timestamp",
"type": "string",
"value": "={{ $now.toISO() }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "04ef852e-8208-4bea-9674-38495e7d2e87",
"name": "Generate Audit Log",
"type": "n8n-nodes-base.code",
"position": [
1712,
96
],
"parameters": {
"jsCode": "const items = $input.all();\nconst auditLog = [];\n\nfor (const item of items) {\n const record = {\n audit_id: `AUDIT-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n timestamp: new Date().toISOString(),\n vehicle_id: item.json.vehicle_id,\n component_id: item.json.component_id,\n anomaly_detected: item.json.anomaly_detected,\n predicted_failure_date: item.json.predicted_failure_date || null,\n remaining_useful_life_days: item.json.remaining_useful_life_days || null,\n recommended_action: item.json.recommended_action,\n urgency_level: item.json.urgency_level,\n confidence_score: item.json.confidence_score,\n maintenance_priority: item.json.maintenance_priority || null,\n alert_type: item.json.alert_type,\n notification_required: item.json.notification_required,\n escalation_level: item.json.escalation_level,\n workflow_execution_id: $execution.id,\n data_sources: ['real-time_telemetry', 'historical_data'],\n ai_agents_used: ['anomaly_detection_agent', 'maintenance_prioritization_agent'],\n audit_trail: {\n processed_at: item.json.timestamp,\n workflow_name: $workflow.name,\n deterministic: true,\n compliance_ready: true\n }\n };\n \n auditLog.push(record);\n}\n\nreturn auditLog.map(log => ({ json: log }));"
},
"typeVersion": 2
},
{
"id": "618c52a4-d2c4-4413-8dec-bb56e3d1098a",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
720,
-528
],
"parameters": {
"color": 6,
"width": 544,
"height": 368,
"content": "## Prerequisites\nActive Anthropic API account, fleet telemetry system with API access, historical maintenance database \n## Use Cases\nCommercial fleet preventive maintenance, vehicle health monitoring, breakdown prediction \n## Customization\nModify anomaly detection thresholds for vehicle types, adjust prioritization algorithms for operational priorities \n## Benefits\nReduces unexpected breakdowns by 80%, decreases maintenance costs through predictive scheduling "
},
"typeVersion": 1
},
{
"id": "a1e92d84-269d-4569-909b-621d524791f2",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
272,
-496
],
"parameters": {
"width": 416,
"height": 320,
"content": "\n## Setup Steps\n1. Configure Schedule Trigger with desired monitoring frequency for fleet checks\n2. Set up API credentials for Fetch Real-Time Vehicle Telemetry node with fleet management system\n3. Configure Fetch Historical Vehicle Data node with maintenance database API access\n4. Connect Anthropic API credentials for both Anomaly Detection and Maintenance Prioritization agents\n5. Update Anomaly Detection Model with your fleet's baseline performance parameters\n6. Customize UL Calculation Tool and Maintenance Prioritization Output Parser "
},
"typeVersion": 1
},
{
"id": "63a1c013-f5cc-414f-9419-f5c511e4c30b",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-464,
-448
],
"parameters": {
"width": 704,
"height": 272,
"content": "## How It Works\nThis workflow automates predictive maintenance for vehicle fleets by combining real-time telemetry analysis with historical pattern recognition to identify potential failures before they occur. Designed for fleet managers, maintenance supervisors, and transportation operations teams, it solves the critical challenge of preventing unexpected vehicle breakdowns while optimizing maintenance scheduling and resource allocation. The system triggers on schedule, fetches current vehicle telemetry data alongside historical maintenance records, merges datasets for comprehensive analysis, then deploys specialized AI agents using Anthropic's Claude to detect anomalies and prioritize maintenance interventions. The workflow calculates urgency levels using machine learning models and business rules, formats findings into standardized maintenance records and urgent alerts, generates audit logs for compliance tracking, and routes notifications to appropriate maintenance teams based on severity."
},
"typeVersion": 1
},
{
"id": "be046d72-8a64-4b55-b978-1c817fc47808",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-480,
-144
],
"parameters": {
"color": 7,
"width": 848,
"height": 624,
"content": "## Dual Data Stream Acquisition and Integration\n**Why:** Simultaneously retrieves real-time vehicle telemetry (sensor readings, performance metrics, error codes) and historical maintenance records, then merges both datasets to provide AI agents with complete vehicle health context needed for accurate anomaly detection and trend analysis."
},
"typeVersion": 1
},
{
"id": "e452cf45-dffb-4583-92ac-bda5a94e5fb2",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
384,
-144
],
"parameters": {
"color": 7,
"width": 848,
"height": 656,
"content": "## AI-Powered Anomaly Detection and Maintenance Prioritization\n**Why:** Deploys two specialized Anthropic Claude agents\u2014one identifying abnormal patterns in telemetry data using anomaly detection models with output parsers, another calculating maintenance urgency through UL calculation tools and prioritization algorithms "
},
"typeVersion": 1
},
{
"id": "7af54179-301a-42fd-8d17-b1cd29567812",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1248,
-144
],
"parameters": {
"color": 7,
"width": 656,
"height": 656,
"content": "## Alert Formatting and Urgency-Based Routing\n**Why:** Transforms AI findings into standardized maintenance records and urgent alerts, checks urgency thresholds to route critical issues for immediate attention while logging all findings to audit database "
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"availableInMCP": false,
"executionOrder": "v1"
},
"versionId": "5053353f-62e0-4771-ae91-d207773f331c",
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "Workflow Configuration",
"type": "main",
"index": 0
}
]
]
},
"Check Urgency Level": {
"main": [
[
{
"node": "Format Urgent Alert",
"type": "main",
"index": 0
}
],
[
{
"node": "Format Standard Maintenance Record",
"type": "main",
"index": 0
}
]
]
},
"Format Urgent Alert": {
"main": [
[
{
"node": "Generate Audit Log",
"type": "main",
"index": 0
}
]
]
},
"RUL Calculation Tool": {
"ai_tool": [
[
{
"node": "Maintenance Prioritization Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Workflow Configuration": {
"main": [
[
{
"node": "Fetch Real-Time Vehicle Telemetry",
"type": "main",
"index": 0
},
{
"node": "Fetch Historical Vehicle Data",
"type": "main",
"index": 0
}
]
]
},
"Anomaly Detection Agent": {
"main": [
[
{
"node": "Maintenance Prioritization Agent",
"type": "main",
"index": 0
}
]
]
},
"Fetch Historical Vehicle Data": {
"main": [
[
{
"node": "Merge Telemetry and Historical Data",
"type": "main",
"index": 1
}
]
]
},
"Anomaly Detection Output Parser": {
"ai_outputParser": [
[
{
"node": "Anomaly Detection Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Maintenance Prioritization Agent": {
"main": [
[
{
"node": "Check Urgency Level",
"type": "main",
"index": 0
}
]
]
},
"Fetch Real-Time Vehicle Telemetry": {
"main": [
[
{
"node": "Merge Telemetry and Historical Data",
"type": "main",
"index": 0
}
]
]
},
"Format Standard Maintenance Record": {
"main": [
[
{
"node": "Generate Audit Log",
"type": "main",
"index": 0
}
]
]
},
"Merge Telemetry and Historical Data": {
"main": [
[
{
"node": "Anomaly Detection Agent",
"type": "main",
"index": 0
}
]
]
},
"Maintenance Prioritization Output Parser": {
"ai_outputParser": [
[
{
"node": "Maintenance Prioritization Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Anthropic Model - Anomaly Detection Agent": {
"ai_languageModel": [
[
{
"node": "Anomaly Detection Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Anthropic Model - Maintenance Prioritization Agent": {
"ai_languageModel": [
[
{
"node": "Maintenance Prioritization Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
anthropicApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automates predictive maintenance for vehicle fleets by combining real-time telemetry analysis with historical pattern recognition to identify potential failures before they occur. Designed for fleet managers, maintenance supervisors, and transportation operations…
Source: https://n8n.io/workflows/12991/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Automates daily project monitoring by fetching project data, analyzing tasks and team capacity with anthropic models, and generating resource optimization recommendations. Target audience: project man
This workflow automates environmental, social, and governance (ESG) data collection, compliance validation, and sustainability reporting for corporations managing complex regulatory requirements and s
Tired of grinding out YouTube content? This n8n workflow turns AI into your personal video factory—creating engaging, faceless shorts on autopilot. Perfect for creators, marketers, or side-hustlers lo
📺 Full walkthrough video: https://youtu.be/03mZE9tvELU
Faceless YouTube Generator. Uses httpRequest, limit, googleDrive, googleSheets. Webhook trigger; 49 nodes.