{
  "workflow": {
    "id": 7670,
    "name": "Natural language Q&A for Pipedrive leads using GPT-4o-mini",
    "views": 153,
    "recentViews": 0,
    "totalViews": 153,
    "createdAt": "2025-08-20T22:48:19.102Z",
    "description": "\n## 📖 Description\nAsk natural-language questions about your **Pipedrive leads**. This workflow pulls live lead data from Pipedrive and has OpenAI answer questions like “leads added this week”, “stuck leads by owner”, or “next activities due today.” Responses are grounded **only** in your Pipedrive data.\n\n---\n\n## ⚙️ Setup Instructions\n\n### 1️⃣ Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys)  \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview)  \n3. Add funds to your billing account  \n4. Copy your API key into the **OpenAI credentials** in n8n\n\n### 2️⃣ Connect Pipedrive\n1. In **Pipedrive** → **Personal preferences → API** → copy your **API token**  \n   - URL shortcut: `https://{your-company}.pipedrive.com/settings/personal/api`  \n2. In **n8n** → **Credentials → New → Pipedrive API**  \n   - **Company domain**: `{your-company}` (the subdomain in your Pipedrive URL)  \n   - **API Token**: paste the token from step 1 → **Save**  \n3. In the **Pipedrive Tool** node, select your Pipedrive credential and (optionally) set filters (e.g., owner, label, created time).\n\n---\n\n## 🗣️ Example Questions You Can Ask\n- “Summarize leads added this week by owner.”  \n- “Which leads have **no upcoming activity**?”  \n- “Show **overdue activities** and who owns them.”  \n- “Top 10 leads by value that are still open.”  \n- “Leads created in the last 7 days with the label ‘Inbound’.”  \n- “What are the **next actions due today**?”  \n- “Which leads are **stuck &gt;14 days** without updates?”  \n- “Give me a one-paragraph **pipeline health** summary.”\n\n---\n\n## 📬 Contact\nNeed help extending this (e.g., posting summaries to Slack/Email or auto-creating activities)?\n\n- 📧 **robert@ynteractive.com**  \n- 🔗 **[Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)**  \n- 🌐 **[ynteractive.com](https://ynteractive.com)**\n",
    "workflow": {
      "meta": {
        "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
        "templateCredsSetupCompleted": true
      },
      "nodes": [
        {
          "id": "3a42f460-754a-4d50-b5f7-4f550c9481d2",
          "name": "OpenAI Chat Model1",
          "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
          "position": [
            -80,
            368
          ],
          "parameters": {
            "model": {
              "__rl": true,
              "mode": "list",
              "value": "gpt-4o-mini",
              "cachedResultName": "gpt-4o-mini"
            },
            "options": {}
          },
          "credentials": {
            "openAiApi": {
              "id": "credential-id",
              "name": "openAiApi Credential"
            }
          },
          "typeVersion": 1.2
        },
        {
          "id": "74a26fd1-a743-4495-902b-1f22a753eb30",
          "name": "Pipedrive Tool",
          "type": "n8n-nodes-base.pipedriveTool",
          "position": [
            480,
            416
          ],
          "parameters": {
            "filters": {},
            "resource": "lead",
            "operation": "getAll",
            "returnAll": true
          },
          "credentials": {
            "pipedriveApi": {
              "id": "credential-id",
              "name": "pipedriveApi Credential"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "bbb5baca-6411-4d41-8530-3aff0a228513",
          "name": "Chat with Slack",
          "type": "@n8n/n8n-nodes-langchain.chatTrigger",
          "position": [
            -256,
            -48
          ],
          "webhookId": "d38a0072-420b-4de8-86b6-03a8f9a6e254",
          "parameters": {
            "options": {}
          },
          "typeVersion": 1.3
        },
        {
          "id": "0983fb7e-b445-4018-b104-2c3047483a0e",
          "name": "Sticky Note5",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -864,
            -240
          ],
          "parameters": {
            "width": 400,
            "height": 816,
            "content": "\n## ⚙️ Setup Instructions\n\n### 1️⃣ Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys)  \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview)  \n3. Add funds to your billing account  \n4. Copy your API key into the **OpenAI credentials** in n8n\n\n### 2️⃣ Connect Pipedrive\n1. In **Pipedrive** → **Personal preferences → API** → copy your **API token**  \n   - URL shortcut: `https://{your-company}.pipedrive.com/settings/personal/api`  \n2. In **n8n** → **Credentials → New → Pipedrive API**  \n   - **Company domain**: `{your-company}` (the subdomain in your Pipedrive URL)  \n   - **API Token**: paste the token from step 1 → **Save**  \n3. In the **Pipedrive Tool** node, select your Pipedrive credential and (optionally) set filters (e.g., owner, label, created time).\n\n\n## 📬 Contact\nNeed help extending this (e.g., posting summaries to Slack/Email or auto-creating activities)?\n\n- 📧 **robert@ynteractive.com**  \n- 🔗 **[Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)**  \n- 🌐 **[ynteractive.com](https://ynteractive.com)**\n"
          },
          "typeVersion": 1
        },
        {
          "id": "37d66b1a-be0d-4d41-b334-357228086e3b",
          "name": "Sticky Note51",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -416,
            -240
          ],
          "parameters": {
            "color": 7,
            "width": 1136,
            "height": 816,
            "content": "# 📊 Pipedrive Leads Chatbot (n8n + OpenAI)\n\nAsk natural-language questions about your **Pipedrive leads**. This workflow pulls live lead data from Pipedrive and has OpenAI answer questions like “leads added this week”, “stuck leads by owner”, or “next activities due today.” Responses are grounded **only** in your Pipedrive data.\n\n"
          },
          "typeVersion": 1
        },
        {
          "id": "97f075a0-1bdb-4846-a5f8-c026cba0d3b3",
          "name": "Pipedrive Leads Chatbot",
          "type": "@n8n/n8n-nodes-langchain.agent",
          "position": [
            32,
            -48
          ],
          "parameters": {
            "options": {
              "systemMessage": "You are a helpful assistant.\nFor all questions, get the lead conversation history from the Pipedrive tool.\nDo not make anything up. Use only the data available in the Pipedrive conversation history tool to answer questions."
            }
          },
          "typeVersion": 2.2
        },
        {
          "id": "c9cf44b3-eb53-4dff-a33a-6ff8abf5a8b0",
          "name": "Sticky Note",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -192,
            208
          ],
          "parameters": {
            "color": 3,
            "width": 288,
            "height": 304,
            "content": "### 1️⃣ Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys)  \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview)  \n3. Add funds to your billing account  \n4. Copy your API key into the **OpenAI credentials** in n8n  "
          },
          "typeVersion": 1
        },
        {
          "id": "14df1699-db12-4e70-8590-aacad8bd97a1",
          "name": "Sticky Note1",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            368,
            -16
          ],
          "parameters": {
            "color": 3,
            "width": 288,
            "height": 544,
            "content": "### 2️⃣ Connect Pipedrive\n1. In **Pipedrive** → **Personal preferences → API** → copy your **API token**  \n   - URL shortcut: `https://{your-company}.pipedrive.com/settings/personal/api`  \n2. In **n8n** → **Credentials → New → Pipedrive API**  \n   - **Company domain**: `{your-company}` (the subdomain in your Pipedrive URL)  \n   - **API Token**: paste the token from step 1 → **Save**  \n3. In the **Pipedrive Tool** node, select your Pipedrive credential and (optionally) set filters (e.g., owner, label, created time).\n"
          },
          "typeVersion": 1
        }
      ],
      "pinData": {},
      "connections": {
        "Pipedrive Tool": {
          "ai_tool": [
            [
              {
                "node": "Pipedrive Leads Chatbot",
                "type": "ai_tool",
                "index": 0
              }
            ]
          ]
        },
        "Chat with Slack": {
          "main": [
            [
              {
                "node": "Pipedrive Leads Chatbot",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "OpenAI Chat Model1": {
          "ai_languageModel": [
            [
              {
                "node": "Pipedrive Leads Chatbot",
                "type": "ai_languageModel",
                "index": 0
              }
            ]
          ]
        }
      }
    },
    "lastUpdatedBy": 29,
    "workflowInfo": {
      "nodeCount": 8,
      "nodeTypes": {
        "n8n-nodes-base.stickyNote": {
          "count": 4
        },
        "n8n-nodes-base.pipedriveTool": {
          "count": 1
        },
        "@n8n/n8n-nodes-langchain.agent": {
          "count": 1
        },
        "@n8n/n8n-nodes-langchain.chatTrigger": {
          "count": 1
        },
        "@n8n/n8n-nodes-langchain.lmChatOpenAi": {
          "count": 1
        }
      }
    },
    "status": "published",
    "user": {
      "name": "Robert Breen",
      "username": "rbreen",
      "bio": "Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.",
      "verified": true,
      "links": [
        "https://ynteractive.com/"
      ],
      "avatar": "https://gravatar.com/avatar/15bb5ad97bad47ca2079e1fa123a8287000c72c86498c90043f70ec2adab05f3?r=pg&d=retro&size=200"
    },
    "nodes": [
      {
        "id": 565,
        "icon": "fa:sticky-note",
        "name": "n8n-nodes-base.stickyNote",
        "codex": {
          "data": {
            "alias": [
              "Comments",
              "Notes",
              "Sticky"
            ],
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0",
            "subcategories": {
              "Core Nodes": [
                "Helpers"
              ]
            }
          }
        },
        "group": "[\"input\"]",
        "defaults": {
          "name": "Sticky Note",
          "color": "#FFD233"
        },
        "iconData": {
          "icon": "sticky-note",
          "type": "icon"
        },
        "displayName": "Sticky Note",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      },
      {
        "id": 1119,
        "icon": "fa:robot",
        "name": "@n8n/n8n-nodes-langchain.agent",
        "codex": {
          "data": {
            "alias": [
              "LangChain",
              "Chat",
              "Conversational",
              "Plan and Execute",
              "ReAct",
              "Tools"
            ],
            "resources": {
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/"
                }
              ]
            },
            "categories": [
              "AI",
              "Langchain"
            ],
            "subcategories": {
              "AI": [
                "Agents",
                "Root Nodes"
              ]
            }
          }
        },
        "group": "[\"transform\"]",
        "defaults": {
          "name": "AI Agent",
          "color": "#404040"
        },
        "iconData": {
          "icon": "robot",
          "type": "icon"
        },
        "displayName": "AI Agent",
        "typeVersion": 3,
        "nodeCategories": [
          {
            "id": 25,
            "name": "AI"
          },
          {
            "id": 26,
            "name": "Langchain"
          }
        ]
      },
      {
        "id": 1153,
        "icon": "file:openAiLight.svg",
        "name": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
        "codex": {
          "data": {
            "resources": {
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenai/"
                }
              ]
            },
            "categories": [
              "AI",
              "Langchain"
            ],
            "subcategories": {
              "AI": [
                "Language Models",
                "Root Nodes"
              ],
              "Language Models": [
                "Chat Models (Recommended)"
              ]
            }
          }
        },
        "group": "[\"transform\"]",
        "defaults": {
          "name": "OpenAI Chat Model"
        },
        "iconData": {
          "type": "file",
          "fileBuffer": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTM2Ljg2NzEgMTYuMzcxOEMzNy43NzQ2IDEzLjY0OCAzNy40NjIxIDEwLjY2NDIgMzYuMDEwOCA4LjE4NjYxQzMzLjgyODIgNC4zODY1MyAyOS40NDA3IDIuNDMxNDkgMjUuMTU1NiAzLjM1MTUxQzIzLjI0OTMgMS4yMDM5NiAyMC41MTA1IC0wLjAxNzMxNDggMTcuNjM5MiAwLjAwMDE4NTUzM0MxMy4yNTkxIC0wLjAwOTgxNDY4IDkuMzcyNzMgMi44MTAyNSA4LjAyNTIgNi45Nzc4M0M1LjIxMTM5IDcuNTU0MSAyLjc4MjU4IDkuMzE1MzggMS4zNjEzIDExLjgxMTdDLTAuODM3NDkzIDE1LjYwMTggLTAuMzM2MjMyIDIwLjM3OTQgMi42MDEzMyAyMy42Mjk0QzEuNjkzODEgMjYuMzUzMiAyLjAwNjMyIDI5LjMzNzEgMy40NTc2IDMxLjgxNDZDNS42NDAxNSAzNS42MTQ3IDEwLjAyNzcgMzcuNTY5NyAxNC4zMTI4IDM2LjY0OTdDMTYuMj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MS40NjA0IDE1LjQyMDQgMTEuNDIxNyAxNS40NTE2IDExLjM5NjdMMjMuNTAzIDYuNzUxNThDMjcuMDg5NCA0LjY4Mjc5IDMxLjY3NDUgNS45MTQwNiAzMy43NDIgOS41MDE2NEMzNC42MTU4IDExLjAxNjcgMzQuOTMyIDEyLjc5MDUgMzQuNjM1OCAxNC41MTQySDM0LjYzODNaTTEzLjU3NDEgMjEuNDQzMUwxMC4yMDY1IDE5LjQ5OTRDMTAuMTcwMiAxOS40ODE5IDEwLjE0NjUgMTkuNDQ2OCAxMC4xNDE1IDE5LjQwNjhWMTAuMTA3OUMxMC4xNDQgNS45Njc4MSAxMy41MDI4IDIuNjEyNzQgMTcuNjQyOSAyLjYxNTI0QzE5LjM5NDIgMi42MTUyNCAyMS4wODkyIDMuMjMwMjUgMjIuNDM1NSA0LjM1MDI4QzIyLjM3NDMgNC4zODI3OCAyMi4yNjkzIDQuNDQxNTMgMjIuMTk5MiA0LjQ4NDAzTDE0LjIzNDEgOS4wODQxM0MxMy44MjY2IDkuMzE1MzggMTMuNTc2NiA5Ljc0Nzg5IDEzLjU3OTEgMTAuMjE2N0wxMy41NzQxIDIxLjQ0MDZWMjEuNDQzMVpNMTUuNDAyOSAxNy41MDA2TDE5LjczNDIgMTQuOTk5M0wyNC4wNjU1IDE3LjQ5OTNWMjIuNTAwN0wxOS43MzQyIDI1LjAwMDdMMTUuNDAyOSAyMi41MDA3VjE3LjUwMDZaIiBmaWxsPSIjN0Q3RDg3Ii8+Cjwvc3ZnPgo="
        },
        "displayName": "OpenAI Chat Model",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 25,
            "name": "AI"
          },
          {
            "id": 26,
            "name": "Langchain"
          }
        ]
      },
      {
        "id": 1247,
        "icon": "fa:comments",
        "name": "@n8n/n8n-nodes-langchain.chatTrigger",
        "codex": {
          "data": {
            "resources": {
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.chattrigger/"
                }
              ]
            },
            "categories": [
              "Core Nodes",
              "Langchain"
            ]
          }
        },
        "group": "[\"trigger\"]",
        "defaults": {
          "name": "When chat message received"
        },
        "iconData": {
          "icon": "comments",
          "type": "icon"
        },
        "displayName": "Chat Trigger",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          },
          {
            "id": 26,
            "name": "Langchain"
          }
        ]
      }
    ],
    "categories": [
      {
        "id": 48,
        "name": "AI RAG"
      },
      {
        "id": 51,
        "name": "Multimodal AI"
      }
    ],
    "image": []
  }
}