Home/ Workflows/ Sales/ CRM Automation
Workflow · Sales

Automated Sales Pipeline CRM Updates with n8n

Streamline your sales process by automatically updating your CRM pipeline based on customer interactions, deal stages, and follow-up activities

Automated Sales Pipeline CRM Updates with n8n

Why This Automation Matters

Sales teams spend countless hours manually updating CRM records, moving deals between pipeline stages, and keeping track of customer interactions. This workflow eliminates manual data entry by automatically updating your CRM based on predefined triggers like email responses, form submissions, meeting completions, or time-based actions.

Benefits include:

What You Need Before Starting

Required Tools

Prerequisites

Complete Node-by-Node Build Instructions

Step 1: Set Up the Trigger Node

  1. Add a Webhook node as your starting point
  2. Set the HTTP method to POST
  3. Configure the webhook path as /sales-pipeline-update
  4. Enable “Respond to Webhook” option
  5. Set response code to 200

Step 2: Configure Data Processing

  1. Add a Set node after the webhook
  2. Configure the following parameters:
    • leadId: {{ $json.leadId }}
    • currentStage: {{ $json.currentStage }}
    • triggerType: {{ $json.triggerType }}
    • dealValue: {{ $json.dealValue }}
    • lastActivity: {{ $now }}

Step 3: Add Pipeline Stage Logic

  1. Insert a Switch node for stage determination
  2. Configure routing rules:
    • Route 1: {{ $json.triggerType === 'email_reply' }}
    • Route 2: {{ $json.triggerType === 'meeting_scheduled' }}
    • Route 3: {{ $json.triggerType === 'proposal_sent' }}
    • Route 4: {{ $json.triggerType === 'contract_signed' }}

Step 4: CRM Update Nodes

  1. Add HubSpot (or your CRM) nodes for each route

  2. Configure Route 1 (Email Reply):

    • Operation: Update
    • Resource: Deal
    • Deal ID: {{ $json.leadId }}
    • Properties to update: dealstage: 'qualified'
  3. Configure Route 2 (Meeting Scheduled):

    • Operation: Update
    • Resource: Deal
    • Deal ID: {{ $json.leadId }}
    • Properties: dealstage: 'presentation_scheduled'
  4. Configure Route 3 (Proposal Sent):

    • Operation: Update
    • Resource: Deal
    • Properties: dealstage: 'proposal_sent'
  5. Configure Route 4 (Contract Signed):

    • Operation: Update
    • Resource: Deal
    • Properties: dealstage: 'closed_won'

Step 5: Add Notification System

  1. Add Gmail node after each CRM update
  2. Configure email notifications to sales team:
    • To: sales-team@company.com
    • Subject: Pipeline Update: {{ $json.leadId }}
    • Body: Custom template with deal details

Step 6: Add Activity Logging

  1. Insert Google Sheets node for logging
  2. Configure to append row with:
    • Timestamp: {{ $now }}
    • Lead ID: {{ $json.leadId }}
    • Previous Stage: {{ $json.currentStage }}
    • New Stage: Updated stage value
    • Trigger Type: {{ $json.triggerType }}

Step 7: Error Handling

  1. Add If node to check for errors
  2. Configure condition: {{ $json.error }}
  3. Add Slack node for error notifications:
    • Channel: #sales-alerts
    • Message: Error details and affected lead

Step 8: Set Up Follow-up Actions

  1. Add Wait node with time-based delay
  2. Configure HTTP Request node for follow-up tasks
  3. Set up conditional logic for next actions based on stage

Complete Workflow JSON

