データベースから Saleshandy へユーザー onboarding の自動化

上級

これはLead Nurturing分野の自動化ワークフローで、16個のノードを含みます。主にCode, HttpRequest, GoogleSheets, ManualTriggerなどのノードを使用。 GoogleスプレッドシートからデータベースまでSaleshandyへのユーザーオンボウディングプロセスの自動化

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
  • Google Sheets API認証情報
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "5f48daf3a0baf541941ac99dac87a58469ec38ada0698ec3f47e71ef7e50b0ff"
  },
  "nodes": [
    {
      "id": "9c9c4619-6e83-4a31-b783-c1250540b6ff",
      "name": "昨日の日付を取得",
      "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": "付箋1",
      "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": "セミ認定用に行を追加",
      "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": "データベースから全ユーザーを取得",
      "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": "日付でフィルタリングされたユーザー",
      "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": "付箋",
      "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": "付箋2",
      "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": "毎日トリガー",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        100,
        120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4b47add8-1967-4769-a355-58b88151d147",
      "name": "新規登録を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": "付箋3",
      "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": "付箋5",
      "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": "付箋4",
      "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": "付箋6",
      "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": "付箋7",
      "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": "付箋8",
      "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": "付箋9",
      "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
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

上級 - リードナーチャリング

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
上級
ノード数16
カテゴリー1
ノードタイプ5
難易度説明

上級者向け、16ノード以上の複雑なワークフロー

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34