Send a Slack alert when a Pipedrive deal changes stage using n8n

low complexityCost: $0-24/moRecommended

Prerequisites

Prerequisites
  • n8n instance (cloud or self-hosted)
  • Pipedrive account with API access (Growth plan or higher)
  • Pipedrive API token (from Settings > Personal > Tools and Integrations > API)
  • Slack app with Bot Token (chat:write scope) or Slack credential configured in n8n
  • n8n credentials configured for both Pipedrive and Slack

Why n8n?

n8n gives you full control over the Slack message format — Block Kit sections, context blocks, stage transition details — that Pipedrive's native Dealbot cannot match. Dealbot sends plain-text notifications with a fixed layout. With n8n, you can show the old and new stage, deal value, owner, organization, and a clickable Pipedrive link in a clean, structured message. Self-hosted n8n is free with unlimited executions, so there is no per-alert cost regardless of volume.

Unlike the Salesforce recipe where n8n uses polling, the Pipedrive Trigger node uses webhooks. When you activate the workflow, n8n automatically registers a webhook with Pipedrive, so alerts arrive in real time — not on a 1-5 minute delay. Combined with Pipedrive's previous_data object in the webhook payload, you get the exact stage transition without needing to track state yourself.

How it works

  • Pipedrive Trigger node receives a webhook from Pipedrive whenever a deal is updated — fires in real time, not on a polling interval
  • IF node filters for actual stage changes by comparing previous_data.stage_id to the current stage_id, so non-stage updates are ignored
  • HTTP Request node (optional) fetches human-readable stage names and owner details from the Pipedrive API, since the webhook payload uses numeric IDs
  • Slack node posts a Block Kit message with deal name, value, stage transition, owner, organization, and a direct Pipedrive link

Step 1: Configure Pipedrive credentials in n8n

  1. In Pipedrive, go to Settings > Personal > Tools and Integrations > API
  2. Copy your API token
  3. In n8n, go to Credentials > New > Pipedrive API
  4. Paste the API token and save
  5. Optionally set the Company Domain (the subdomain from your Pipedrive URL, e.g., yourcompany from yourcompany.pipedrive.com)

Step 2: Add a Pipedrive Trigger node

Create a new workflow and add a Pipedrive Trigger node:

  • Credential: Select your Pipedrive API credential
  • Action: Updated
  • Object: Deal
Pipedrive triggers use webhooks — not polling

Unlike the Salesforce Trigger (which polls every 1-5 minutes), the Pipedrive Trigger registers a webhook with Pipedrive automatically when you activate the workflow. Alerts arrive within seconds of the stage change. No polling interval to configure — it is real-time.

Step 3: Add an IF node to filter stage changes

The trigger fires on any deal update — value changes, owner reassignments, note additions. Add an IF node to only proceed when the stage actually changed:

  • Condition: {{ $json.previous.stage_id }} is not equal to {{ $json.current.stage_id }}

This works because Pipedrive's webhook payload includes a previous object with old field values alongside the current deal data. If someone updates only the deal value, previous.stage_id and current.stage_id will match, and the workflow stops.

Step 4: Fetch stage names and owner details

The webhook payload contains numeric IDs — stage_id: 3, owner_id: 12345 — not human-readable labels. Add two HTTP Request nodes (run in parallel) to resolve them:

Fetch stage names:

  • Method: GET
  • URL: https://api.pipedrive.com/v1/stages
  • Query Parameters: api_token = your Pipedrive API token
  • Authentication: None (token is in the query parameter)

This returns all stages across all pipelines. In a Code node after the merge, map the old and new stage IDs to their names:

const stages = $('Fetch Stages').first().json.data;
const deal = $('IF').first().json;
 
const oldStage = stages.find(s => s.id === deal.previous.stage_id);
const newStage = stages.find(s => s.id === deal.current.stage_id);
 
return [{
  json: {
    ...deal.current,
    old_stage_name: oldStage ? oldStage.name : `Stage ${deal.previous.stage_id}`,
    new_stage_name: newStage ? newStage.name : `Stage ${deal.current.stage_id}`,
  }
}];

Fetch owner name:

If the webhook payload does not include the owner's full name (only owner_id), add an HTTP Request to fetch it:

  • Method: GET
  • URL: https://api.pipedrive.com/v1/users/{{ $json.current.owner_id }}
  • Query Parameters: api_token = your Pipedrive API token

Pull name from the response and merge it into the deal data in the Code node above.

Step 5: Send Slack notification

Add a Slack node:

  • Resource: Message
  • Operation: Send
  • Channel: #sales-alerts (or your preferred deals channel)
  • Message Type: Block Kit
{
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": ":arrows_counterclockwise: *Deal Stage Changed*\n*{{ $json.title }}*\n\n*Value:* ${{ $json.value }}\n*Stage:* {{ $json.old_stage_name }} :arrow_right: {{ $json.new_stage_name }}\n*Owner:* {{ $json.owner_name }}\n*Organization:* {{ $json.org_name }}"
      }
    },
    {
      "type": "context",
      "elements": [
        {
          "type": "mrkdwn",
          "text": "<https://{{ $json.company_domain }}.pipedrive.com/deal/{{ $json.id }}|View in Pipedrive>"
        }
      ]
    }
  ]
}

Replace {{ $json.company_domain }} with your actual Pipedrive subdomain if it is not available in the payload (e.g., hardcode yourcompany). The org_name and owner_name fields come from the Code node in Step 4.

Block Kit JSON format

n8n's Slack node expects the full {"blocks": [...]} wrapper object. If you pass just the array without the outer object, blocks are silently ignored and only the fallback notification text appears in Slack.

Step 6: Activate

  1. Click Execute Workflow to test — update a deal's stage in Pipedrive while the workflow is in test mode
  2. Verify the Slack message appears with correct deal info, stage transition, and Pipedrive link
  3. Toggle the workflow to Active

Once active, n8n registers the webhook with Pipedrive automatically. You can verify it exists in Pipedrive under Settings > Tools and apps > Webhooks.

Troubleshooting

Common questions

Does the Pipedrive Trigger use polling or webhooks?

Webhooks. When you activate the workflow, n8n registers a webhook subscription with Pipedrive via the API. Pipedrive then sends an HTTP POST to your n8n instance every time the subscribed event occurs. This means alerts arrive in real time — typically within 1-2 seconds of the stage change. This is a key difference from the Salesforce Trigger in n8n, which uses polling.

Can I detect which stage the deal moved from?

Yes. Pipedrive's webhook payload includes a previous_data (or previous) object containing the old values of any fields that changed. For a stage change, you get the old stage_id and the current stage_id, letting you show the full transition like "Discovery to Proposal." This is more reliable than platforms where you need to track state yourself.

Does each webhook event count as a separate n8n execution?

Yes. Each incoming webhook fires one execution. If 10 deals change stage in the same minute, that is 10 executions. On n8n Cloud Starter (2,500 executions/month), a team processing 50 stage changes per day would use roughly 1,500 executions per month on this workflow alone — well within the limit.

Cost

  • n8n Cloud Starter: $24/mo for 2,500 executions. Each webhook event = 1 execution.
  • Self-hosted: Free. Unlimited executions. Requires a server with a public URL for Pipedrive to deliver webhooks.

Looking to scale your AI operations?

We build and optimize automation systems for mid-market businesses. Let's discuss the right approach for your team.