Surveillance automatisée de la disponibilité des API et alertes instantanées en cas de panne
Ceci est unDevOpsworkflow d'automatisation du domainecontenant 17 nœuds.Utilise principalement des nœuds comme If, Code, Wait, WhatsApp, HttpRequest. Monitoring de l'uptime des API, avec alertes WhatsApp et gestion de feuilles de calcul Google
- •Peut nécessiter les informations d'identification d'authentification de l'API cible
- •Informations d'identification Google Sheets API
Catégorie
{
"id": "pc2HHg8DLhcpoMg5",
"meta": {
"instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
"templateCredsSetupCompleted": true
},
"name": "Automated API Uptime Monitoring with Instant Downtime Alerts",
"tags": [],
"nodes": [
{
"id": "6050fae8-e86d-481f-bcf5-98461f796b5f",
"name": "Lire la Liste API",
"type": "n8n-nodes-base.googleSheets",
"position": [
-2640,
260
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1VKlDZSHicdZhhj-fl-vIIH0mC6VDwdCS4-LqaDIeyw0/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1VKlDZSHicdZhhj-fl-vIIH0mC6VDwdCS4-LqaDIeyw0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1VKlDZSHicdZhhj-fl-vIIH0mC6VDwdCS4-LqaDIeyw0/edit?usp=drivesdk",
"cachedResultName": "URL For Status Check"
},
"combineFilters": "AND"
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "rgIk6EXVdPbmPYAl",
"name": "Google Sheets account"
}
},
"typeVersion": 4.2
},
{
"id": "68940a15-d216-4366-8673-71b71305084d",
"name": "Initialiser le Compteur de Tentatives",
"type": "n8n-nodes-base.code",
"position": [
-2200,
185
],
"parameters": {
"jsCode": "// Initialize retry counter for each API\nconst apiData = $json;\nif (!apiData.retryCount) {\n apiData.retryCount = 0;\n}\nreturn apiData;"
},
"typeVersion": 2
},
{
"id": "06b0731a-81c3-449f-b302-0e9f5e2f9b0d",
"name": "Tester API",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1980,
185
],
"parameters": {
"url": "={{ $json.url }}",
"method": "={{ $json.method }}",
"options": {
"timeout": 10000
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.2,
"continueOnFail": true
},
{
"id": "f4450c0b-48fe-40d2-9b68-c54b12980a01",
"name": "Vérifier la Réponse",
"type": "n8n-nodes-base.code",
"position": [
-1760,
185
],
"parameters": {
"jsCode": "// Check if API responded\nconst response = $json;\nconst apiData = $('Init Retry Counter').first().json;\n\nlet hasResponse = response && typeof response === 'object' && Object.keys(response).length > 0;\n\nreturn {\n ...apiData,\n hasResponse: hasResponse\n};"
},
"typeVersion": 2
},
{
"id": "886d69dd-e847-4cf7-badb-5d5a02e8cfcd",
"name": "Si Pas de Réponse",
"type": "n8n-nodes-base.if",
"position": [
-1540,
185
],
"parameters": {
"options": {
"looseTypeValidation": true
},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "no-response",
"operator": {
"type": "boolean",
"operation": "true"
},
"leftValue": "={{ $json.hasResponse }}",
"rightValue": "=false"
}
]
}
},
"typeVersion": 2
},
{
"id": "be9792e7-be19-47e3-9621-613f1cc8d611",
"name": "Attendre 10 Min",
"type": "n8n-nodes-base.wait",
"position": [
-1320,
110
],
"webhookId": "b89a5cda-2fa5-40ad-b534-ed607a47c847",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "4fdd9d39-af72-42d7-9d81-0e878920709b",
"name": "Incrémenter la Tentative",
"type": "n8n-nodes-base.code",
"position": [
-1100,
35
],
"parameters": {
"jsCode": "// Increment retry count\nconst data = $json;\ndata.retryCount = (data.retryCount || 0) + 1;\nreturn data;"
},
"typeVersion": 2
},
{
"id": "c71871bb-7416-4a58-b5b6-d0c326856c62",
"name": "Retenter API",
"type": "n8n-nodes-base.httpRequest",
"position": [
-880,
35
],
"parameters": {
"url": "={{ $json.url }}",
"method": "={{ $json.method }}",
"options": {
"timeout": 10000
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.2,
"continueOnFail": true
},
{
"id": "5567bff2-495e-4b96-adbc-9d5aa290398a",
"name": "Vérifier la Réponse de la Tentative",
"type": "n8n-nodes-base.code",
"position": [
-660,
35
],
"parameters": {
"jsCode": "// Check retry response\nconst response = $json;\nconst apiData = $('Increment Retry').first().json;\n\nlet hasResponse = response && typeof response === 'object' && Object.keys(response).length > 0;\n\nreturn {\n ...apiData,\n hasResponse: hasResponse\n};"
},
"typeVersion": 2
},
{
"id": "56590da0-6e35-430b-b380-066322cdb528",
"name": "Si Toujours Pas de Réponse",
"type": "n8n-nodes-base.if",
"position": [
-440,
35
],
"parameters": {
"options": {
"looseTypeValidation": true
},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "still-no-response",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.expectedStatusCode === null || $json.expectedStatusCode === undefined || $json.expectedStatusCode === '' }}",
"rightValue": "=false"
}
]
}
},
"typeVersion": 2
},
{
"id": "1c206215-fe56-48f6-87f0-e1875e664d80",
"name": "Formater l'Alerte d'Indisponibilité",
"type": "n8n-nodes-base.code",
"position": [
0,
-40
],
"parameters": {
"jsCode": "// Create down alert message\nconst api = $json;\n\nconst alertMessage = `🚨 API DOWN ALERT\\n\\n📋 ${api.name}\\n🌐 ${api.url}\\n⏰ ${new Date().toISOString()}`;\n\nreturn {\n ...api,\n alertMessage: alertMessage\n};"
},
"typeVersion": 2
},
{
"id": "96024d21-5201-4629-9eef-547c49994d4f",
"name": "Envoyer l'Alerte WhatsApp",
"type": "n8n-nodes-base.whatsApp",
"position": [
220,
-40
],
"webhookId": "b8bca051-44db-4578-a849-6fdf7559609d",
"parameters": {
"textBody": "={{ $json.alertMessage }}",
"operation": "send",
"phoneNumberId": "550325331503475",
"additionalFields": {},
"recipientPhoneNumber": "+919974388925"
},
"credentials": {
"whatsAppApi": {
"id": "3hy4gzpVJrY1sFcR",
"name": "WhatsApp account API"
}
},
"typeVersion": 1
},
{
"id": "42753397-1223-4fc5-8df0-a340a64fc731",
"name": "Continuer avec le Prochain API",
"type": "n8n-nodes-base.code",
"position": [
440,
260
],
"parameters": {
"jsCode": "// Continue to next API\nconst data = $json;\nif (data.hasResponse) {\n data.retryCount = 0;\n}\nreturn data;"
},
"typeVersion": 2
},
{
"id": "1f5c7218-68d3-4878-a238-36ca0ad31764",
"name": "Traiter Chaque API1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-2420,
260
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "0b1af6a3-bf8e-4398-917e-f2526449ad6b",
"name": "Si Tentatives > 4 Sans Réponse",
"type": "n8n-nodes-base.if",
"position": [
-220,
-40
],
"parameters": {
"options": {
"looseTypeValidation": true
},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "still-no-response",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.retryCount >= 4}}",
"rightValue": "=false"
}
]
}
},
"typeVersion": 2
},
{
"id": "d2bb51d4-2ace-4a9c-8a7c-25c588de3063",
"name": "Planifier le Déclencheur",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-2860,
260
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"minutesInterval": 15
}
]
}
},
"typeVersion": 1.1
},
{
"id": "3fda8d5d-5311-4804-afef-4ec25ed3c92f",
"name": "Note Adhésive",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2420,
-340
],
"parameters": {
"color": 4,
"width": 1220,
"height": 340,
"content": "## How It Works\n* **Schedule Trigger** → Triggers every 15 minutes.\n* **Read API List** → Fetches all API URLs from a Google Sheet.\n* **Process Each API1** → Loops through each API entry.\n* **Init Retry Counter** → Initializes `retryCount = 0`.\n* **Test API** → Sends the first request to the API.\n* **Check Response** → Checks if a valid response was received.\n* **If No Response** → Branches into retry flow if down.\n* **Wait 10 Min → Increment Retry → Retry API → Check Retry Response** → Wait and retry API call once.\n* **If Still No Response** → Verifies if retry also failed.\n* **If Still No Retry > 4** → Checks if retry limit is reached (≥ 4).\n* **Format Down Alert** → Formats the WhatsApp alert with API details.\n* **Send WhatsApp Alert** → Sends API down alert to configured number.\n* **Continue Next API** → Moves to the next API in the list."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "2eee3704-de38-4436-9d22-57252c0ff118",
"connections": {
"06b0731a-81c3-449f-b302-0e9f5e2f9b0d": {
"main": [
[
{
"node": "f4450c0b-48fe-40d2-9b68-c54b12980a01",
"type": "main",
"index": 0
}
]
]
},
"c71871bb-7416-4a58-b5b6-d0c326856c62": {
"main": [
[
{
"node": "5567bff2-495e-4b96-adbc-9d5aa290398a",
"type": "main",
"index": 0
}
]
]
},
"be9792e7-be19-47e3-9621-613f1cc8d611": {
"main": [
[
{
"node": "4fdd9d39-af72-42d7-9d81-0e878920709b",
"type": "main",
"index": 0
}
]
]
},
"6050fae8-e86d-481f-bcf5-98461f796b5f": {
"main": [
[
{
"node": "1f5c7218-68d3-4878-a238-36ca0ad31764",
"type": "main",
"index": 0
}
]
]
},
"f4450c0b-48fe-40d2-9b68-c54b12980a01": {
"main": [
[
{
"node": "886d69dd-e847-4cf7-badb-5d5a02e8cfcd",
"type": "main",
"index": 0
}
]
]
},
"886d69dd-e847-4cf7-badb-5d5a02e8cfcd": {
"main": [
[
{
"node": "be9792e7-be19-47e3-9621-613f1cc8d611",
"type": "main",
"index": 0
}
],
[
{
"node": "42753397-1223-4fc5-8df0-a340a64fc731",
"type": "main",
"index": 0
}
]
]
},
"4fdd9d39-af72-42d7-9d81-0e878920709b": {
"main": [
[
{
"node": "c71871bb-7416-4a58-b5b6-d0c326856c62",
"type": "main",
"index": 0
}
]
]
},
"d2bb51d4-2ace-4a9c-8a7c-25c588de3063": {
"main": [
[
{
"node": "6050fae8-e86d-481f-bcf5-98461f796b5f",
"type": "main",
"index": 0
}
]
]
},
"42753397-1223-4fc5-8df0-a340a64fc731": {
"main": [
[
{
"node": "1f5c7218-68d3-4878-a238-36ca0ad31764",
"type": "main",
"index": 0
}
]
]
},
"1c206215-fe56-48f6-87f0-e1875e664d80": {
"main": [
[
{
"node": "96024d21-5201-4629-9eef-547c49994d4f",
"type": "main",
"index": 0
}
]
]
},
"1f5c7218-68d3-4878-a238-36ca0ad31764": {
"main": [
[],
[
{
"node": "68940a15-d216-4366-8673-71b71305084d",
"type": "main",
"index": 0
}
]
]
},
"68940a15-d216-4366-8673-71b71305084d": {
"main": [
[
{
"node": "06b0731a-81c3-449f-b302-0e9f5e2f9b0d",
"type": "main",
"index": 0
}
]
]
},
"96024d21-5201-4629-9eef-547c49994d4f": {
"main": [
[
{
"node": "42753397-1223-4fc5-8df0-a340a64fc731",
"type": "main",
"index": 0
}
]
]
},
"5567bff2-495e-4b96-adbc-9d5aa290398a": {
"main": [
[
{
"node": "56590da0-6e35-430b-b380-066322cdb528",
"type": "main",
"index": 0
}
]
]
},
"56590da0-6e35-430b-b380-066322cdb528": {
"main": [
[
{
"node": "0b1af6a3-bf8e-4398-917e-f2526449ad6b",
"type": "main",
"index": 0
}
],
[
{
"node": "42753397-1223-4fc5-8df0-a340a64fc731",
"type": "main",
"index": 0
}
]
]
},
"0b1af6a3-bf8e-4398-917e-f2526449ad6b": {
"main": [
[
{
"node": "1c206215-fe56-48f6-87f0-e1875e664d80",
"type": "main",
"index": 0
}
],
[
{
"node": "be9792e7-be19-47e3-9621-613f1cc8d611",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Avancé - DevOps
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Oneclick AI Squad
@oneclick-aiThe AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.
Partager ce workflow