Automatización de incorporación de usuarios de la base de datos a Saleshandy

Avanzado

Este es unLead Nurturingflujo de automatización del dominio deautomatización que contiene 16 nodos.Utiliza principalmente nodos como Code, HttpRequest, GoogleSheets, ManualTrigger. Automatizar el onboarding de usuarios desde la base de datos a Saleshandy con seguimiento en Google Sheets

Requisitos previos
  • Pueden requerirse credenciales de autenticación para la API de destino
  • Credenciales de API de Google Sheets
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "meta": {
    "instanceId": "5f48daf3a0baf541941ac99dac87a58469ec38ada0698ec3f47e71ef7e50b0ff"
  },
  "nodes": [
    {
      "id": "9c9c4619-6e83-4a31-b783-c1250540b6ff",
      "name": "Obtener fechas de ayer",
      "type": "n8n-nodes-base.code",
      "position": [
        380,
        480
      ],
      "parameters": {
        "jsCode": "function formatToSupabaseTimestamp(date) {\n  const iso = date.toISOString();\n  const [datePart, ms = \"000\"] = iso.split('.')[1]?.split('Z') || [\"000\"];\n  const paddedMicro = (ms + \"000000\").slice(0, 6);\n  return iso.replace(/\\.\\d+Z/, `.${paddedMicro}+00:00`);\n}\n\nconst now = new Date();\n\nconst yesterday = new Date(now);\nyesterday.setDate(now.getDate() - 1);\nyesterday.setHours(0, 0, 0, 0);\n\nconst start = new Date(yesterday);\nconst end = new Date(yesterday);\nend.setHours(23, 59, 59, 999);\n\nreturn [\n  {\n    json: {\n      isoStart: formatToSupabaseTimestamp(start),\n      isoEnd: formatToSupabaseTimestamp(end)\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "381fac0c-25bc-4322-980d-009012378923",
      "name": "Nota adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        320
      ],
      "parameters": {
        "width": 360,
        "height": 340,
        "content": "## Fetch All Users\nThis step fetches all users from your database and filters them based on the selected date range (e.g., yesterday, last 7 days, etc.)."
      },
      "typeVersion": 1
    },
    {
      "id": "d216b2d6-ae67-451f-923d-5bd07f847b00",
      "name": "Agregar fila para semi-calificados",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1560,
        120
      ],
      "parameters": {
        "columns": {
          "value": {
            "ID": "={{ $('Date Filtered Users').item.json.id }}",
            "Name ": "={{ $('Date Filtered Users').item.json.first_name }}",
            "Email ": "={{ $('Date Filtered Users').item.json.email }}",
            "created_at": "={{ $('Date Filtered Users').item.json.created_at}}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "created_at",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "message",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "payload",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "payload",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZfV7CLtXKzNtiQcF_9XgHUwyVn467hpYrwFaQ3Hfhmc/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ZfV7CLtXKzNtiQcF_9XgHUwyVn467hpYrwFaQ3Hfhmc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZfV7CLtXKzNtiQcF_9XgHUwyVn467hpYrwFaQ3Hfhmc/edit?usp=drivesdk",
          "cachedResultName": "database fetch "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "RWziWEBHK0Fgyt1r",
          "name": "Google Sheets account 5"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "dbb1cba5-658e-4065-b8d7-5d7dc0d994aa",
      "name": "Obtener todos los usuarios de la base de datos",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        680,
        120
      ],
      "parameters": {
        "url": "ADD YOUR DATABASE URL",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "apikey",
              "value": "ADD YOUR DATABASE ANON KEY"
            },
            {
              "name": "Authorization",
              "value": "ADD YOUR SERVICE ROLE KEY (ADD bearer BEFORE SR KEY)"
            }
          ]
        }
      },
      "typeVersion": 4
    },
    {
      "id": "1281e124-bf06-4dae-a232-2142d566fb20",
      "name": "Usuarios filtrados por fecha",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        120
      ],
      "parameters": {
        "jsCode": "const isoStart = $items(\"Get yesterday dates\")[0].json.isoStart;\nconst isoEnd = $items(\"Get yesterday dates\")[0].json.isoEnd;\n\nreturn items\n  .filter(item => {\n    const createdAt = new Date(item.json.created_at);\n    const start = new Date(isoStart);\n    const end = new Date(isoEnd);\n    return createdAt >= start && createdAt <= end;\n  })\n  .map(item => {\n    const [first_name, ...rest] = item.json.full_name.split(' ');\n    const last_name = rest.join(' ') || '';\n    return {\n      json: {\n        id: item.json.id,\n        first_name: first_name,\n        last_name: last_name,\n        email: item.json.email,\n        created_at: item.json.created_at\n      }\n    };\n  });\n"
      },
      "typeVersion": 2
    },
    {
      "id": "f54a17c0-b64c-4da7-b9d6-4e52768db0a9",
      "name": "Nota adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 1820,
        "height": 700,
        "content": "## **OnboardTrigger:  Signup to Saleshandy Sequence**\nAutomatically connects your new application signups from the database to a targeted Saleshandy email sequence. This ensures every new user receives timely, personalized outreach, whether it’s for onboarding, nudging them to purchase a plan, or sharing any custom message. "
      },
      "typeVersion": 1
    },
    {
      "id": "79afa502-655d-4431-8fca-f32ec7abdb51",
      "name": "Nota adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        280
      ],
      "parameters": {
        "height": 320,
        "content": "## Trigger this workflow to reach every new signup —> daily.\n\nMake it part of your everyday routine to automatically fetch leads from your app, add them to a Saleshandy sequence, and send timely emails to engage, nurture, and encourage them to become paying customers"
      },
      "typeVersion": 1
    },
    {
      "id": "266fdde0-d952-4a11-bc7f-8bc52b5845ec",
      "name": "Activador diario",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        100,
        120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4b47add8-1967-4769-a355-58b88151d147",
      "name": "Agregar nuevo registro a la Secuencia de Saleshandy",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1200,
        520
      ],
      "parameters": {
        "url": "https://open-api.saleshandy.com/v1/sequences/prospects/import-with-field-name",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"prospectList\": [\n    {\n      \"First Name\": \"{{ $json['first_name']}}\",\n      \"Email\": \"{{ $json['email']}}\"\n    }\n  ],\n  \"stepId\": \"ADD YOUR SALESHANDY SEQUENCE ID\",\n  \"verifyProspects\": false,\n  \"conflictAction\": \"overwrite\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "ADD YOUR SALESHANDY API KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "dae2032f-b0f1-4d41-ad01-d01748e12fad",
      "name": "Nota adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        120
      ],
      "parameters": {
        "height": 200,
        "content": "## Date Generator\nGenerates **yesterday’s date** for filtering signups in the next steps.\n\n**Note:** You can update this to any range; day, week, or month, as needed."
      },
      "typeVersion": 1
    },
    {
      "id": "06b5b4d0-a5cb-4fd8-84b2-5462a91d70bd",
      "name": "Nota adhesiva5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        100
      ],
      "parameters": {
        "width": 320,
        "height": 400,
        "content": "## Connect to Saleshandy's Sequence \nThis step connects to your Saleshandy sequence, allowing you to automatically send customized emails to your new users as part of your outreach flow."
      },
      "typeVersion": 1
    },
    {
      "id": "76700793-0958-495d-8d6d-d4d2b98bd976",
      "name": "Nota adhesiva4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        440
      ],
      "parameters": {
        "color": 3,
        "width": 320,
        "height": 200,
        "content": "## What you need to update:\nMake sure to update the node with your actual:\n**Database URL**\n**Public Anon Key**\n**Service Role Key**\nThese are required to authenticate and query your database correctly."
      },
      "typeVersion": 1
    },
    {
      "id": "a10100f0-5c60-4320-bcb7-b07dfd7fb153",
      "name": "Nota adhesiva6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        340,
        340
      ],
      "parameters": {
        "color": 3,
        "width": 180,
        "height": 80,
        "content": "by default Yesterday's date is set"
      },
      "typeVersion": 1
    },
    {
      "id": "c7b44a55-ec88-4ba3-94b5-dcbd5be785ba",
      "name": "Nota adhesiva7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        280
      ],
      "parameters": {
        "color": 3,
        "width": 280,
        "height": 200,
        "content": "## What you need to update:\nAdd the following values to this node for it to work correctly:\n**Saleshandy API Key**\n**Your Sequence ID** (retrieved from your Saleshandy sequence)"
      },
      "typeVersion": 1
    },
    {
      "id": "a7dec1af-92fb-4a1b-8576-8fedb3fe5fdf",
      "name": "Nota adhesiva8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1480,
        300
      ],
      "parameters": {
        "width": 320,
        "height": 340,
        "content": "## Append to Google Sheets\nThis step appends your latest user data to a selected Google Sheet for tracking, analysis, or backup."
      },
      "typeVersion": 1
    },
    {
      "id": "21032964-c416-4a79-8169-b1ae8a437b51",
      "name": "Nota adhesiva9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1500,
        420
      ],
      "parameters": {
        "color": 3,
        "width": 280,
        "height": 200,
        "content": "## What you need to update:\nConnect your Google Sheets account\n**Select the target sheet**\nEnsure the sheet has the following columns:\n**ID, Name, Email, Created_at**"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "266fdde0-d952-4a11-bc7f-8bc52b5845ec": {
      "main": [
        [
          {
            "node": "9c9c4619-6e83-4a31-b783-c1250540b6ff",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1281e124-bf06-4dae-a232-2142d566fb20": {
      "main": [
        [
          {
            "node": "4b47add8-1967-4769-a355-58b88151d147",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9c9c4619-6e83-4a31-b783-c1250540b6ff": {
      "main": [
        [
          {
            "node": "dbb1cba5-658e-4065-b8d7-5d7dc0d994aa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dbb1cba5-658e-4065-b8d7-5d7dc0d994aa": {
      "main": [
        [
          {
            "node": "1281e124-bf06-4dae-a232-2142d566fb20",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4b47add8-1967-4769-a355-58b88151d147": {
      "main": [
        [
          {
            "node": "d216b2d6-ae67-451f-923d-5bd07f847b00",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿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 - Nutrición de leads

¿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.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos16
Categoría1
Tipos de nodos5
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34