AutomationFlowsAI & RAG › Phone agent

Phone agent

Phone agent. Uses httpRequest, formTrigger, openAi, agent. Event-driven trigger; 10 nodes.

Event trigger★★★★☆ complexityAI-powered10 nodesHttp RequestForm TriggerOpen AiAgentAirtableLm Chat Open Ai
AI & RAG Trigger: Event Nodes: 10 Complexity: ★★★★☆ AI nodes: yes

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Phone agent",
  "nodes": [
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.vapi.ai/call/phone",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "<api key>"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"assistantId\": \"fd854c0d-b5f7-46b9-869b-59cd92035ab1\",\n  \"customer\": {\n    \"number\": \"{{ $json.message.content }}\"\n  },\n  \"phoneNumberId\": \"d8fb7d16-1039-43e3-ab8f-c2b4f07fe143\",\n  \"assistantOverrides\": {\n    \"variableValues\": {\n      \"name\": \"{{ $('On form submission').item.json.Name }}\",\n      \"howWeCanHelp\": \"{{ $('Simplify enquiry').item.json.message.content }}\",\n      \"BusinessInfo\": \"{{ $('Lead summary Agent').item.json.output }}\"\n    }\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1460,
        -260
      ],
      "id": "07b8fe43-c0d3-4371-abfc-e81c862fafd8",
      "name": "HTTP Request",
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "formTitle": "Contact form",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Name",
              "requiredField": true
            },
            {
              "fieldLabel": "Phone number",
              "requiredField": true
            },
            {
              "fieldLabel": "How can we help you",
              "requiredField": true
            },
            {
              "fieldLabel": "Website URL"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -200,
        -260
      ],
      "id": "7dfdd24f-70a8-44ca-814e-dd8d72b5359a",
      "name": "On form submission"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4.1-mini-2025-04-14",
          "mode": "list",
          "cachedResultName": "GPT-4.1-MINI-2025-04-14"
        },
        "messages": {
          "values": [
            {
              "content": "=Your job is to simplify an enquiry.\n\nThis variable will be passed over to an ai calling agent in the form of \"you recently submitted an enquiry about {howWeCanHelp}\"\n\nYou will be filling in the {howWeCanHelp} part.\n\nFor example if your input is an enquiry that looks like \"i want to build an ai sales system for my business\" you might convert that to \"an ai sales system\" that way it slots perfectly into the sentence \"you recently submitted an enquiry about {howWeCanHelp}'\n\nhere is the data: {{ $('On form submission').item.json['How can we help you'] }}\n\nRemember the ai agent will be using this to talk to the person so if they say \"i\" or \"my\" swap that for \"you\" for example"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        820,
        -260
      ],
      "id": "6d08a58c-0427-4674-be4e-f27140c4b5e8",
      "name": "Simplify enquiry",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4.1-mini-2025-04-14",
          "mode": "list",
          "cachedResultName": "GPT-4.1-MINI-2025-04-14"
        },
        "messages": {
          "values": [
            {
              "content": "=You will receive a phone number that will potentially be formatted without the country code (e.g +44)\n\nIf it isnt your job is to format with the correct country code.\n\nOutput only the number and nothing else\n\ndata: {{ $('On form submission').item.json['Phone number'] }}"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        1140,
        -260
      ],
      "id": "d4dc6d69-fc6f-49a6-9776-9a34d7f9e238",
      "name": "Format phone number",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Linkedin Summary: {{ $json.results[0].content }}\nWebsite content: {{ $('Markdown').item.json.data }}",
        "options": {
          "systemMessage": "You will receive a linkedIn summary and a full website in markdown for a lead.\n\nYour job is to look at both of pieces of data and create a summary of this lead and their company. Output just the summary please.\n\nKeep it at 100 words max"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.8,
      "position": [
        340,
        -260
      ],
      "id": "4c014bbd-a1ee-420d-8528-ffa4734c671a",
      "name": "Lead summary Agent"
    },
    {
      "parameters": {
        "html": "={{ $json.data }}",
        "options": {}
      },
      "type": "n8n-nodes-base.markdown",
      "typeVersion": 1,
      "position": [
        0,
        -420
      ],
      "id": "c74d18cc-6e86-4196-9e99-ed629d477b25",
      "name": "Markdown"
    },
    {
      "parameters": {
        "url": "={{ $json['Website URL'] }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        -260
      ],
      "id": "0e69f6be-a048-450a-9147-5955f231c193",
      "name": "Scrape website URL"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.tavily.com/search",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "<api key>"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"query\": \"{{ $('On form submission').item.json.Name }}'s linkedin Profile URL'\",\n  \"topic\": \"general\",\n  \"search_depth\": \"basic\",\n  \"max_results\": 1,\n  \"time_range\": null,\n  \"days\": 3,\n  \"include_answer\": true,\n  \"include_raw_content\": false,\n  \"include_images\": false,\n  \"include_image_descriptions\": false,\n  \"include_domains\": [],\n  \"exclude_domains\": []\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        180,
        -260
      ],
      "id": "ba0bab72-4e7e-4f3a-99da-75d035b57237",
      "name": "Find Linkedin URL"
    },
    {
      "parameters": {
        "operation": "create",
        "base": {
          "__rl": true,
          "value": "appBWdLFc1R5bpIkP",
          "mode": "list",
          "cachedResultName": "demo leads and clients",
          "cachedResultUrl": "https://airtable.com/appBWdLFc1R5bpIkP"
        },
        "table": {
          "__rl": true,
          "value": "tblcxM2cpPdkwmd0F",
          "mode": "list",
          "cachedResultName": "Table 1",
          "cachedResultUrl": "https://airtable.com/appBWdLFc1R5bpIkP/tblcxM2cpPdkwmd0F"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Status": "New lead",
            "Name": "={{ $('On form submission').item.json.Name }}",
            "Website URL": "={{ $('On form submission').item.json['Website URL'] }}",
            "Linkedin URL": "={{ $('Find Linkedin URL').item.json.results[0].url }}",
            "Lead summary": "={{ $json.output }}",
            "Notes": "={{ $('On form submission').item.json['How can we help you'] }}",
            "Phone number": "={{ $('On form submission').item.json['Phone number'] }}"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Phone number",
              "displayName": "Phone number",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Website URL",
              "displayName": "Website URL",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Status",
              "displayName": "Status",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "options",
              "options": [
                {
                  "name": "New lead",
                  "value": "New lead"
                },
                {
                  "name": "Meeting scheduled",
                  "value": "Meeting scheduled"
                },
                {
                  "name": "Discovery call done",
                  "value": "Discovery call done"
                },
                {
                  "name": "Proposal sent",
                  "value": "Proposal sent"
                },
                {
                  "name": "Lost",
                  "value": "Lost"
                },
                {
                  "name": "Won",
                  "value": "Won"
                }
              ],
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Notes",
              "displayName": "Notes",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Linkedin URL",
              "displayName": "Linkedin URL",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Lead summary",
              "displayName": "Lead summary",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        660,
        -260
      ],
      "id": "ad5b9d0e-bef7-4f04-bd22-8122e22fae6c",
      "name": "Airtable",
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1-mini-2025-04-14",
          "mode": "list",
          "cachedResultName": "gpt-4.1-mini-2025-04-14"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        340,
        -80
      ],
      "id": "a1bfa397-b46c-4420-9345-06d1549c8f2f",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "Scrape website URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simplify enquiry": {
      "main": [
        [
          {
            "node": "Format phone number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format phone number": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead summary Agent": {
      "main": [
        [
          {
            "node": "Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown": {
      "main": [
        [
          {
            "node": "Find Linkedin URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape website URL": {
      "main": [
        [
          {
            "node": "Markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Linkedin URL": {
      "main": [
        [
          {
            "node": "Lead summary Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Lead summary Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Airtable": {
      "main": [
        [
          {
            "node": "Simplify enquiry",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bdb7e27d-ae25-46fa-b1d7-13c7650a7072",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "k4jk0QIJvRIDl5QH",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

About this workflow

Phone agent. Uses httpRequest, formTrigger, openAi, agent. Event-driven trigger; 10 nodes.

Source: https://github.com/Zie619/n8n-workflows — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →