{
  "id": "wQ7y8grS10XllodU",
  "meta": {
    "instanceId": "9219ebc7795bea866f70aa3d977d54417fdf06c41944be95e20cfb60f992db19",
    "templateCredsSetupCompleted": true
  },
  "name": "pipedrive mcp",
  "tags": [],
  "nodes": [
    {
      "id": "bc8b95d8-467c-4ad3-8b20-8c8cf246b012",
      "name": "On new message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -240,
        -140
      ],
      "webhookId": "31e8c191-91b8-4df2-889e-8ab59eeaab92",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "credential-id",
          "name": "telegramApi Credential"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "629e67ec-305d-4544-82be-7da75af5086e",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        0,
        -140
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.9
    },
    {
      "id": "34754420-6058-4b9c-9924-ea937bf77e24",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        100,
        80
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "630f983c-b6b2-4c60-8474-c9657eee065b",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -60,
        80
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-pro-preview-05-06"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "credential-id",
          "name": "googlePalmApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fd7e83d1-27b6-424c-b632-d8a5b65577a7",
      "name": "MCP Client",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        400,
        260
      ],
      "parameters": {
        "sseEndpoint": "your-MCP-url-here"
      },
      "typeVersion": 1
    },
    {
      "id": "9961f536-96d9-4a45-910b-4572e2e807ee",
      "name": "MCP Server Trigger",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        -140,
        380
      ],
      "webhookId": "154b1d16-5a33-42d3-b657-2cd45a3d23b9",
      "parameters": {
        "path": "pipedrive-mcp-demo"
      },
      "typeVersion": 1
    },
    {
      "id": "f76545a8-94cb-4170-a187-3f24cb1ea497",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -920,
        160
      ],
      "parameters": {
        "color": 4,
        "width": 220,
        "height": 940,
        "content": "# Deals\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1f89ed2a-e011-418d-8178-11bdfe6c5d6b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -620,
        160
      ],
      "parameters": {
        "color": 4,
        "height": 920,
        "content": "# Leads\n"
      },
      "typeVersion": 1
    },
    {
      "id": "52fcc0e7-e248-4bc8-98ba-78339177e659",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        640
      ],
      "parameters": {
        "color": 4,
        "width": 360,
        "height": 440,
        "content": "# Persons\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9fafdb21-5f29-4b0d-9c1e-2a7096998692",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        260,
        620
      ],
      "parameters": {
        "color": 4,
        "width": 380,
        "height": 500,
        "content": "# Organizations\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3be7d19b-f0d0-4020-b7b9-ec74d97317bd",
      "name": "Create Organization Deal",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -860,
        260
      ],
      "parameters": {
        "title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Title', ``, 'string') }}",
        "org_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Organization_ID', ``, 'number') }}",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e326dc90-df81-46b5-884a-3cc894be6ee3",
      "name": "Create Person Deal",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -860,
        440
      ],
      "parameters": {
        "title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Title', ``, 'string') }}",
        "person_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Person_ID', ``, 'number') }}",
        "associateWith": "person",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "886529d1-f88e-441e-9c52-4983a1fcd1f7",
      "name": "Update Deal",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -860,
        760
      ],
      "parameters": {
        "dealId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Deal_ID', ``, 'number') }}",
        "operation": "update",
        "updateFields": {
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Value', ``, 'number') }}",
          "lost_reason": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Lost_Reason', ``, 'string') }}",
          "probability": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Probability', ``, 'number') }}"
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d39ed3b7-3312-450a-b839-80e09b9eaa05",
      "name": "Search & Return Deals",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -860,
        920
      ],
      "parameters": {
        "term": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Term', ``, 'string') }}",
        "operation": "search",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "db2eb0eb-5836-4d89-83ab-bc82ad550649",
      "name": "Create Person Lead",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -560,
        420
      ],
      "parameters": {
        "title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Title', ``, 'string') }}",
        "resource": "lead",
        "person_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Person_ID', ``, 'number') }}",
        "associateWith": "person",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fe9ccc72-33d2-4876-b0fd-1df1552463c1",
      "name": "Get Lead",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -560,
        580
      ],
      "parameters": {
        "leadId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Lead_ID', ``, 'string') }}",
        "resource": "lead",
        "operation": "get",
        "authentication": "oAuth2"
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ffd60843-e218-4065-9573-df77deb3f9d5",
      "name": "Get Deal",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -860,
        600
      ],
      "parameters": {
        "dealId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Deal_ID', ``, 'number') }}",
        "operation": "get",
        "authentication": "oAuth2",
        "resolveProperties": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Resolve_Properties', ``, 'boolean') }}"
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f89b9505-d98d-4ba0-9c63-92d967f2c079",
      "name": "Update Lead",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -560,
        760
      ],
      "parameters": {
        "leadId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Lead_ID', ``, 'string') }}",
        "resource": "lead",
        "operation": "update",
        "updateFields": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5def7b19-2c74-4446-adf7-a029c8d1105d",
      "name": "Return Many Leads",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -560,
        920
      ],
      "parameters": {
        "filters": {},
        "resource": "lead",
        "operation": "getAll",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "authentication": "oAuth2"
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d93c7451-0e0b-4ac4-977c-ab58059d02cf",
      "name": "Create Person",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -240,
        740
      ],
      "parameters": {
        "name": "=",
        "resource": "person",
        "authentication": "oAuth2",
        "additionalFields": {
          "email": [
            "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('email0_Email', ``, 'string') }}"
          ]
        }
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9276b99a-2eb6-4db0-83b7-49da716ab603",
      "name": "Get Person",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -80,
        740
      ],
      "parameters": {
        "personId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Person_ID', ``, 'number') }}",
        "resource": "person",
        "operation": "get",
        "authentication": "oAuth2"
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "df5b28c5-0c95-47df-a6d2-8acb33c94e7a",
      "name": "Search Person",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -80,
        920
      ],
      "parameters": {
        "term": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Term', ``, 'string') }}",
        "resource": "person",
        "operation": "search",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b26798fe-c5d8-4095-a2ad-ef9d73a6c5c8",
      "name": "Update Person",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -240,
        920
      ],
      "parameters": {
        "personId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Person_ID', ``, 'number') }}",
        "resource": "person",
        "operation": "update",
        "updateFields": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c45b77da-6a1c-482b-a2af-4758be227bbb",
      "name": "Create Organization",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        320,
        720
      ],
      "parameters": {
        "name": "=",
        "resource": "organization",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8eab17f1-dfc7-4db6-a01a-69198396f9f4",
      "name": "Get Organization Data",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        500,
        720
      ],
      "parameters": {
        "resource": "organization",
        "operation": "get",
        "authentication": "oAuth2",
        "organizationId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Organization_ID', ``, 'number') }}"
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "922388c1-a4d4-4a28-b392-37426e83105f",
      "name": "Search & Return Organizations",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        320,
        940
      ],
      "parameters": {
        "term": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Term', ``, 'string') }}",
        "resource": "organization",
        "operation": "search",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1ae56aac-b2ad-4d2a-b7e9-294ba6e06a51",
      "name": "Update an Organization",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        500,
        940
      ],
      "parameters": {
        "resource": "organization",
        "operation": "update",
        "updateFields": {},
        "authentication": "oAuth2",
        "organizationId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Organization_ID', ``, 'number') }}"
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5738bb7b-e040-48fc-8c4f-652ad3e86140",
      "name": "Create Organization Lead",
      "type": "n8n-nodes-base.pipedriveTool",
      "position": [
        -560,
        260
      ],
      "parameters": {
        "title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Title', ``, 'string') }}",
        "resource": "lead",
        "authentication": "oAuth2",
        "organization_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Organization_ID', ``, 'number') }}",
        "additionalFields": {}
      },
      "credentials": {
        "pipedriveOAuth2Api": {
          "id": "credential-id",
          "name": "pipedriveOAuth2Api Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3482a78b-ea8a-4cc6-9043-714641bdd237",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        -340
      ],
      "parameters": {
        "width": 340,
        "height": 380,
        "content": "# Customize output\n \nSet your email in the \"**To**\" field to receive the execution summary. \n\nChange the output workflow by plugging your desired tools."
      },
      "typeVersion": 1
    },
    {
      "id": "f5cbef56-0db4-402e-aed1-a4274f01bc3b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -920,
        -460
      ],
      "parameters": {
        "width": 600,
        "height": 560,
        "content": "# Overview \n\nThe following workflow and AI agent allows you to interact with a telegram bot to read, update, and insert data into your Sales CRM, in this case Pipedrive, and receive a summary of the actions executed in your email.\n\n## Set up requirements\n- [Pipedrive account](https://aff.trypipedrive.com/gfq51z688ekq) and a private app with the required permissions you wish you grant\n- Telegram bot\n- Enabled Gmail API\n- An MCP server\n\n## Benefits\nSome sales teams and top level managers spend hours weekly inserting data, retrieving results, and updating specific fields. Such workflow automation allows them to interact with their CRM in natural language to get data and make the necessary changes in seconds.\n\nNeed help implementing such a system for your organization in other CRM tools? Contact us at [1 Node](https://1node.ai)"
      },
      "typeVersion": 1
    },
    {
      "id": "af672696-08ed-4efa-8bf1-aad884daa370",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        100
      ],
      "parameters": {
        "width": 340,
        "height": 300,
        "content": "# MCP Client \n\nPaste the MCP URL from the **MCP Server Trigger** node below"
      },
      "typeVersion": 1
    },
    {
      "id": "48f10873-c397-448c-823d-902f24243336",
      "name": "Send summary",
      "type": "n8n-nodes-base.gmail",
      "position": [
        360,
        -140
      ],
      "webhookId": "c3f1ba3f-6bdb-42ab-b2e0-af02dd58ada9",
      "parameters": {
        "sendTo": "youremailhere",
        "message": "={{ $json.output }}",
        "options": {},
        "subject": "=Pipedrive AI Agent run",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "credential-id",
          "name": "gmailOAuth2 Credential"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6118c192-8cf1-47da-86b9-73970b9da8e9",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Deal": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Lead": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Person": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "MCP Client": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update Deal": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update Lead": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Person": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Search Person": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Update Person": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "On new message": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Return Many Leads": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Person Deal": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Person Lead": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Organization": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Organization Data": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Search & Return Deals": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update an Organization": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Organization Deal": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Organization Lead": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Search & Return Organizations": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}