Sync Zendesk Ticket Comments to Pipedrive Notes

Overview

This workflow automatically synchronizes new comments from Zendesk tickets to Pipedrive as notes, linking them to the correct person record. It runs daily at 9 AM, checks for tickets updated since the last execution, extracts email-based comments, matches the sender's email to a Pipedrive person, and adds the comment as a note. This is particularly useful for sales and support teams who want to keep customer communication history in sync between their helpdesk and CRM without manual data entry.

Workflow Steps

  1. Every day at 09:00 (Cron Trigger) — No auth. Runs the workflow once daily at 9:00 AM. Configured with triggerTimes.hour: 9.

  2. Get last execution timestamp (Function Item) — No auth. A JavaScript function that retrieves the last execution timestamp from workflow static data. On first run, it sets the timestamp to the current time. It outputs both lastExecution (previous run time) and executionTimeStamp (current run time).

  3. Get tickets updated after last execution (Zendesk) — OAuth2 (via zendeskApi credential). Queries Zendesk for all tickets updated after the lastExecution timestamp using the query updated>{{ $json["lastExecution"] }}. Results are sorted by updated_at in descending order.

  4. Channel is email (IF) — No auth. Filters tickets to only those where via.channel equals "email". This ensures only email-originated comments are processed (true branch continues, false branch goes to a NoOp).

  5. Set search email (Set) — No auth. Extracts the sender's email address from via.source.from.address and stores it in a new field called SearchEmail. keepOnlySet is enabled, so only this field is passed forward.

  6. Remove duplicates to make search efficient (Item Lists) — No auth. Removes duplicate items based on the SearchEmail field to avoid redundant Pipedrive searches.

  7. Search persons by email (Pipedrive) — API Key auth (via pipedriveApi credential). Searches Pipedrive persons by the SearchEmail field, specifically looking in the email field type.

  8. Rename fields and keep only needed fields (Set) — No auth. Renames the Pipedrive person id to PipeDrivePersonId and keeps the primary_email field. keepOnlySet is enabled.

  9. Add Pipedrive person Id to Zendesk tickets (Merge) — No auth. Merges the Pipedrive person data back into the original Zendesk ticket data using a key-based merge: via.source.from.address (from Zendesk) matches primary_email (from Pipedrive).

  10. Pipedrive person Id found (IF) — No auth. Checks if PipeDrivePersonId is not empty. If a matching person was found, the workflow proceeds to fetch comments; otherwise, it skips to a NoOp.

  11. Get Zendesk comments for tickets (HTTP Request) — OAuth2 (via zendeskApi credential). Makes a GET request to https://n8n.zendesk.com/api/v2/tickets/{{$json["id"]}}/comments to retrieve all comments for each ticket.

  12. Add comments to tickets (Merge) — No auth. Merges the comments data back with the ticket data using index-based inner join.

  13. Process comments per ticket (Split In Batches) — No auth. Processes comments one ticket at a time (batch size of 1) to handle each ticket's comments individually.

  14. Split comments to separate items (Item Lists) — No auth. Splits the comments array into individual items, one per comment.

  15. New comment (IF) — No auth. Compares the comment's created_at timestamp with the lastExecution timestamp. Only comments created after the last execution proceed (true branch).

  16. Add comment as a note in Pipedrive (Pipedrive) — API Key auth (via pipedriveApi credential). Creates a new note in Pipedrive with the comment content. The note includes a header "Message imported from Zendesk" and the sender's name. It is linked to the person using PipeDrivePersonId.

  17. Done processing (IF) — No auth. Checks if all batches have been processed (noItemsLeft context flag). If true, updates the last execution timestamp; otherwise, loops back to process the next ticket.

  18. Set new last execution timestamp (Function Item) — No auth. Updates the workflow static data with the current execution timestamp so the next run only picks up newer comments.

Setup Instructions

  1. Zendesk Account: You need a Zendesk subdomain (e.g., n8n.zendesk.com). Create an API token or OAuth app in Zendesk Admin Center. In n8n, create a Zendesk API credential with your subdomain, email, and API token.

  2. Pipedrive Account: You need a Pipedrive account. Generate an API token from Pipedrive Settings > Personal Preferences > API. In n8n, create a Pipedrive API credential with your API token.

  3. Workflow Activation: After importing the workflow, configure the Zendesk and Pipedrive credentials on the respective nodes. The cron trigger is set to 9:00 AM daily — adjust as needed. The workflow will automatically start syncing on the next scheduled run.

