AI駆動の従業員データベース管理システム、Telegram経由でOpenAIとAirtableを活用

上級

これはHR, AI分野の自動化ワークフローで、25個のノードを含みます。主にAirtable, Telegram, AirtableTool, Agent, TelegramTriggerなどのノードを使用、AI技術を活用したスマート自動化を実現。 AI駆動の従業員データベース管理システム、Telegram経由でOpenAIとAirtableを活用

前提条件
  • Airtable API Key
  • Telegram Bot Token
  • OpenAI API Key

カテゴリー

ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "d1786ab0d745a7498abf13a9c2cdabb1374c006e889b79eef64ce0386b8f8a41"
  },
  "nodes": [
    {
      "id": "610755a7-53d6-4e98-9e66-06bf751bb1d8",
      "name": "Telegram トリガー",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -260,
        -40
      ],
      "webhookId": "5971294c-ab28-481a-83b5-efa64d93554f",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "HtvibSVWl4VexYu9",
          "name": "Employee Database Management"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cb89c97f-cce1-4cc6-b836-9c4e38d5e09a",
      "name": "従業員作成AIエージェントツール",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -600,
        560
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "uOrbNX2DcYJ0iAyv",
          "cachedResultName": "employee database management"
        },
        "description": "Create Employee AI Agent tool\nCall this tool if user requested to create new employee",
        "workflowInputs": {
          "value": {
            "query": "={{ $json.message.text }}",
            "action": "=create"
          },
          "schema": [
            {
              "id": "query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "action",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "action",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "query"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "25109ff2-216a-4ac8-a92a-1f6c55a0ee4b",
      "name": "部門データを取得(airtableから)ツール",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        -120,
        560
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblB0xec7TL36pDgC",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblB0xec7TL36pDgC",
          "cachedResultName": "Departments"
        },
        "options": {
          "fields": [
            "Department Name",
            "Department Description"
          ]
        },
        "operation": "search",
        "descriptionType": "manual",
        "filterByFormula": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Filter_By_Formula', ``, 'string') }}",
        "toolDescription": "Get departments data from airtable tool"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "d4ab33a8-f6a4-41b3-b824-cc741f4ea73e",
      "name": "役職データを取得(airtableから)ツール",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        40,
        560
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblnyWkG6BTpxjMzo",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblnyWkG6BTpxjMzo",
          "cachedResultName": "Job Titles"
        },
        "options": {
          "fields": [
            "Job Title",
            "Job Description"
          ]
        },
        "operation": "search",
        "descriptionType": "manual",
        "filterByFormula": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Filter_By_Formula', ``, 'string') }}",
        "toolDescription": "Get job titles data from airtable tool"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f747f3e3-8daf-4bc9-88c3-fc86e05b810b",
      "name": "従業員データを取得(airtableから)ツール",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        200,
        560
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblGIVbpACRwWzzlp",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblGIVbpACRwWzzlp",
          "cachedResultName": "Employees"
        },
        "options": {
          "fields": [
            "Full Name",
            "Email",
            "Phone Number",
            "Job Title (from Job Titles)",
            "Reports To (from Employees)",
            "Department Name (from Department)",
            "Employee Status"
          ]
        },
        "operation": "search",
        "descriptionType": "manual",
        "filterByFormula": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Filter_By_Formula', ``, 'string') }}",
        "toolDescription": "Get employees data from airtable tool"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "970a4e1d-1bd9-48e0-bfae-e4367407bfb2",
      "name": "OpenAI チャットモデル",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -620,
        200
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "MGwGMKEkdcjzlYCw",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ffbf46c6-1c93-4728-bb7a-64c4b8460c99",
      "name": "シンプルメモリ",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -580,
        340
      ],
      "parameters": {
        "sessionKey": "={{ $json.message.chat.id }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "218f11e0-2382-4ac3-9217-6cdf9163a857",
      "name": "ユーザーにメッセージを送信",
      "type": "n8n-nodes-base.telegram",
      "position": [
        40,
        220
      ],
      "webhookId": "507c9446-fd78-4695-8dd2-7c348390a4db",
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "HtvibSVWl4VexYu9",
          "name": "Employee Database Management"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3e3645f2-33d6-4da2-b6a8-6d9c1c35285f",
      "name": "部門作成ツール",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        -440,
        560
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblB0xec7TL36pDgC",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblB0xec7TL36pDgC",
          "cachedResultName": "Departments"
        },
        "columns": {
          "value": {
            "Department Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Department_Name', ``, 'string') }}",
            "Department Description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Department_Description', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Department Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Department Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department Description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Department Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department Head",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Department Head",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Titles",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Job Titles",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employees",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Employees",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Department Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "create",
        "descriptionType": "manual",
        "toolDescription": "Create department tool"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "eee21e79-e3e7-4c42-93ea-d5255e6adfe0",
      "name": "役職作成ツール",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        -280,
        560
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblnyWkG6BTpxjMzo",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblnyWkG6BTpxjMzo",
          "cachedResultName": "Job Titles"
        },
        "columns": {
          "value": {
            "Job Title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Job_Title', ``, 'string') }}",
            "Job Description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Job_Description', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Job Title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Job Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department associated with the job title",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Department associated with the job title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employees",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Employees",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Job Title"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "create",
        "descriptionType": "manual",
        "toolDescription": "Create job title tool"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "2fa37bd2-658f-4da4-bd4f-ccc9c69e681f",
      "name": "従業員削除ツール",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        380,
        560
      ],
      "parameters": {
        "id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Record_ID', ``, 'string') }}",
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblGIVbpACRwWzzlp",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblGIVbpACRwWzzlp",
          "cachedResultName": "Employees"
        },
        "operation": "deleteRecord",
        "descriptionType": "manual",
        "toolDescription": "Delete employee tool"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "a22e7543-65b6-4112-b303-b3395d74ea73",
      "name": "従業員管理AIエージェント",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -360,
        220
      ],
      "parameters": {
        "text": "=User Request:\n{{ $json.message.text }}",
        "options": {
          "systemMessage": "=You are employee database management specialist\n\nCall the right tools based on the request:\n\n//\nUser wants to create new employee:\ncall Create Employee AI Agent tool\n//\n\n//\nUser wants to delete:\nPass the employee id to Delete employee tool\nrun Delete employee tool\n//\n\n//\nUser wants to create department data:\ncall \"Create department tool\"\n//\n\n//\nUser wants to create job title data:\ncall \"Create Job Title tool\"\n//\n\n//\nUser wants get department data:\ncall Get departments data from airtable tool\n//\n\n//\nUser wants get employee data:\ncall Get employees data from airtable tool\n//\n\nImportant notes:\nOnly call 1 tool max, choose the most suitable tool\nFor getting data, no need to output the airtable id, example for getting department data => show only name and description (without id)"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "96f559f9-630c-4c67-b833-6de797d5a65e",
      "name": "部門データを取得(airtableから)",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        -340,
        1120
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "limit": 1,
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblB0xec7TL36pDgC",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblB0xec7TL36pDgC",
          "cachedResultName": "Departments"
        },
        "options": {},
        "operation": "search",
        "returnAll": false,
        "descriptionType": "manual",
        "filterByFormula": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Filter_By_Formula', ``, 'string') }}",
        "toolDescription": "Get departments data from airtable"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f94ae85a-f15c-4e93-857a-ba03efd858f5",
      "name": "役職データを取得(airtableから)",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        -180,
        1120
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "limit": 1,
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblnyWkG6BTpxjMzo",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblnyWkG6BTpxjMzo",
          "cachedResultName": "Job Titles"
        },
        "options": {},
        "operation": "search",
        "returnAll": false,
        "descriptionType": "manual",
        "filterByFormula": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Filter_By_Formula', ``, 'string') }}",
        "toolDescription": "Get job titles data from airtable"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f7ea09f6-beca-47c4-9b49-91b14ba29dc1",
      "name": "従業員作成AIエージェント",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -280,
        760
      ],
      "parameters": {
        "text": "=User message:\n{{ $json.query }}",
        "options": {
          "systemMessage": "=```\nYou are an airtable database management agent\n\nthe exact column name on airtable is:\nDepartment name\nJob title\n\ndont use any other name combination like underscore\n\nfirst check if {Department name} and {job title} exist\n\nif department name and job title doesnt exist:\ncreate new department and job title then output the airtable id\nif end\n\nif department name and job title exist:\noutput the department and job title existing airtable id\nif end\n\nCall the create employee tools and pass the job_title_id and department_id\n\nOutput in json format:\n{\n  \"department_id\":\"recxxxxxxx\",\n  \"job_title_id\":\"recxxxxxxx\",\n  \"new_employee_id\": \"recxxxxxxx\"\n}\n\n\n```\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.9
    },
    {
      "id": "418e5d02-5dea-43a8-be1b-bf145a499dd0",
      "name": "別のワークフローから実行された場合",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -520,
        760
      ],
      "parameters": {
        "inputSource": "jsonExample",
        "jsonExample": "{\n  \"query\":\"test\",\n  \"action\":\"create\"\n}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "d5370dbe-c157-48bc-ae9a-4e1b1ce4ade4",
      "name": "構造化出力パーサー",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        460,
        1120
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"department_id\":\"recxxxxxxx\",\n  \"job_title_id\":\"recxxxxxxx\",\n  \"new_employee_id\": \"recxxxxxxx\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "fcbab5ed-6c32-4ced-8ff4-d8ed35aa393a",
      "name": "部門を作成",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        -20,
        1120
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblB0xec7TL36pDgC",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblB0xec7TL36pDgC",
          "cachedResultName": "Departments"
        },
        "columns": {
          "value": {
            "Department Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Department_Name', ``, 'string') }}",
            "Department Description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Department_Description', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Department Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Department Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department Description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Department Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department Head",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Department Head",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Titles",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Job Titles",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employees",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Employees",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "create",
        "descriptionType": "manual",
        "toolDescription": "Create department"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "c33a70a6-c3af-46a2-8100-d007a56e14e9",
      "name": "役職を作成",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        140,
        1120
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblnyWkG6BTpxjMzo",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblnyWkG6BTpxjMzo",
          "cachedResultName": "Job Titles"
        },
        "columns": {
          "value": {
            "Job Title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Job_Title', ``, 'string') }}",
            "Job Description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Job_Description', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Job Title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Job Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department associated with the job title",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Department associated with the job title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employees",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Employees",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "create",
        "descriptionType": "manual",
        "toolDescription": "Create job title"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "73680e43-507f-4617-ae32-6fbf15fde13f",
      "name": "従業員を作成",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        300,
        1120
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblGIVbpACRwWzzlp",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblGIVbpACRwWzzlp",
          "cachedResultName": "Employees"
        },
        "columns": {
          "value": {
            "Email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Email', ``, 'string') }}",
            "Full Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Full_Name', ``, 'string') }}",
            "Phone Number": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Phone_Number', ``, 'string') }}",
            "job_title_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('job_title_id', ``, 'string') }}",
            "department_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('department_id', ``, 'string') }}",
            "Employee Status": "Active"
          },
          "schema": [
            {
              "id": "Full Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Full Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employee Type",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Employee",
                  "value": "Employee"
                },
                {
                  "name": "Manager",
                  "value": "Manager"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Employee Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reports To",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Reports To",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title (from Job Titles)",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Job Title (from Job Titles)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reports To (from Employees)",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Reports To (from Employees)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Department",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department Name (from Department)",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Department Name (from Department)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employee Type Text",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Employee Type Text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employee Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Active",
                  "value": "Active"
                },
                {
                  "name": "On Leave",
                  "value": "On Leave"
                },
                {
                  "name": "Inactive",
                  "value": "Inactive"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Employee Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "job_title_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "job_title_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "department_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "department_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Head of Department",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Head of Department",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "create",
        "descriptionType": "manual",
        "toolDescription": "Create employee"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "a1d903e0-d46c-4060-92be-8f494bd56559",
      "name": "従業員データを更新",
      "type": "n8n-nodes-base.airtable",
      "position": [
        100,
        760
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appgVjZcaRP8BsKf0",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0",
          "cachedResultName": "HR Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblGIVbpACRwWzzlp",
          "cachedResultUrl": "https://airtable.com/appgVjZcaRP8BsKf0/tblGIVbpACRwWzzlp",
          "cachedResultName": "Employees"
        },
        "columns": {
          "value": {
            "id": "={{ $json.output.new_employee_id }}",
            "Job Title": "=[\"{{ $json.output.job_title_id }}\"]",
            "Department": "=[\"{{ $json.output.department_id }}\"]"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Full Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Full Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title",
              "type": "array",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employee Type",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Employee",
                  "value": "Employee"
                },
                {
                  "name": "Manager",
                  "value": "Manager"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Employee Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reports To",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Reports To",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title (from Job Titles)",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Job Title (from Job Titles)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reports To (from Employees)",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Reports To (from Employees)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department",
              "type": "array",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Department",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department Name (from Department)",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Department Name (from Department)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employee Type Text",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Employee Type Text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employee Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Active",
                  "value": "Active"
                },
                {
                  "name": "On Leave",
                  "value": "On Leave"
                },
                {
                  "name": "Inactive",
                  "value": "Inactive"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Employee Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "job_title_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "job_title_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "department_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "department_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Head of Department",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Head of Department",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "r2IibdsQurA56LDa",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "0a8fca1f-83f1-4f5a-a52e-e2e8f9a2cf2f",
      "name": "OpenAI チャットモデル1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -500,
        1120
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "MGwGMKEkdcjzlYCw",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "934564ca-b0e1-4f28-8322-2f771397d847",
      "name": "付箋7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        -400
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 460,
        "content": "## 🤖 AI-Powered Employee Database Management via Telegram using OpenAI and Airtable\n\n**What This Template Does:**\n- Provides an HR assistant chatbot interface through Telegram\n- Uses GPT-4 to interpret natural language requests (e.g., “Show me all employees” or “Create employee Sarah…”)\n- Performs Airtable operations to manage Employees, Departments, and Job Titles\n- Supports dynamic record creation and linking (e.g., if department doesn't exist, it will be created)\n- Maintains conversation memory per Telegram chat for smooth back-and-forth interaction\n- Splits logic into a main router workflow and a sub-workflow for employee creation"
      },
      "typeVersion": 1
    },
    {
      "id": "2e0c1bdb-e284-4797-bcf2-5eb0dc598727",
      "name": "付箋8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -400
      ],
      "parameters": {
        "color": 5,
        "width": 500,
        "height": 460,
        "content": "## 📋 WORKFLOW PROCESS OVERVIEW  \nStep 1: 💬 Telegram Trigger receives natural language command from HR user  \nStep 2: 🧠 AI Agent (OpenA) interprets intent (view, create, delete, etc.)  \nStep 3: 🔀 Router decides workflow path based on user intent  \nStep 4: 📄 Get Employees fetches employee records from Airtable (if viewing)  \nStep 5: 🛠️ Create Employee Tool triggers sub-workflow for new employee creation  \nStep 6: 🏢 Create/Find Department checks Airtable for department or creates it  \nStep 7: 👔 Create/Find Job Title checks Airtable for job title or creates it  \nStep 8: 💾 Create Employee saves employee record in Airtable with linked fields  \nStep 9: 🗑️ Delete Employee removes employee record by ID (if requested)  \nStep 10: 🔁 Return Response sends formatted reply back to Telegram user\n"
      },
      "typeVersion": 1
    },
    {
      "id": "29d4c15d-29f3-4ff0-b2fc-cb9501afebe2",
      "name": "付箋6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        -400
      ],
      "parameters": {
        "color": 4,
        "width": 280,
        "height": 320,
        "content": "## SETUP REQUIRED  \n**Author:** [Billy Christi](https://n8n.io/creators/billy/)\n\nAirtable Base Structure:  \n[Copy this Airtable Base](https://airtable.com/appXXXXXXXXXXXXXX/tblXXXXXXXXXXXXXX/viwXXXXXXXXXXXXXX)  \n*(Replace with your own Airtable base link if private)*\n\nRequired Credentials:  \n• Airtable API Key  \n• OpenAI API Key\n• Telegram Bot Token\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "When Executed by Another Workflow": [
      {
        "query": "Create employee records using this data:\n- Full name: Jack123 new 123\n- Email: jackbower@gmail.com\n- Phone: +12125551212\n- Department: Engineering\n- Job Title: AI Automation Developer",
        "action": "create"
      }
    ]
  },
  "connections": {
    "ffbf46c6-1c93-4728-bb7a-64c4b8460c99": {
      "ai_memory": [
        [
          {
            "node": "a22e7543-65b6-4112-b303-b3395d74ea73",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "73680e43-507f-4617-ae32-6fbf15fde13f": {
      "ai_tool": [
        [
          {
            "node": "f7ea09f6-beca-47c4-9b49-91b14ba29dc1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "c33a70a6-c3af-46a2-8100-d007a56e14e9": {
      "ai_tool": [
        [
          {
            "node": "f7ea09f6-beca-47c4-9b49-91b14ba29dc1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "610755a7-53d6-4e98-9e66-06bf751bb1d8": {
      "main": [
        [
          {
            "node": "a22e7543-65b6-4112-b303-b3395d74ea73",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fcbab5ed-6c32-4ced-8ff4-d8ed35aa393a": {
      "ai_tool": [
        [
          {
            "node": "f7ea09f6-beca-47c4-9b49-91b14ba29dc1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "970a4e1d-1bd9-48e0-bfae-e4367407bfb2": {
      "ai_languageModel": [
        [
          {
            "node": "a22e7543-65b6-4112-b303-b3395d74ea73",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "0a8fca1f-83f1-4f5a-a52e-e2e8f9a2cf2f": {
      "ai_languageModel": [
        [
          {
            "node": "f7ea09f6-beca-47c4-9b49-91b14ba29dc1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "2fa37bd2-658f-4da4-bd4f-ccc9c69e681f": {
      "ai_tool": [
        [
          {
            "node": "a22e7543-65b6-4112-b303-b3395d74ea73",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "eee21e79-e3e7-4c42-93ea-d5255e6adfe0": {
      "ai_tool": [
        [
          {
            "node": "a22e7543-65b6-4112-b303-b3395d74ea73",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "3e3645f2-33d6-4da2-b6a8-6d9c1c35285f": {
      "ai_tool": [
        [
          {
            "node": "a22e7543-65b6-4112-b303-b3395d74ea73",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "f7ea09f6-beca-47c4-9b49-91b14ba29dc1": {
      "main": [
        [
          {
            "node": "a1d903e0-d46c-4060-92be-8f494bd56559",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d5370dbe-c157-48bc-ae9a-4e1b1ce4ade4": {
      "ai_outputParser": [
        [
          {
            "node": "f7ea09f6-beca-47c4-9b49-91b14ba29dc1",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "a22e7543-65b6-4112-b303-b3395d74ea73": {
      "main": [
        [
          {
            "node": "218f11e0-2382-4ac3-9217-6cdf9163a857",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cb89c97f-cce1-4cc6-b836-9c4e38d5e09a": {
      "ai_tool": [
        [
          {
            "node": "a22e7543-65b6-4112-b303-b3395d74ea73",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "f94ae85a-f15c-4e93-857a-ba03efd858f5": {
      "ai_tool": [
        [
          {
            "node": "f7ea09f6-beca-47c4-9b49-91b14ba29dc1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "418e5d02-5dea-43a8-be1b-bf145a499dd0": {
      "main": [
        [
          {
            "node": "f7ea09f6-beca-47c4-9b49-91b14ba29dc1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "96f559f9-630c-4c67-b833-6de797d5a65e": {
      "ai_tool": [
        [
          {
            "node": "f7ea09f6-beca-47c4-9b49-91b14ba29dc1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "f747f3e3-8daf-4bc9-88c3-fc86e05b810b": {
      "ai_tool": [
        [
          {
            "node": "a22e7543-65b6-4112-b303-b3395d74ea73",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "d4ab33a8-f6a4-41b3-b824-cc741f4ea73e": {
      "ai_tool": [
        [
          {
            "node": "a22e7543-65b6-4112-b303-b3395d74ea73",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "25109ff2-216a-4ac8-a92a-1f6c55a0ee4b": {
      "ai_tool": [
        [
          {
            "node": "a22e7543-65b6-4112-b303-b3395d74ea73",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

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

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

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

上級 - 人事, 人工知能

有料ですか?

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

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

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

作成者
Billy Christi

Billy Christi

@billy

I'm a professional software engineer and n8n expert with a passion for building scalable, no-code and low-code automation workflows. I specialize in creating seamless integrations between APIs, CRMs, and everyday tools to help businesses save time, reduce manual work, and operate smarter. Whether it's automating marketing pipelines, backend systems, or approval processes, I turn complex logic into simple, powerful workflows with n8n.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34