{"id": "YjUNjVfe6zRTcclC", "name": "piepdrive-test", "nodes": [{"id": "b2838678-c796-4c99-a3da-a2cd1b42ea97", "name": "Pipedrive Trigger - An Organization is created", "type": "n8n-nodes-base.pipedriveTrigger", "position": [820, 380], "webhookId": "f5de09a8-6601-4ad5-8bc8-9b3f4b83e997", "parameters": {"action": "added", "object": "organization"}, "credentials": {"pipedriveApi": {"id": "", "name": "Pipedrive Connection"}}, "typeVersion": 1}, {"id": "5aa05d79-b2fa-4040-b4ca-cad83adf2798", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [-20, 120], "parameters": {"width": 656.3637637842876, "height": 1455.9537026322007, "content": "# Enrich Pipedrive's Organization Data with GPT-4o When an Organization is Created in Pipedrive\n\nThis workflow **enriches a Pipedrive organization's data by adding a note to the organization object in Pipedrive**. It assumes there is a custom \"website\" field in your Pipedrive setup, as data will be scraped from this website to generate a note using OpenAI.\n\n## ⚠️ Disclaimer\n**These workflows use a scraping API. Before using it, ensure you comply with the regulations regarding web scraping in your country or state**.\n\n## Important Notes\n- The OpenAI model used is GPT-4o, chosen for its large input token context capacity. However, it is also **the most expensive option**, you should take cost into consideration.\n\n- The system prompt in the OpenAI Node generates output with relevant information, but feel free to improve or **modify it according to your needs**.\n\n## **How It Works**\n\n### Node 1: `Pipedrive Trigger - An Organization is Created`\nThis is the trigger of the workflow. When **an organization object is created in Pipedrive**, this node is triggered and retrieves the data. Make sure you have a \"website\" custom field (the name of the field in the n8n node will appear as a random ID and not with the Pipedrive custom field name).\n\n### Node 2: `ScrapingBee - Get Organization's Website's Homepage Content`\nThis node **scrapes the content** from the URL of the website associated with the **Pipedrive Organization** created in Node 1. The workflow uses the [ScrapingBee](https://www.scrapingbee.com/) API, but you can use any preferred API or simply the HTTP request node in n8n.\n\n### Node 3: `OpenAI - Message GPT-4o with Scraped Data`\nThis node sends HTML-scraped data from the previous node to the **OpenAI GPT-4 model**. The system prompt instructs the model to **extract company data**, such as products or services offered and competitors (if known by the model), and format it as HTML for optimal use in a Pipedrive Note.\n\n### Node 4: `Pipedrive - Create a Note with OpenAI Output`\nThis node **adds a Note to the Organization created in Pipedrive** using the OpenAI node output. The Note will include the company description, target market, selling products, and competitors (if GPT-4 was able to determine them).\n\n### Node 5 & 6: `HTML To Markdown` & `Code - Markdown to Slack Markdown`\nThese two nodes **format the HTML output to Slack Markdown**.\n\nThe Note created in Pipedrive is in HTML format, **as specified by the System Prompt of the OpenAI Node**. To send it to Slack, it needs to be converted to Markdown and then to Slack-specific Markdown.\n\n### Node 7: `Slack - Notify`\nThis node **sends a message in Slack containing the Pipedrive Organization Note** created with this workflow.\n"}, "typeVersion": 1}, {"id": "47ee8bfb-2f9d-4790-a929-1533215d6746", "name": "Pipedrive - Create a Note with OpenAI output", "type": "n8n-nodes-base.pipedrive", "position": [1640, 380], "parameters": {"content": "={{ $json.message.content }}", "resource": "note", "additionalFields": {"org_id": "={{ $('Pipedrive Trigger - An Organization is created').item.json.meta.id }}"}}, "credentials": {"pipedriveApi": {"id": "", "name": "Pipedrive Connection"}}, "typeVersion": 1}, {"id": "7783b531-0469-4bee-868e-4b26a1bb41ba", "name": "Code - Markdown to Slack Markdown", "type": "n8n-nodes-base.code", "position": [2080, 380], "parameters": {"jsCode": "const inputMarkdown = items[0].json.data;\n\nfunction convertMarkdownToSlackFormat(markdown) {\n let slackFormatted = markdown;\n \n // Convert headers\n slackFormatted = slackFormatted.replace(/^# (.*$)/gim, '*$1*');\n slackFormatted = slackFormatted.replace(/^## (.*$)/gim, '*$1*');\n \n // Convert unordered lists\n slackFormatted = slackFormatted.replace(/^\\* (.*$)/gim, '➡️ $1');\n \n // Convert tables\n const tableRegex = /\\n\\