Exportar relaciones de miembros inteligentes de Jamf como un informe CSV visible a Slack
Este es unDevOpsflujo de automatización del dominio deautomatización que contiene 21 nodos.Utiliza principalmente nodos como Set, Code, Slack, Webhook, SplitOut. Exportar relaciones de miembros de grupos inteligentes de Jamf como un informe CSV visible en Slack
- •Bot Token de Slack o URL de Webhook
- •Punto final de HTTP Webhook (n8n generará automáticamente)
- •Pueden requerirse credenciales de autenticación para la API de destino
Nodos utilizados (21)
Categoría
{
"meta": {
"instanceId": "894b3446666dc2807d20dfad165e2f6f3696905c2f8c352081f4fd666cdd7b1c"
},
"nodes": [
{
"id": "5fa718ad-f53d-4a5a-8106-f1f1aef44d47",
"name": "Al hacer clic en 'Ejecutar flujo de trabajo'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1780,
820
],
"parameters": {},
"typeVersion": 1
},
{
"id": "c137c6b0-1b24-43e4-b6a6-6ed59270d87d",
"name": "Iterar sobre grupos",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-840,
680
],
"parameters": {
"options": {
"reset": false
}
},
"typeVersion": 3,
"alwaysOutputData": false
},
{
"id": "09fe9c6e-aefd-491a-b888-339311577ef7",
"name": "Obtener miembros del grupo",
"type": "n8n-nodes-base.httpRequest",
"position": [
-640,
660
],
"parameters": {
"url": "=https://{{ $('Jamf Server').item.json.server }}.jamfcloud.com/api/v2/computer-groups/smart-group-membership/{{ $json.value }}",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "oAuth2Api"
},
"credentials": {
"oAuth2Api": {
"id": "SRjYS4PQ8cCMgZLK",
"name": "Unnamed credential"
}
},
"typeVersion": 4.2
},
{
"id": "d79584bf-5dbb-42a2-a84d-03bc7f2b0672",
"name": "Separar miembros",
"type": "n8n-nodes-base.splitOut",
"position": [
-440,
660
],
"parameters": {
"include": "selectedOtherFields",
"options": {},
"fieldToSplitOut": "members",
"fieldsToInclude": "={{ $('Split groups').item.json.key }}"
},
"typeVersion": 1
},
{
"id": "1db7afe2-6a80-40ee-a2e5-5d595689aeb2",
"name": "Separar grupos",
"type": "n8n-nodes-base.code",
"position": [
-1080,
740
],
"parameters": {
"jsCode": "const input = items[0].json;\nconst result = [];\n\nfor (const key in input) {\n result.push({\n json: {\n key,\n value: input[key]\n }\n });\n}\n\nreturn result;\n"
},
"typeVersion": 2
},
{
"id": "198f7370-f57b-42f7-ad89-5ce85ffda239",
"name": "Disparador Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-1780,
620
],
"webhookId": "d0baf32a-ccec-43dc-9d68-5ffd536b8a1c",
"parameters": {
"path": "d0baf32a-ccec-43dc-9d68-5ffd536b8a1c",
"options": {}
},
"typeVersion": 2
},
{
"id": "a7f64b31-e442-4478-809b-c11c4684fb44",
"name": "Convertir a csv",
"type": "n8n-nodes-base.convertToFile",
"position": [
160,
660
],
"parameters": {
"options": {
"fileName": "=_",
"headerRow": true
},
"binaryPropertyName": "=data"
},
"typeVersion": 1.1
},
{
"id": "a3c00893-c871-4988-a2fd-dab9d655add4",
"name": "Servidor Jamf",
"type": "n8n-nodes-base.set",
"position": [
-1540,
740
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "ff1f57d8-399e-4b4d-89a6-b3ac44f40923",
"name": "server",
"type": "string",
"value": "yourSercer"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "f91f4654-9d36-4ccd-91df-7489aeced998",
"name": "Encabezados CSV",
"type": "n8n-nodes-base.set",
"position": [
-40,
660
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "1cf47bfc-0457-4b6a-ac61-d439bff50691",
"name": "Device Name",
"type": "string",
"value": "={{ $json.general.name }}"
},
{
"id": "3af207c9-eb53-4eec-a5aa-7a125af3c76e",
"name": "Last contact",
"type": "string",
"value": "={{ $json.general.lastContactTime.substring(0,10) }}"
},
{
"id": "d9a77e89-2bee-44e6-9220-06fac550a604",
"name": "S/N",
"type": "string",
"value": "={{ $json.hardware.serialNumber }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ca2d2077-4ed4-4952-8365-e790480b2166",
"name": "Nota adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1620,
520
],
"parameters": {
"width": 480,
"height": 420,
"content": "## Set\n**Node: Jamf Server**\nSet your jamf BaseURL from your jamf URL\nhttps://yourServer.jamfcloud.com\n\n**Node: IDs**\nSet the smart group IDs "
},
"typeVersion": 1
},
{
"id": "7e0484b8-2151-4ed7-b241-2c1de919e93a",
"name": "IDs",
"type": "n8n-nodes-base.set",
"position": [
-1300,
740
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "f7cff112-42bd-4672-9a2f-c0c0b65bb216",
"name": "Smart Group 1",
"type": "string",
"value": "70"
},
{
"id": "a3b44780-bcee-431c-8ab5-913eb20dd0b6",
"name": "Smart Group 2",
"type": "string",
"value": "166"
},
{
"id": "d0ae5b18-9417-4186-9d14-b39d1d9c7aa3",
"name": "Smart Group 3",
"type": "string",
"value": "208"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "69993c27-ab3d-4e36-825d-d87d00095392",
"name": "Nota adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1120,
520
],
"parameters": {
"color": 3,
"width": 220,
"height": 420,
"content": "## Split \nSplit previous node array into items"
},
"typeVersion": 1
},
{
"id": "273b0995-4b40-4f8e-ab94-affbfafe8f2c",
"name": "Nota adhesiva2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-880,
240
],
"parameters": {
"color": 7,
"width": 1430,
"height": 700,
"content": "## Loop\n"
},
"typeVersion": 1
},
{
"id": "163460ca-44fa-4b8c-9545-e71e6f713ade",
"name": "Nota adhesiva3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-680,
460
],
"parameters": {
"color": 4,
"width": 180,
"height": 400,
"content": "## Get \nGet group members IDs"
},
"typeVersion": 1
},
{
"id": "484bb691-c2b0-4da1-8294-89b55baad943",
"name": "Nota adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-480,
460
],
"parameters": {
"color": 3,
"width": 180,
"height": 400,
"content": "## Split \nSplit members array into individual members"
},
"typeVersion": 1
},
{
"id": "e5c86151-13f6-41d9-9017-8be5c5faa1de",
"name": "Nota adhesiva5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-280,
460
],
"parameters": {
"color": 7,
"width": 180,
"height": 400,
"content": "## 2nd Loop\n\nNested loops don't work very well so using a sub workflow is the cleanest solution\n-Loop over members and get their details"
},
"typeVersion": 1
},
{
"id": "7deab3c2-a171-4492-8de4-feb2af3755ce",
"name": "Bucle de miembros",
"type": "n8n-nodes-base.executeWorkflow",
"position": [
-240,
660
],
"parameters": {
"options": {
"waitForSubWorkflow": "={{ true }}"
},
"workflowId": {
"__rl": true,
"mode": "list",
"value": "UYr3yGHbhA6RFyND",
"cachedResultName": "get members"
},
"workflowInputs": {
"value": {},
"schema": [],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": true
}
},
"typeVersion": 1.2
},
{
"id": "eba5da43-adb7-4804-bc9b-12cf4d8cead7",
"name": "Nota adhesiva6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
460
],
"parameters": {
"color": 5,
"width": 180,
"height": 400,
"content": "## Select\nSet the CSV header"
},
"typeVersion": 1
},
{
"id": "b9232c0e-65bd-4e23-92e5-98050a784532",
"name": "Nota adhesiva7",
"type": "n8n-nodes-base.stickyNote",
"position": [
120,
460
],
"parameters": {
"color": 2,
"width": 180,
"height": 400,
"content": "## Convert\nConvert JSON ouput to CSV for each group"
},
"typeVersion": 1
},
{
"id": "0a5f5bcd-0c7c-49a0-a4cc-7996c5b50dfe",
"name": "Nota adhesiva8",
"type": "n8n-nodes-base.stickyNote",
"position": [
320,
460
],
"parameters": {
"width": 200,
"height": 400,
"content": "## Post\nPost the group and members summary into a Slack channel"
},
"typeVersion": 1
},
{
"id": "e46998ca-b549-45b1-8e41-2b7c516bdd67",
"name": "Canal Slack",
"type": "n8n-nodes-base.slack",
"position": [
380,
720
],
"webhookId": "b21eb82b-589d-469d-8181-7e5c002cc20a",
"parameters": {
"options": {
"fileName": "data.csv",
"channelId": "C07PQP5J1BJ",
"initialComment": "=🚨<https://{{ $('Jamf Server').item.json.server }}.jamfcloud.com/smartComputerGroups.html?id={{ $('Split groups').item.json.value }}|{{ $('Split groups').item.json.key }} Group>🚨\n"
},
"resource": "file"
},
"credentials": {
"slackApi": {
"id": "8kwaKSXWJHzDApmZ",
"name": "Slack"
}
},
"executeOnce": true,
"typeVersion": 2.3
}
],
"pinData": {},
"connections": {
"7e0484b8-2151-4ed7-b241-2c1de919e93a": {
"main": [
[
{
"node": "1db7afe2-6a80-40ee-a2e5-5d595689aeb2",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "a3c00893-c871-4988-a2fd-dab9d655add4",
"type": "main",
"index": 0
}
]
]
},
"f91f4654-9d36-4ccd-91df-7489aeced998": {
"main": [
[
{
"node": "a7f64b31-e442-4478-809b-c11c4684fb44",
"type": "main",
"index": 0
}
]
]
},
"a3c00893-c871-4988-a2fd-dab9d655add4": {
"main": [
[
{
"node": "7e0484b8-2151-4ed7-b241-2c1de919e93a",
"type": "main",
"index": 0
}
]
]
},
"7deab3c2-a171-4492-8de4-feb2af3755ce": {
"main": [
[
{
"node": "f91f4654-9d36-4ccd-91df-7489aeced998",
"type": "main",
"index": 0
}
]
]
},
"1db7afe2-6a80-40ee-a2e5-5d595689aeb2": {
"main": [
[
{
"node": "c137c6b0-1b24-43e4-b6a6-6ed59270d87d",
"type": "main",
"index": 0
}
]
]
},
"e46998ca-b549-45b1-8e41-2b7c516bdd67": {
"main": [
[
{
"node": "c137c6b0-1b24-43e4-b6a6-6ed59270d87d",
"type": "main",
"index": 0
}
]
]
},
"a7f64b31-e442-4478-809b-c11c4684fb44": {
"main": [
[
{
"node": "e46998ca-b549-45b1-8e41-2b7c516bdd67",
"type": "main",
"index": 0
}
]
]
},
"c137c6b0-1b24-43e4-b6a6-6ed59270d87d": {
"main": [
[],
[
{
"node": "09fe9c6e-aefd-491a-b888-339311577ef7",
"type": "main",
"index": 0
}
]
]
},
"09fe9c6e-aefd-491a-b888-339311577ef7": {
"main": [
[
{
"node": "d79584bf-5dbb-42a2-a84d-03bc7f2b0672",
"type": "main",
"index": 0
}
]
]
},
"d79584bf-5dbb-42a2-a84d-03bc7f2b0672": {
"main": [
[
{
"node": "7deab3c2-a171-4492-8de4-feb2af3755ce",
"type": "main",
"index": 0
}
]
]
},
"5fa718ad-f53d-4a5a-8106-f1f1aef44d47": {
"main": [
[
{
"node": "a3c00893-c871-4988-a2fd-dab9d655add4",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Avanzado - DevOps
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Jean-Marie Rizkallah
@mrrobotCompartir este flujo de trabajo