Automatizacion - Membresias "Atencion al socio"

    Proceso de automatizacion de tareas del area de membresias y demas departamentos de caintra para atencion a socio

    Shared 8/18/2025

    297 views

    Visual Workflow

    JSON Code

    {
      "nodes": [
        {
          "name": "Start",
          "type": "n8n-nodes-base.start",
          "position": [
            250,
            300
          ],
          "parameters": {},
          "typeVersion": 1
        },
        {
          "name": "Webhook CRM Tickets",
          "type": "n8n-nodes-base.webhook",
          "position": [
            450,
            200
          ],
          "webhookId": "crm-tickets-webhook",
          "parameters": {
            "events": [
              "ticketCreated",
              "ticketUpdated"
            ]
          },
          "typeVersion": 1
        },
        {
          "name": "Obtener Ticket CRM",
          "type": "n8n-nodes-base.crm",
          "position": [
            650,
            200
          ],
          "parameters": {
            "resource": "ticket",
            "ticketId": "={{$node[\"Webhook CRM Tickets\"].json[\"id\"]}}",
            "operation": "get"
          },
          "credentials": {
            "crmApi": "your-crm-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Webhook WhatsApp",
          "type": "n8n-nodes-base.whatsApp",
          "position": [
            450,
            300
          ],
          "parameters": {
            "event": "message"
          },
          "credentials": {
            "whatsAppApi": "your-whatsapp-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Webhook Email",
          "type": "n8n-nodes-base.emailReadImap",
          "position": [
            450,
            400
          ],
          "parameters": {
            "event": "message"
          },
          "credentials": {
            "imap": "your-email-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Obtener Socio",
          "type": "n8n-nodes-base.crm",
          "position": [
            850,
            300
          ],
          "parameters": {
            "memberId": "={{$node[\"Obtener Ticket CRM\"].json[\"member_id\"] || $node[\"Webhook WhatsApp\"].json[\"from\"] || $node[\"Webhook Email\"].json[\"from\"]}}",
            "resource": "member",
            "operation": "get"
          },
          "credentials": {
            "crmApi": "your-crm-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Prefiere WhatsApp?",
          "type": "n8n-nodes-base.if",
          "position": [
            1050,
            250
          ],
          "parameters": {
            "conditions": {
              "conditions": [
                {
                  "value1": "={{$node[\"Obtener Socio\"].json[\"preferred_contact_method\"]}}",
                  "value2": "whatsapp",
                  "operation": "equal"
                }
              ]
            }
          },
          "typeVersion": 1
        },
        {
          "name": "Prefiere Email?",
          "type": "n8n-nodes-base.if",
          "position": [
            1050,
            350
          ],
          "parameters": {
            "conditions": {
              "conditions": [
                {
                  "value1": "={{$node[\"Obtener Socio\"].json[\"preferred_contact_method\"]}}",
                  "value2": "email",
                  "operation": "equal"
                }
              ]
            }
          },
          "typeVersion": 1
        },
        {
          "name": "Enviar WhatsApp",
          "type": "n8n-nodes-base.whatsApp",
          "position": [
            1250,
            250
          ],
          "parameters": {
            "to": "={{$node[\"Obtener Socio\"].json[\"phone\"]}}",
            "message": "={{$node[\"Obtener Socio\"].json[\"first_name\"]}}, hemos recibido su solicitud y la estamos procesando. Gracias por su paciencia."
          },
          "credentials": {
            "whatsAppApi": "your-whatsapp-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Enviar Email",
          "type": "n8n-nodes-base.emailSend",
          "position": [
            1250,
            350
          ],
          "parameters": {
            "to": "={{$node[\"Obtener Socio\"].json[\"email\"]}}",
            "body": "Estimado {{$node[\"Obtener Socio\"].json[\"first_name\"]}},<br><br>Hemos recibido su solicitud y la estamos procesando.<br><br>Número de ticket: {{$node[\"Obtener Ticket CRM\"].json[\"id\"]}}<br><br>Saludos cordiales,<br>El equipo de atención a socios",
            "subject": "Confirmación de recepción"
          },
          "credentials": {
            "smtp": "your-smtp-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Actualizar Ticket",
          "type": "n8n-nodes-base.crm",
          "position": [
            1250,
            450
          ],
          "parameters": {
            "body": {
              "status": "in_progress",
              "assigned_to": "support_team"
            },
            "resource": "ticket",
            "ticketId": "={{$node[\"Obtener Ticket CRM\"].json[\"id\"]}}",
            "operation": "update"
          },
          "credentials": {
            "crmApi": "your-crm-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Crear Tarea Llamada",
          "type": "n8n-nodes-base.crm",
          "position": [
            1250,
            550
          ],
          "parameters": {
            "body": {
              "title": "Llamar a socio: {{$node[\"Obtener Socio\"].json[\"first_name\"]}} {{$node[\"Obtener Socio\"].json[\"last_name\"]}}",
              "due_date": "={{new Date(new Date().setHours(new Date().getHours() + 2)).toISOString()}}",
              "assigned_to": "call_center",
              "description": "El socio prefiere contacto telefónico. Número: {{$node[\"Obtener Socio\"].json[\"phone\"]}}"
            },
            "resource": "task",
            "operation": "create"
          },
          "credentials": {
            "crmApi": "your-crm-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Obtener Socios Activos",
          "type": "n8n-nodes-base.crm",
          "position": [
            450,
            600
          ],
          "parameters": {
            "options": {
              "filter": {
                "membership_status": "active"
              }
            },
            "resource": "member",
            "operation": "getAll"
          },
          "credentials": {
            "crmApi": "your-crm-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Obtener Eventos Proximos",
          "type": "n8n-nodes-base.crm",
          "position": [
            450,
            700
          ],
          "parameters": {
            "options": {
              "filter": {
                "end_date": "={{new Date(new Date().setMonth(new Date().getMonth() + 1)).toISOString()}}",
                "start_date": "={{new Date().toISOString()}}"
              }
            },
            "resource": "event",
            "operation": "getAll"
          },
          "credentials": {
            "crmApi": "your-crm-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Filtrar WhatsApp",
          "type": "n8n-nodes-base.if",
          "position": [
            650,
            600
          ],
          "parameters": {
            "conditions": {
              "conditions": [
                {
                  "value1": "={{$node[\"Obtener Socios Activos\"].json[\"preferred_contact_method\"]}}",
                  "value2": "whatsapp",
                  "operation": "equal"
                }
              ]
            }
          },
          "typeVersion": 1
        },
        {
          "name": "Invitar por WhatsApp",
          "type": "n8n-nodes-base.whatsApp",
          "position": [
            850,
            600
          ],
          "parameters": {
            "to": "={{$node[\"Obtener Socios Activos\"].json[\"phone\"]}}",
            "message": "Estimado {{$node[\"Obtener Socios Activos\"].json[\"first_name\"]}}, le invitamos a nuestro evento: {{$node[\"Obtener Eventos Proximos\"].json[\"title\"]}}. Responda SI para confirmar asistencia."
          },
          "credentials": {
            "whatsAppApi": "your-whatsapp-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Invitar por Email",
          "type": "n8n-nodes-base.emailSend",
          "position": [
            850,
            700
          ],
          "parameters": {
            "to": "={{$node[\"Obtener Socios Activos\"].json[\"email\"]}}",
            "body": "Estimado {{$node[\"Obtener Socios Activos\"].json[\"first_name\"]}},<br><br>Le invitamos cordialmente a nuestro evento.<br><br>Fecha: {{$node[\"Obtener Eventos Proximos\"].json[\"start_date\"]}}<br>Lugar: {{$node[\"Obtener Eventos Proximos\"].json[\"location\"]}}<br><br>Por favor confirme su asistencia respondiendo este email.<br><br>Saludos cordiales,<br>El equipo de eventos",
            "subject": "Invitación a evento: {{$node[\"Obtener Eventos Proximos\"].json[\"title\"]}}"
          },
          "credentials": {
            "smtp": "your-smtp-credentials"
          },
          "typeVersion": 1
        },
        {
          "name": "Registrar Invitación",
          "type": "n8n-nodes-base.crm",
          "position": [
            1050,
            650
          ],
          "parameters": {
            "body": {
              "invitation_date": "={{new Date().toISOString()}}",
              "last_event_invitation": "={{$node[\"Obtener Eventos Proximos\"].json[\"id\"]}}"
            },
            "memberId": "={{$node[\"Obtener Socios Activos\"].json[\"id\"]}}",
            "resource": "member",
            "operation": "update"
          },
          "credentials": {
            "crmApi": "your-crm-credentials"
          },
          "typeVersion": 1
        }
      ],
      "active": true,
      "version": 1,
      "settings": {},
      "webhooks": [],
      "connections": {
        "Start": {
          "main": [
            [
              {
                "node": "Webhook CRM Tickets",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Webhook WhatsApp",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Webhook Email",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Obtener Socios Activos",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Obtener Socio": {
          "main": [
            [
              {
                "node": "Prefiere WhatsApp?",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Prefiere Email?",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Actualizar Ticket",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Webhook Email": {
          "main": [
            [
              {
                "node": "Obtener Socio",
                "type": "main",
                "index": 2
              }
            ]
          ]
        },
        "Prefiere Email?": {
          "main": [
            [
              {
                "node": "Enviar Email",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Filtrar WhatsApp": {
          "main": [
            [
              {
                "node": "Invitar por WhatsApp",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Webhook WhatsApp": {
          "main": [
            [
              {
                "node": "Obtener Socio",
                "type": "main",
                "index": 1
              }
            ]
          ]
        },
        "Invitar por Email": {
          "main": [
            [
              {
                "node": "Registrar Invitación",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Obtener Ticket CRM": {
          "main": [
            [
              {
                "node": "Obtener Socio",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Prefiere WhatsApp?": {
          "main": [
            [
              {
                "node": "Enviar WhatsApp",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Crear Tarea Llamada",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Webhook CRM Tickets": {
          "main": [
            [
              {
                "node": "Obtener Ticket CRM",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Invitar por WhatsApp": {
          "main": [
            [
              {
                "node": "Registrar Invitación",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Obtener Socios Activos": {
          "main": [
            [
              {
                "node": "Filtrar WhatsApp",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Invitar por Email",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Obtener Eventos Proximos": {
          "main": [
            [
              {
                "node": "Invitar por WhatsApp",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Invitar por Email",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      }
    }