{
  "name": "Sales Pipeline CRM Auto Updates",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "sales-pipeline-update",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [240, 300]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "leadId",
              "value": "={{ $json.leadId }}"
            },
            {
              "name": "currentStage",
              "value": "={{ $json.currentStage }}"
            },
            {
              "name": "triggerType",
              "value": "={{ $json.triggerType }}"
            },
            {
              "name": "dealValue",
              "value": "={{ $json.dealValue }}"
            },
            {
              "name": "lastActivity",
              "value": "={{ $now }}"
            }
          ]
        },
        "options": {}
      },
      "id": "set-variables",
      "name": "Set Variables",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [460, 300]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.triggerType }}",
              "operation": "equal",
              "value2": "email_reply"
            }
          ]
        }
      },
      "id": "switch-stage",
      "name": "Switch Pipeline Stage",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 1,
      "position": [680, 300]
    },
    {
      "parameters": {
        "resource": "deal",
        "operation": "update",
        "dealId": "={{ $json.leadId }}",
        "updateFields": {
          "dealStage": "qualified",
          "lastModifiedDate": "={{ $json.lastActivity }}"
        }
      },
      "id": "update-crm-qualified",
      "name": "Update CRM - Qualified",
      "type": "n8n-nodes-base.hubspot",
      "typeVersion": 1,
      "position": [900, 200]
    },
    {
      "parameters": {
        "resource": "deal",
        "operation": "update",
        "dealId": "={{ $json.leadId }}",
        "updateFields": {
          "dealStage": "presentation_scheduled",
          "lastModifiedDate": "={{ $json.lastActivity }}"
        }
      },
      "id": "update-crm-presentation",
      "name": "Update CRM - Presentation",
      "type": "n8n-nodes-base.hubspot",
      "typeVersion": 1,
      "position": [900, 300]
    },
    {
      "parameters": {
        "resource": "deal",
        "operation": "update",
        "dealId": "={{ $json.leadId }}",
        "updateFields": {
          "dealStage": "proposal_sent",
          "lastModifiedDate": "={{ $json.lastActivity }}"
        }
      },
      "id": "update-crm-proposal",
      "name": "Update CRM - Proposal",
      "type": "n8n-nodes-base.hubspot",
      "typeVersion": 1,
      "position": [900, 400]
    },
    {
      "parameters": {
        "resource": "deal",
        "operation": "update",
        "dealId": "={{ $json.leadId }}",
        "updateFields": {
          "dealStage": "closed_won",
          "lastModifiedDate": "={{ $json.lastActivity }}"
        }
      },
      "id": "update-crm-closed",
      "name": "Update CRM - Closed Won",
      "type": "n8n-nodes-base.hubspot",
      "typeVersion": 1,
      "position": [900, 500]
    },
    {
      "parameters": {
        "sendTo": "sales-team@company.com",
        "subject": "Pipeline Update: Lead {{ $json.leadId }}",
        "message": "Deal {{ $json.leadId }} has been moved to {{ $json.dealStage }} stage.\nDeal Value: ${{ $json.dealValue }}\nLast Activity: {{ $json.lastActivity }}"
      },
      "id": "notify-team",
      "name": "Notify Sales Team",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 1,
      "position": [1120, 300]
    },
    {
      "parameters": {
        "operation": "append",
        "sheetId": "sales-pipeline-log",
        "range": "A:F",
        "values": [
          [
            "={{ $json.lastActivity }}",
            "={{ $json.leadId }}",
            "={{ $json.currentStage }}",
            "={{ $json.dealStage }}",
            "={{ $json.triggerType }}",
            "={{ $json.dealValue }}"
          ]
        ]
      },
      "id": "log-activity",
      "name": "Log Activity",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [1340, 300]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "{\n  \"success\": true,\n  \"leadId\": \"{{ $json.leadId }}\",\n  \"newStage\": \"{{ $json.dealStage }}\",\n  \"timestamp\": \"{{ $json.lastActivity }}\"\n}"
      },
      "id": "webhook-response",
      "name": "Webhook Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [1560, 300]
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Set Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Variables": {
      "main": [
        [
          {
            "node": "Switch Pipeline Stage",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch Pipeline Stage": {
      "main": [
        [
          {
            "node": "Update CRM - Qualified",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update CRM - Presentation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update CRM - Proposal",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update CRM - Closed Won",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update CRM - Qualified": {
      "main": [
        [
          {
            "node": "Notify Sales Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update CRM - Presentation": {
      "main": [
        [
          {
            "node": "Notify Sales Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update CRM - Proposal": {
      "main": [
        [
          {
            "node": "Notify Sales Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update CRM - Closed Won": {
      "main": [
        [
          {
            "node": "Notify Sales Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Sales Team": {
      "main": [
        [
          {
            "node": "Log Activity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Activity": {
      "main": [
        [
          {
            "node": "Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 1,
  "updatedAt": "2026-05-13T10:00:00.000Z",
  "versionId": "1"
}

FAQ

Q: How do I trigger this workflow from different sources?

A: You can trigger this workflow through multiple methods:

Simply send a POST request to your webhook URL with the required JSON payload containing leadId, currentStage, triggerType, and dealValue.

Q: Can I customize the pipeline stages for my specific sales process?

A: Absolutely! The workflow is fully customizable for your unique sales pipeline:

The key is ensuring your trigger data matches the conditions in your Switch node and that your CRM stage names are spelled exactly as they appear in your CRM system.

Q: What happens if the workflow fails or encounters an error?

**