AutomationFlowsMarketing & Ads › Lead Status Update Based on Activity

Lead Status Update Based on Activity

Lead Status Update Based on Activity. Uses httpRequest. Scheduled trigger; 7 nodes.

Cron / scheduled trigger★★★★☆ complexity7 nodesHTTP Request
Marketing & Ads Trigger: Cron / scheduled Nodes: 7 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Lead Status Update Based on Activity",
  "nodes": [
    {
      "parameters": {
        "url": "http://localhost:8000/api/activities",
        "authentication": "headerAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer={{$node[\"Set API Key\"].json[\"apiKey\"]}}"
            }
          ]
        },
        "options": {
          "queryParameters": {
            "parameters": [
              {
                "name": "completed",
                "value": "true"
              },
              {
                "name": "limit",
                "value": "50"
              }
            ]
          }
        }
      },
      "name": "Get Completed Activities",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "apiKey",
              "value": "YOUR_API_KEY_HERE"
            }
          ]
        }
      },
      "name": "Set API Key",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "batchSize": 1,
        "options": {}
      },
      "name": "Split Activities",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 2,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "url": "=http://localhost:8000/api/leads/{{$json[\"lead_id\"]}}",
        "authentication": "headerAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer={{$node[\"Set API Key\"].json[\"apiKey\"]}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Get Lead Details",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        850,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json[\"status\"]}}",
              "value2": "new",
              "operation": "equal"
            }
          ]
        }
      },
      "name": "IF Status is New",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1050,
        300
      ]
    },
    {
      "parameters": {
        "url": "=http://localhost:8000/api/leads/{{$json[\"id\"]}}",
        "authentication": "headerAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer={{$node[\"Set API Key\"].json[\"apiKey\"]}}"
            }
          ]
        },
        "options": {},
        "method": "PATCH",
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "status",
              "value": "contacted"
            }
          ]
        }
      },
      "name": "Update Lead Status",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1250,
        200
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        50,
        300
      ]
    }
  ],
  "connections": {
    "Get Completed Activities": {
      "main": [
        [
          {
            "node": "Split Activities",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set API Key": {
      "main": [
        [
          {
            "node": "Get Completed Activities",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Activities": {
      "main": [
        [
          {
            "node": "Get Lead Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Lead Details": {
      "main": [
        [
          {
            "node": "IF Status is New",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Status is New": {
      "main": [
        [
          {
            "node": "Update Lead Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set API Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "versionId": "1",
  "id": "2",
  "tags": []
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Lead Status Update Based on Activity. Uses httpRequest. Scheduled trigger; 7 nodes.

Source: https://github.com/MainfactAI/CRM/blob/a5ab06985f98ceb28ff91ddead4889bfe791d499/examples/n8n/lead_status_update_example.json — original creator credit. Request a take-down →

More Marketing & Ads workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Marketing & Ads

Workflow A — WhatsApp Lead Intake & Qualification. Uses postgres, httpRequest, errorTrigger. Scheduled trigger; 67 nodes.

Postgres, HTTP Request, Error Trigger
Marketing & Ads

Build authentic Reddit presence and generate qualified leads through AI-powered community engagement that provides genuine value without spam or promotion.

HTTP Request, Reddit
Marketing & Ads

Ghost Rider CRM Import (Lead Processor). Uses httpRequest. Scheduled trigger; 40 nodes.

HTTP Request
Marketing & Ads

This workflow runs on scheduled weekly and monthly triggers to generate unified marketing performance reports. It processes multiple websites by collecting analytics data, paid ads performance, and CR

Gmail, Google Sheets, Google Analytics +3
Marketing & Ads

Fetch Multiple Google Analytics GA4 metrics daily, post to Discord, update previous day’s entry as GA data finalizes over seven days. Automates daily traffic reporting Maintains single message per day

Google Analytics, Discord, HTTP Request