{
  "name": "Onboarding Automatizado para Nuevos Colaboradores",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 1
            }
          ]
        }
      },
      "id": "b0c1d2e3-0020-4a01-b001-ef1234567001",
      "name": "Schedule Trigger - Revisar Nuevos",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [250, 300]
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "byName",
          "value": "Onboarding"
        },
        "filters": {
          "column": "estado",
          "value": "Nuevo"
        },
        "options": {}
      },
      "id": "b0c1d2e3-0020-4a02-b002-ef1234567002",
      "name": "Google Sheets - Detectar Nuevos",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [500, 300],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $json.correo }}",
        "subject": "=🎉 ¡Bienvenido/a al equipo, {{ $json.nombre }}!",
        "emailType": "html",
        "message": "=<div style='font-family:Arial,sans-serif;max-width:600px;margin:0 auto;'><div style='background:linear-gradient(135deg,#1a73e8,#0d47a1);color:white;padding:30px;text-align:center;border-radius:8px 8px 0 0;'><h1 style='margin:0;'>¡Bienvenido/a al equipo!</h1><p style='margin:8px 0 0;'>{{ $json.nombre }}</p></div><div style='padding:20px;'><p>Estamos muy contentos de que te unas a nuestro equipo como <strong>{{ $json.cargo }}</strong>.</p><h3>📋 Documentos por completar:</h3><ul><li>✅ Contrato de trabajo — <a href='ENLACE_CONTRATO'>Descargar aquí</a></li><li>✅ Formulario de datos para el IESS — <a href='ENLACE_IESS'>Descargar aquí</a></li><li>✅ Datos bancarios para nómina — <a href='ENLACE_BANCO'>Descargar aquí</a></li><li>✅ Acuerdo de confidencialidad — <a href='ENLACE_CONFIDENCIALIDAD'>Descargar aquí</a></li></ul><h3>📅 Tu primer día:</h3><p><strong>Fecha:</strong> {{ $json.fecha_ingreso }}<br><strong>Hora:</strong> 8:30 AM<br><strong>Lugar:</strong> {{ $json.ubicacion_oficina }}</p><p>Tu supervisor directo es <strong>{{ $json.supervisor }}</strong>, quien te guiará durante tu primera semana.</p><p>¡Nos vemos pronto!</p></div></div>",
        "options": {}
      },
      "id": "b0c1d2e3-0020-4a03-b003-ef1234567003",
      "name": "Gmail - Correo de Bienvenida",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [750, 200],
      "credentials": {
        "gmailOAuth2": {
          "id": "",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "folderName": "={{ $json.nombre + ' - ' + $json.cargo }}",
        "parentFolder": "CARPETA_EMPLEADOS_ID",
        "options": {}
      },
      "id": "b0c1d2e3-0020-4a04-b004-ef1234567004",
      "name": "Google Drive - Crear Carpeta",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [750, 400],
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "",
          "name": "Google Drive account"
        }
      }
    },
    {
      "parameters": {
        "channel": "#general",
        "text": "=🎉 *¡Nuevo integrante en el equipo!*\n\n👤 *{{ $json.nombre }}*\n💼 Cargo: {{ $json.cargo }}\n📅 Se une el: {{ $json.fecha_ingreso }}\n🏢 Departamento: {{ $json.departamento }}\n\n¡Démosle la bienvenida! 👏",
        "otherOptions": {
          "mrkdwn": true
        }
      },
      "id": "b0c1d2e3-0020-4a05-b005-ef1234567005",
      "name": "Slack - Anuncio al Equipo",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [1000, 300],
      "credentials": {
        "slackOAuth2Api": {
          "id": "",
          "name": "Slack account"
        }
      }
    },
    {
      "parameters": {
        "amount": 3,
        "unit": "days"
      },
      "id": "b0c1d2e3-0020-4a06-b006-ef1234567006",
      "name": "Wait - 3 Días",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [1250, 300]
    },
    {
      "parameters": {
        "sendTo": "={{ $json.correo_supervisor }}",
        "subject": "=📋 Recordatorio: Verificar documentos de {{ $json.nombre }}",
        "emailType": "html",
        "message": "=<h2>Recordatorio de Onboarding</h2><p>Hola {{ $json.supervisor }},</p><p>Han pasado 3 días desde el ingreso de <strong>{{ $json.nombre }}</strong>. Por favor verifica:</p><ul><li>☐ ¿Se completaron todos los documentos de ingreso?</li><li>☐ ¿Se realizó la inducción al puesto?</li><li>☐ ¿Tiene acceso a todas las herramientas necesarias?</li><li>☐ ¿Se presentó al equipo?</li></ul><p>Por favor actualiza el estado en la hoja de Onboarding.</p>",
        "options": {}
      },
      "id": "b0c1d2e3-0020-4a07-b007-ef1234567007",
      "name": "Gmail - Recordatorio Supervisor 3 Días",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [1500, 200],
      "credentials": {
        "gmailOAuth2": {
          "id": "",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "amount": 7,
        "unit": "days"
      },
      "id": "b0c1d2e3-0020-4a08-b008-ef1234567008",
      "name": "Wait - 1 Semana",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [1750, 200]
    },
    {
      "parameters": {
        "sendTo": "={{ $json.correo }}",
        "subject": "=¿Cómo va tu primera semana, {{ $json.nombre }}? 📝",
        "emailType": "html",
        "message": "=<h2>Encuesta de Satisfacción - Primera Semana</h2><p>Hola {{ $json.nombre }},</p><p>¡Ya completaste tu primera semana! Queremos saber cómo te has sentido.</p><p>Por favor toma 2 minutos para completar esta breve encuesta:</p><a href='ENLACE_ENCUESTA' style='display:inline-block;background:#1a73e8;color:white;padding:12px 24px;text-decoration:none;border-radius:4px;'>📝 Completar Encuesta</a><p>Tu retroalimentación nos ayuda a mejorar la experiencia para futuros compañeros.</p>",
        "options": {}
      },
      "id": "b0c1d2e3-0020-4a09-b009-ef1234567009",
      "name": "Gmail - Encuesta Primera Semana",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [2000, 200],
      "credentials": {
        "gmailOAuth2": {
          "id": "",
          "name": "Gmail account"
        }
      }
    }
  ],
  "connections": {
    "Schedule Trigger - Revisar Nuevos": {
      "main": [
        [
          {
            "node": "Google Sheets - Detectar Nuevos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Detectar Nuevos": {
      "main": [
        [
          {
            "node": "Gmail - Correo de Bienvenida",
            "type": "main",
            "index": 0
          },
          {
            "node": "Google Drive - Crear Carpeta",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail - Correo de Bienvenida": {
      "main": [
        [
          {
            "node": "Slack - Anuncio al Equipo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive - Crear Carpeta": {
      "main": [
        [
          {
            "node": "Slack - Anuncio al Equipo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack - Anuncio al Equipo": {
      "main": [
        [
          {
            "node": "Wait - 3 Días",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait - 3 Días": {
      "main": [
        [
          {
            "node": "Gmail - Recordatorio Supervisor 3 Días",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail - Recordatorio Supervisor 3 Días": {
      "main": [
        [
          {
            "node": "Wait - 1 Semana",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait - 1 Semana": {
      "main": [
        [
          {
            "node": "Gmail - Encuesta Primera Semana",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    {
      "name": "hr-operations"
    },
    {
      "name": "onboarding"
    },
    {
      "name": "talento-humano"
    }
  ]
}
