公開テンプレート - 連絡先情報を抽出する
これはDocument Extraction, AI Summarization分野の自動化ワークフローで、9個のノードを含みます。主にCode, Webhook, Agent, RespondToWebhook, LmChatOpenAiなどのノードを使用。 GPT-4 を使用したシステム統合のために非構造化連絡先データを JSON に変換する
- •HTTP Webhookエンドポイント(n8nが自動生成)
- •OpenAI API Key
{
"id": "Q94SsUmoQurlkhBF",
"meta": {
"instanceId": "5fca925b7f5fee37b74ba655b45ab0489e585d45c16d619a3e83393dbcbcc868",
"templateCredsSetupCompleted": true
},
"name": "Public Template - Extract Contact Information",
"tags": [],
"nodes": [
{
"id": "d5432499-566f-4829-9aa7-dc74ce6f2275",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-176,
0
],
"webhookId": "262381d7-e1a0-4123-9c78-be3487872a5d",
"parameters": {
"path": "contact_data_converter",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "fc8b683a-2069-4823-8220-d7eb3592e42f",
"name": "Webhookへの返信",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
928,
0
],
"parameters": {
"options": {}
},
"typeVersion": 1.3
},
{
"id": "7af49992-dbe3-4034-adc9-ca1b8fd523da",
"name": "AIエージェント",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
112,
0
],
"parameters": {
"text": "=Extract the following fields from the input text. Follow these rules strictly:\n\n**EXTRACTION RULES:**\n1. Only extract information that is explicitly stated in the text\n2. Do not infer, guess, or make assumptions\n3. If a field is missing, ambiguous, or uncertain, leave it as an empty string \"\"\n4. Extract information exactly as written (preserve original formatting for addresses, phone numbers, etc.)\n5. For names: only extract if clearly identified as a person's name (not just any name in the text)\n6. For company names: look for business names, organization names, or company identifiers\n\n**FIELD DEFINITIONS:**\n- **company_name**: Business or organization name\n- **tel**: Phone/telephone number (any format)\n- **fax**: Fax number (any format)\n- **email**: Email address\n- **first_name**: Person's first/given name\n- **last_name**: Person's last/family name\n- **address**: Street address or mailing address\n- **zipcode**: Postal/ZIP code\n- **city**: City name\n- **country**: Country name\n- **website**: Website URL or domain\n\n**OUTPUT FORMAT:**\nReturn only valid JSON with exactly these keys (no additional text or explanation):\n\n{\n \"company_name\": \"\",\n \"tel\": \"\",\n \"fax\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"address\": \"\",\n \"zipcode\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"website\": \"\"\n}\n\n**INPUT TEXT:**\n{{ $json.body.prompt }}\n\n\n",
"options": {},
"promptType": "define"
},
"typeVersion": 2.1
},
{
"id": "dfe113b0-8259-4432-a672-7b8f2b29c250",
"name": "コード",
"type": "n8n-nodes-base.code",
"position": [
608,
0
],
"parameters": {
"jsCode": "return items.map(item => {\n let jsonStr = item.json.output;\n jsonStr = jsonStr.replace(/^```json\\n?/, '').replace(/\\n?```$/, '');\n \n try {\n const parsed = JSON.parse(jsonStr);\n return {\n json: {\n output: parsed\n }\n };\n } catch (error) {\n throw new Error('Invalid JSON string: ' + error.message);\n }\n});\n"
},
"typeVersion": 2
},
{
"id": "857a4ac8-0dc8-4e11-b5f2-b5c64868b121",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
112,
272
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-nano",
"cachedResultName": "gpt-4.1-nano"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "",
"name": ""
}
},
"typeVersion": 1.2
},
{
"id": "0a79b2ec-67f9-4e4d-9303-d3e34f9bfd3d",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-832,
-304
],
"parameters": {
"width": 480,
"height": 480,
"content": "## Contact Data Converter – Unstructured Text to JSON for System Integration\n\nThis n8n workflow converts unstructured contact information—such as customer details from emails or messages—into structured JSON data using an AI agent.\n\nIt extracts key fields like Company Name, Address, Phone, Email, First Name, Last Name, etc.\n\nThe structured output is ideal for seamless integration into CRM / ERP systems like Dolibarr, or any other system that accepts JSON input.\n\nWhether you're automating CRM data entry or syncing contacts into your ERP, this template saves time and reduces manual errors."
},
"typeVersion": 1
},
{
"id": "50fc716f-d92c-4a52-91ee-6ced006dda1e",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-272,
-192
],
"parameters": {
"color": 4,
"width": 288,
"height": 368,
"content": "This webhook acts as the entry point for the workflow.\n\nIt accepts an HTTP POST request containing unstructured contact information (e.g., the body of an email) in the request body under the key **\"prompt\"**"
},
"typeVersion": 1
},
{
"id": "485ce0f8-4259-4419-8fe6-8ce70fcbb0f6",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
80,
-304
],
"parameters": {
"color": 4,
"width": 336,
"height": 480,
"content": "This node uses an AI agent to extract structured contact information from the unstructured input text.\n\nThe input text is passed from the previous Webhook node using: {{ $json.body.prompt }}\n\nThe AI prompt can be customized to fit your specific use case or formatting needs.\n\nYou can adjust the instructions in the prompt to tailor the output fields, structure, or style of the resulting JSON."
},
"typeVersion": 1
},
{
"id": "08d1216e-fe9b-48d7-863f-30cafcb82936",
"name": "付箋3",
"type": "n8n-nodes-base.stickyNote",
"position": [
480,
-304
],
"parameters": {
"color": 4,
"width": 352,
"height": 480,
"content": "This node processes the raw output from the AI Agent and ensures it’s a valid JSON object.\n\nIt removes any Markdown-style code block formatting (e.g., json ... ) from the AI response.\n\nIt then parses the cleaned string into a proper JSON object.\n\nIf the AI output is not valid JSON, it will throw an error to help with debugging.\n\nThe parsed and structured data is returned under output, ready for use in downstream nodes or ERP system integration."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "f7d4d1c1-58e3-473a-8c17-10f73ce81e49",
"connections": {
"dfe113b0-8259-4432-a672-7b8f2b29c250": {
"main": [
[
{
"node": "fc8b683a-2069-4823-8220-d7eb3592e42f",
"type": "main",
"index": 0
}
]
]
},
"d5432499-566f-4829-9aa7-dc74ce6f2275": {
"main": [
[
{
"node": "7af49992-dbe3-4034-adc9-ca1b8fd523da",
"type": "main",
"index": 0
}
]
]
},
"7af49992-dbe3-4034-adc9-ca1b8fd523da": {
"main": [
[
{
"node": "dfe113b0-8259-4432-a672-7b8f2b29c250",
"type": "main",
"index": 0
}
]
]
},
"857a4ac8-0dc8-4e11-b5f2-b5c64868b121": {
"ai_languageModel": [
[
{
"node": "7af49992-dbe3-4034-adc9-ca1b8fd523da",
"type": "ai_languageModel",
"index": 0
}
]
]
}
}
}このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - 文書抽出, AI要約
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
Frankie Wong
@frankiewongWith over 10 years of experience in customizing open-source platforms like Dolibarr, WordPress, OpenCart and Shopify, I now specialize in building powerful and practical workflow automations and AI agents using n8n. Whether you're looking to save time, streamline operations, or integrate AI into your business processes, I create ready-to-use n8n templates designed to make automation easy. Based in Birmingham, UK
このワークフローを共有