Use Cases & Variations

  • Sales-CRM Sync: Keep Pipedrive notes updated with the latest customer support interactions, giving sales reps full context before calls.
  • Multi-channel Support: Modify the "Channel is email" filter to include other channels like chat or web forms.
  • Real-time Sync: Replace the daily cron trigger with a Zendesk webhook trigger for instant synchronization.
  • Add Attachments: Extend the workflow to also sync file attachments from Zendesk comments to Pipedrive notes.
  • Bidirectional Sync: Combine with a reverse workflow that pushes Pipedrive notes back to Zendesk as internal comments.
21 nodesSales
No OpFunction ItemIFHTTP RequestMergeZendeskSetPipedrive

Workflow JSON

{
  "meta": {
    "instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
  },
  "nodes": [
    {
      "id": "a4280167-97e0-4d12-bdfc-735dd9c69f03",
      "name": "NoOp",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1160,
        540
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a3ad4e3b-0841-4a6e-993b-5239d9e56eaf",
      "name": "Get last execution timestamp",
      "type": "n8n-nodes-base.functionItem",
      "position": [
        420,
        300
      ],
      "parameters": {
        "functionCode": "// Code here will run once per input item.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.functionItem\n// Tip: You can use luxon for dates and $jmespath for querying JSON structures\n\n// Add a new field called 'myNewField' to the JSON of the item\nconst staticData = getWorkflowStaticData('global');\n\nif(!staticData.lastExecution){\n  staticData.lastExecution = new Date().toISOString();\n}\n\nitem.executionTimeStamp = new Date().toISOString();\nitem.lastExecution = staticData.lastExecution;\n\n\nreturn item;"
      },
      "typeVersion": 1
    },
    {
      "id": "f917bc42-8b9f-4b60-860c-360eeb86b88c",
      "name": "Set new last execution timestamp",
      "type": "n8n-nodes-base.functionItem",
      "position": [
        4440,
        140
      ],
      "parameters": {
        "functionCode": "// Code here will run once per input item.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.functionItem\n// Tip: You can use luxon for dates and $jmespath for querying JSON structures\n\n// Add a new field called 'myNewField' to the JSON of the item\nconst staticData = getWorkflowStaticData('global');\n\nstaticData.lastExecution = $item(0).$node[\"Get last execution timestamp\"].executionTimeStamp;\n\nreturn item;"
      },
      "executeOnce": true,
      "typeVersion": 1
    },
    {
      "id": "ff141018-5307-4754-a48a-2311fcd15f85",
      "name": "Pipedrive person Id found",
      "type": "n8n-nodes-base.if",
      "position": [
        2280,
        300
// ... truncated (copy to see full JSON)

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Related Templates

AI-Powered Competitor Price RAG Pipeline with Logging

Overview This workflow implements a Retrieval-Augmented Generation (RAG) pipeline for processing and analyzing competitor pricing data. It is triggered via a webhook (e.g., by an external scraper), splits incoming text into chunks, generates embeddings using OpenAI, stores them in a Supabase vector store, and then allows an Anthropic-powered AI agent to query that context. Results are appended to a Google Sheet for record-keeping, and any errors trigger a Slack alert to a designated channel. This setup is ideal for teams that need to automate the ingestion of structured or unstructured competitor data, enable natural language queries against that data, and maintain an audit log—all without manual intervention. Node-by-Node Breakdown Sticky Note — A visual note in the editor (not executed). Webhook Trigger (No auth) — Listens for incoming POST requests at the path . This is the entry point; an external service (e.g., a custom scraper) should send data here. Text Splitter (No auth) — Splits the incoming text into chunks of 400 characters with 40 character overlap. This ensures the embeddings are meaningful and context windows are manageable. Embeddings (API Key auth — OpenAI) — Uses the model to convert each text chunk into a vector embedding. Requires an OpenAI API key. Supabase Insert (API Key auth — Supabase) — Inserts the generated embeddings into the Supabase vector store under the index . This stores the data for future retrieval. Supabase Query (API Key auth — Supabase) — Queries the same Supabase vector index to retrieve relevant chunks based on a question or input from the agent. Vector Tool (No auth) — Wraps the Supabase query as a tool that the AI agent can call to fetch contextual data. Window Memory (No auth) — Provides conversational memory (buffer window) so the agent can maintain context across multiple interactions. Chat Model (API Key auth — Anthropic) — The language model that powers the AI agent. Uses Anthropic’s Claude model (selected via credentials). Requires an Anthropic API key. RAG Agent (No auth) — The core AI agent that receives the incoming data, uses the vector tool to retrieve relevant context, and generates a response using the chat model. The system message is set to "You are an assistant for Competitor Price Scraper". Append Sheet (OAuth2 — Google Sheets) — Appends the agent’s response (from the node) to a Google Sheet named . You must specify the Google Sheet ID and sheet name in the node parameters. Slack Alert (OAuth2 — Slack) — Triggered only on error from the RAG Agent. Sends a message to the channel with the error details. Setup Instructions Accounts & Credentials – You will need: - An OpenAI account (for embeddings). Create an API key and add it in n8n as an OpenAI credential. - An Anthropic account (for the chat model). Create an API key and add it as an Anthropic credential. - A Supabase project. Enable the pgvector extension, create a table for embeddings, and get the Supabase URL + anon/public API key. Add these as a Supabase credential in n8n. - A Google Cloud project with the Sheets API enabled. Generate OAuth2 credentials (or use a service account) and add them as a Google Sheets OAuth2 credential in n8n. - A Slack workspace. Create a Slack app with chat:write permission and install it to your workspace. Add the bot token as a Slack OAuth2 credential in n8n. Configure the Webhook – The webhook path is . You can change this as needed. Expose this endpoint (e.g., via n8n’s public URL or a tunnel) so your scraper can POST data to it. Set the Google Sheet ID and sheet name – In the Append Sheet node, replace with the actual ID of your Google Sheet and ensure the sheet is named (or update the parameter). Adjust Slack Channel – In the Slack Alert node, set the channel name (default ) to one that exists in your Slack workspace. Test the workflow – Send a sample POST request with some competitor price text to the webhook URL. Check the Google Sheet for logged responses and test error handling by sending malformed data. Use Cases & Variations Competitive Intelligence – Automate the ingestion of price lists, product descriptions, or news articles from competitors. Use the AI agent to answer questions like “Which competitor has the lowest price on product X?”. Document Q&A – Adapt this pipeline for any document type (PDFs, support tickets, internal memos). Replace the webhook with a file trigger and use the same RAG flow. Multi-Source Ingestion – Add an HTTP Request node before the Text Splitter to fetch data from an API or RSS feed instead of relying on a webhook. Custom Output – Instead of a Google Sheet, send the agent’s response via email, SMS, or directly into a CRM. Scheduled Runs – Swap the Webhook Trigger for a Schedule Trigger to run the ingestion on a regular basis (e.g., daily).

12 nodes

Extract Google Maps Business Leads via Dumpling AI to Google Sheets

Overview This workflow automates the extraction of business listings from Google Maps using Dumpling AI's search-maps API and logs the results into a structured Google Sheet. It's ideal for lead generation, market research, or competitive analysis — allowing you to quickly gather data like business names, ratings, addresses, phone numbers, websites, and booking links without manual browsing. Workflow Steps Trigger: Manual Test Run (Manual Trigger) — Starts the workflow on demand for testing. No authentication required. Search Google Maps via Dumpling AI (HTTP Request) — Sends a POST request to with a JSON body containing the search query (e.g., ) and language. Authentication uses Header Auth — you must provide a Dumpling AI API key as a header (configured in n8n credentials). The response returns an array of places with details like title, rating, address, phone, website, price level, and booking links. Split Places List for Processing (Split Out) — Splits the array from the HTTP response into individual items so each place can be processed separately. No authentication needed. Save Results to Google Sheet (Place Info) (Google Sheets) — Appends each place's data (name, address, rating, price level, type, website, phone, position, booking link) to a specified sheet in a Google Sheets document. Uses OAuth2 authentication (Google account). The sheet name is set to "Google Maps" and the document ID points to a spreadsheet named "Places". Setup Instructions Dumpling AI Account: Sign up at dumplingai.com and obtain an API key. In n8n, create a new Header Auth credential with the key name (e.g., ) and value . Google Sheets: Create a Google Sheet (or use the one referenced in the workflow). In n8n, create a Google Sheets OAuth2 credential by connecting your Google account. Ensure the sheet has a tab named "Google Maps" (or update the sheet name in the node). Customize Query: Edit the of the HTTP Request node to change the search query (e.g., ) or language. Run: Click "Execute Workflow" to test. The first run will prompt you to authorize Google Sheets access. Use Cases & Variations Lead Generation: Replace the query with industry-specific terms (e.g., "dentists in Los Angeles") to build a targeted prospect list. Competitor Analysis: Search for competitors in a niche and analyze their ratings, price levels, and online presence. Real Estate / Local Business Research: Extract data for multiple locations by chaining queries or using a loop. Automation: Replace the Manual Trigger with a Schedule Trigger to run daily/weekly, and add a Set node to dynamically pass queries from a spreadsheet or webhook. Enrichment: Add nodes to clean data, send notifications (Slack/Email), or integrate with a CRM like HubSpot.

5 nodes

Auto-Qualify Google Sheets Leads with OpenAI GPT-4

Overview This workflow automatically qualifies new leads submitted via Google Forms (or directly entered) into a Google Sheet. Using OpenAI's GPT-4, it evaluates each lead against custom criteria (e.g., decision-maker role, team size, email domain) and updates the sheet with a qualification rating and explanation. This saves manual review time and ensures consistent lead scoring for sales teams or community managers. Node-by-Node Breakdown Check for new entries (Google Sheets Trigger – OAuth2) - Listens for new rows added to a specific Google Sheet (connected to a Google Form or standalone). - Configured to poll every minute (adjustable). - Requires: A Google Sheet document ID and sheet name. Qualify leads with GPT (OpenAI – API Key auth) - Uses the chat model. - A system message defines qualification rules (decision-maker, team size, corporate email). - A user message injects the lead's name, email, business area, and team size from the trigger output. - Temperature set to 0.3 for consistent, deterministic responses. - Instructed to reply with a JSON object: . Extract JSON reply (Set Node – no auth) - Parses the from OpenAI's response using . - Stores the resulting object in a new field for downstream nodes. Merge (Merge Node – no auth) - Combines the original lead data (from the trigger) with the parsed GPT reply. - Uses “Combine” mode with “Merge by position” to join the two inputs horizontally. - Input 0 (from trigger) holds the row data; Input 1 (from Extract JSON reply) holds the GPT rating. Update lead status (Google Sheets – OAuth2) - Updates the same Google Sheet with the GPT's rating and explanation. - Matches rows by the column (to avoid updating the wrong row). - Writes the rating into a column (and optionally the explanation if you extend the schema). Setup Instructions Google Cloud / Sheets API - Create a Google Cloud project, enable the Google Sheets API, and create OAuth2 credentials (Desktop app or Web application). - In n8n, add a new Google Sheets credential (OAuth2) using your client ID and secret. OpenAI API Key - Sign up at OpenAI and create an API key. - In n8n, add a new OpenAI credential with your API key. Google Sheet - Use the provided template or create your own with columns: Timestamp, Email Address, Your name, Your business area, Your team size, Rating. - If using Google Forms, submissions will automatically populate the sheet. Configure the workflow - After importing, select each Google Sheets node and choose your credential and the correct sheet/document. - Adjust the polling interval if needed (default: every minute). - Modify the GPT system message to fit your own lead qualification criteria. Use Cases & Adaptations Sales lead scoring: Replace the criteria with your ICP (ideal customer profile) – e.g., industry, company size, budget. Community membership approval: Automatically accept or reject join requests based on responses. Event registration filtering: Qualify attendees for VIP access or follow-up. Extend output: Store the explanation in a separate column by adding it to the Update node's column mapping. Add notifications: Insert a Slack or email node after the Merge to alert your team when a high-quality lead is detected. Use a different model: Switch to for lower cost or for faster responses. This template is a starting point – tweak the prompt, polling frequency, and output columns to match your exact process.

9 nodes

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.