{
  "name": "AI agent that makes phone calls with Ringee tools in n8n",
  "nodes": [
    {
      "parameters": {
        "content": "## An n8n AI Agent that can phone people\nChat with the agent and ask it to call someone. It can **find a contact**, **start an AI voice call**, **read how the call went** and **fetch the transcript**, using Ringee tools.\n\nTry: *“Call Ada Lovelace to confirm tomorrow's demo.”* then, a few minutes later, *“How did that call go?”*\n\n**Self-hosted n8n:** set `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true` so community nodes can be used as tools.\n\n[Ringee](https://ringee.io) · [Docs](https://docs.ringee.io)",
        "height": 310,
        "width": 480,
        "color": 4
      },
      "id": "7725d042-2f45-5494-92fb-7f03e0ffea6d",
      "name": "About this workflow",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-260, -360]
    },
    {
      "parameters": {
        "content": "**Real calls cost money and reach real people.**\n- Only call people who have given their consent to be called.\n- The agent is told to ask for your confirmation before every call.\n- For production, add n8n's *human approval* step to the *Start call* tool so a person approves each call.\n- Ringee still blocks numbers on your Do-Not-Call list and stops when credits run out.\n- *Delete* operations are never offered to AI agents.",
        "height": 250,
        "width": 480,
        "color": 3
      },
      "id": "e19d097a-e724-5de1-ab9d-93a6a5484f0b",
      "name": "Safety",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-260, -30]
    },
    {
      "parameters": {
        "content": "Connect **Ringee API** on the four Ringee tools and an **OpenAI** (or any chat model) credential. In *Start call*, pick the AI voice agent the assistant should use.",
        "height": 130,
        "width": 360,
        "color": 5
      },
      "id": "52389a1d-0b62-5272-969a-f1dbc637b6b6",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [240, -360]
    },
    {
      "parameters": {
        "public": false,
        "options": {}
      },
      "id": "70c239e2-29f9-5bda-b595-e920ab46bea3",
      "name": "Chat with the agent",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.5,
      "position": [240, -60],
      "webhookId": "e252c7b8-ba7d-5a26-a493-dc3a30efcae9"
    },
    {
      "parameters": {
        "promptType": "auto",
        "options": {
          "systemMessage": "You are a careful phone-calling assistant for a sales team. You can find contacts, start AI voice calls, check how a call went and read its transcript, using your Ringee tools.\n\nRules:\n1. Before you start any call, state who you will call, the number and the reason, and wait for the user to answer 'yes'. Never start a call without that yes.\n2. Only call a number the user gave you or a contact you found. Never invent a number.\n3. Calls take a minute or two to finish. After starting one, tell the user the call ID and that the result will be ready shortly. Do not claim an outcome until 'get call result' shows the call finished.\n4. If a tool says a number is on the Do-Not-Call list or that credits are missing, explain it plainly and do not retry.\n5. Keep answers short.",
          "maxIterations": 6
        }
      },
      "id": "21904b3d-525f-5a5e-ab66-0593502aeb62",
      "name": "Phone assistant",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [520, -60]
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "id": "b394d13d-706b-5839-b603-9537b1049519",
      "name": "Chat model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [440, 200]
    },
    {
      "parameters": {
        "contextWindowLength": 12
      },
      "id": "f3d0d7e3-f3e3-51c5-81d7-e1c46d4d426d",
      "name": "Conversation memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.4,
      "position": [640, 200]
    },
    {
      "parameters": {
        "resource": "contact",
        "operation": "getMany",
        "returnAll": false,
        "limit": 5,
        "filters": {
          "query": "={{ $fromAI('search_text', 'A name, company or phone number to search the contacts for', 'string') }}"
        }
      },
      "id": "020269e7-9b09-54f1-974a-296c3228273c",
      "name": "Find contact",
      "type": "n8n-nodes-ringee.ringeeTool",
      "typeVersion": 1,
      "position": [240, 400]
    },
    {
      "parameters": {
        "resource": "aiAgent",
        "operation": "startCall",
        "agentId": {
          "__rl": true,
          "value": "",
          "mode": "list"
        },
        "phoneNumber": "={{ $fromAI('phone_number', 'The number to call in international format, for example +14155550123', 'string') }}",
        "variables": {
          "mappingMode": "defineBelow",
          "value": {
            "first_name": "={{ $fromAI('first_name', 'First name of the person being called', 'string') }}",
            "notification": "={{ $fromAI('reason', 'What the call is about, in a few words', 'string') }}"
          },
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "45e08bc8-99e0-5706-a563-c3e8436fc59a",
      "name": "Start call",
      "type": "n8n-nodes-ringee.ringeeTool",
      "typeVersion": 1,
      "position": [480, 400]
    },
    {
      "parameters": {
        "resource": "aiAgent",
        "operation": "getCallResult",
        "callId": "={{ $fromAI('call_id', 'The call_id that Start call returned', 'string') }}"
      },
      "id": "4eb84756-0b93-5e7a-ad8e-cb7691e60192",
      "name": "Get call result",
      "type": "n8n-nodes-ringee.ringeeTool",
      "typeVersion": 1,
      "position": [720, 400]
    },
    {
      "parameters": {
        "resource": "transcript",
        "operation": "get",
        "callId": "={{ $fromAI('call_id', 'The call_id that Start call returned', 'string') }}",
        "includeSegments": false
      },
      "id": "7d7a9c67-3012-57b1-b684-d6f37a971b0b",
      "name": "Get transcript",
      "type": "n8n-nodes-ringee.ringeeTool",
      "typeVersion": 1,
      "position": [960, 400]
    }
  ],
  "connections": {
    "Chat with the agent": {
      "main": [
        [
          {
            "node": "Phone assistant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat model": {
      "ai_languageModel": [
        [
          {
            "node": "Phone assistant",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Conversation memory": {
      "ai_memory": [
        [
          {
            "node": "Phone assistant",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Find contact": {
      "ai_tool": [
        [
          {
            "node": "Phone assistant",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Start call": {
      "ai_tool": [
        [
          {
            "node": "Phone assistant",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get call result": {
      "ai_tool": [
        [
          {
            "node": "Phone assistant",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get transcript": {
      "ai_tool": [
        [
          {
            "node": "Phone assistant",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f7e6d7e2-3a0c-5a60-bd9c-89297a3e3d47",
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "ringee-n8n-template"
  },
  "tags": []
}
