Puntuación de oportunidades de venta de BeyondPresence - Inteligencia de prospectos en tiempo real

Intermedio

Este es unSales, AIflujo de automatización del dominio deautomatización que contiene 14 nodos.Utiliza principalmente nodos como Code, Slack, Switch, Webhook, RespondToWebhook, combinando tecnología de inteligencia artificial para lograr automatización inteligente. BeyondPresence Sales Intelligence → Puntuación de leads en tiempo real

Requisitos previos
  • Bot Token de Slack o URL de Webhook
  • Punto final de HTTP Webhook (n8n generará automáticamente)
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "id": "3lIutQSsxmpnS38v",
  "meta": {
    "instanceId": "eb3d53320c110bef9b66cf21b0da1ce60c7b6876e22315eca1be511a26fd726c",
    "templateCredsSetupCompleted": true
  },
  "name": "BeyondPresence Sales Opportunity Scoring - Real-Time Lead Intelligence",
  "tags": [],
  "nodes": [
    {
      "id": "8131b77c-66b2-4138-bac9-1062dd50b631",
      "name": "Descripción General del Flujo de Trabajo",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -600
      ],
      "parameters": {
        "color": 6,
        "width": 560,
        "height": 660,
        "content": "## 🎯 Sales Opportunity Scoring System\n\n**What This Does:**\n- Monitors BeyondPresence user messages in real-time\n- Scores leads based on buying signals\n- Detects competitor mentions instantly\n- Estimates potential deal size\n- Sends intelligent alerts to Slack\n\n**Setup Required:**\n1. Configure Slack OAuth2 credentials\n2. Update channel names in Slack nodes\n3. Add BeyondPresence webhook URL"
      },
      "typeVersion": 1
    },
    {
      "id": "ab3a8f0b-a1ab-4f88-80ed-435115915cb3",
      "name": "Reglas de Puntuación",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        -600
      ],
      "parameters": {
        "color": 4,
        "width": 400,
        "height": 780,
        "content": "## 📊 Scoring Logic\n\n**Buying Signals (+Points):**\n- \"interested\" / \"tell me more\" (+20)\n- \"budget\" / \"pricing\" (+15)\n- \"timeline\" / \"when\" (+15)\n- \"demo\" / \"trial\" (+25)\n- \"decision maker\" (+30)\n- \"purchase\" / \"buy\" (+30)\n\n**Negative Signals (-Points):**\n- \"too expensive\" (-20)\n- \"not interested\" (-30)\n- \"just looking\" (-15)\n- \"maybe later\" (-10)"
      },
      "typeVersion": 1
    },
    {
      "id": "6395e121-1f83-4d07-a8e2-1566c37511ce",
      "name": "Sistema de Alertas",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        -600
      ],
      "parameters": {
        "color": 3,
        "width": 380,
        "height": 780,
        "content": "## 🔔 Slack Alerts\n\n**Automatic Notifications:**\n- 🔥 Hot leads (score > 70)\n- ⚡ Competitor mentions\n- 💰 Large deal indicators\n- 📈 Buying signal clusters\n- 🚨 At-risk opportunities\n\n**Smart Threading:**\n- Groups messages by call ID\n- Shows conversation context\n- Tracks score progression"
      },
      "typeVersion": 1
    },
    {
      "id": "abc9e5e4-df53-4891-97ff-6c18fd06d534",
      "name": "BeyondPresence en Tiempo Real Disparador Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        100,
        -120
      ],
      "webhookId": "beyondpresence-sales-intelligence",
      "parameters": {
        "path": "beyondpresence-sales-intelligence",
        "options": {
          "rawBody": false
        },
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "f94cb19d-0bca-4f42-8f25-11cc853f3323",
      "name": "Acusar de Recibo",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        280,
        -120
      ],
      "parameters": {
        "options": {
          "responseCode": 200
        },
        "respondWith": "json",
        "responseBody": "{\n  \"status\": \"success\",\n  \"message\": \"Sales intelligence processing\",\n  \"timestamp\": \"{{ $now.toISO() }}\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "9dae992f-6930-4db1-9c18-b85deaa352df",
      "name": "Filtrar Mensajes de Usuario",
      "type": "n8n-nodes-base.switch",
      "position": [
        460,
        -120
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "user_message",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.body.event_type }}",
                    "rightValue": "message"
                  },
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.body.message.sender }}",
                    "rightValue": "user"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "call_ended",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.body.event_type }}",
                    "rightValue": "call_ended"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "none"
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "c7cc875b-4282-4197-9d56-879a287fe385",
      "name": "Puntuar Oportunidad de Venta",
      "type": "n8n-nodes-base.code",
      "position": [
        720,
        -160
      ],
      "parameters": {
        "jsCode": "// Sales Opportunity Scoring Engine\n// Helper function for recommendations (moved to top for better organization)\nfunction generateRecommendations(score, signals) {\n  const recommendations = [];\n  \n  if (score >= 70) {\n    recommendations.push('📞 Schedule immediate follow-up call');\n    recommendations.push('👤 Loop in senior sales rep');\n    recommendations.push('📊 Prepare custom pricing proposal');\n  } else if (score >= 40) {\n    recommendations.push('📧 Send detailed product information');\n    recommendations.push('📅 Offer demo scheduling link');\n    recommendations.push('📚 Share relevant case studies');\n  } else if (score < 0) {\n    recommendations.push('🎯 Address specific objections');\n    recommendations.push('💡 Focus on value proposition');\n    recommendations.push('📞 Schedule follow-up for better timing');\n  }\n  \n  if (signals.includes('🏁 Competitor Evaluation')) {\n    recommendations.push('⚔️ Prepare competitive differentiation materials');\n  }\n  \n  return recommendations;\n}\n\ntry {\n  // Safely extract input data with validation\n  const input = $input.first();\n  if (!input || !input.json || !input.json.body) {\n    throw new Error('Invalid input structure');\n  }\n  \n  const messageData = input.json.body;\n  const message = messageData.message;\n  const callId = messageData.call_id || 'unknown';\n  const userName = messageData.call_data?.userName || 'Unknown User';\n  \n  // Validate message structure\n  if (!message || !message.message) {\n    throw new Error('Message content is missing');\n  }\n  \n  // Initialize scoring\n  let opportunityScore = 0;\n  const detectedSignals = [];\n  const alerts = [];\n  \n  // Buying Signal Detection with Scoring\n  const buyingSignals = {\n    high_intent: {\n      keywords: ['purchase', 'buy', 'implement', 'contract', 'agreement', 'sign up', 'ready to move forward'],\n      score: 30,\n      label: '🔥 High Purchase Intent'\n    },\n    decision_maker: {\n      keywords: ['decision maker', 'my team', 'our company', 'we need', 'our budget', 'my boss', 'approval from'],\n      score: 25,\n      label: '👔 Decision Maker Indicator'\n    },\n    demo_request: {\n      keywords: ['demo', 'trial', 'test', 'try it', 'see it in action', 'show me', 'walk through'],\n      score: 25,\n      label: '🖥️ Demo Request'\n    },\n    timeline: {\n      keywords: ['when can', 'how soon', 'timeline', 'start date', 'implement by', 'deadline', 'need this by'],\n      score: 20,\n      label: '⏰ Timeline Discussion'\n    },\n    budget: {\n      keywords: ['budget', 'cost', 'pricing', 'investment', 'roi', 'pay', 'afford', 'price point'],\n      score: 15,\n      label: '💰 Budget Discussion'\n    },\n    interest: {\n      keywords: ['interested', 'tell me more', 'sounds good', 'like this', 'impressive', 'exactly what', 'perfect'],\n      score: 15,\n      label: '👍 Positive Interest'\n    },\n    problem_fit: {\n      keywords: ['solve our problem', 'exactly what we need', 'perfect for us', 'this would help', 'addresses our'],\n      score: 20,\n      label: '✅ Strong Problem-Solution Fit'\n    }\n  };\n  \n  // Negative Signal Detection\n  const negativeSignals = {\n    price_objection: {\n      keywords: ['too expensive', 'cant afford', 'over budget', 'too much', 'cheaper option', 'cost too high'],\n      score: -25,\n      label: '💸 Price Objection'\n    },\n    not_interested: {\n      keywords: ['not interested', 'no thanks', 'not for us', 'pass', 'not looking', 'don\\'t need'],\n      score: -30,\n      label: '❌ Not Interested'\n    },\n    timing: {\n      keywords: ['not right now', 'maybe later', 'next year', 'not a priority', 'down the road', 'future'],\n      score: -15,\n      label: '⏸️ Bad Timing'\n    },\n    just_browsing: {\n      keywords: ['just looking', 'researching', 'comparing options', 'early stages', 'exploring', 'window shopping'],\n      score: -10,\n      label: '🔍 Just Browsing'\n    }\n  };\n  \n  // Competitor Detection \n  const competitors = [\n    'competitor', 'alternative', 'other options', 'shopping around',\n    'comparing', 'versus', 'instead of', 'switch from',\n // Competitor Detection - Add your specific competitors here\n   'competitor1', 'competitor2'\n  ];\n  \n  // Deal Size Indicators\n  const dealSizeIndicators = {\n    enterprise: {\n      keywords: ['enterprise', 'company-wide', 'global', 'multiple teams', 'thousand users', 'all departments', 'entire organization'],\n      multiplier: 10,\n      label: '🏢 Enterprise Deal'\n    },\n    mid_market: {\n      keywords: ['department', 'team of', 'hundred users', 'multiple locations', 'division', 'several teams'],\n      multiplier: 5,\n      label: '🏬 Mid-Market Deal'\n    },\n    small_business: {\n      keywords: ['small team', 'few users', 'startup', 'small business', 'just us', 'handful of people'],\n      multiplier: 1,\n      label: '🏪 Small Business Deal'\n    }\n  };\n  \n  // Process message through scoring engine\n  const messageLower = message.message.toLowerCase();\n  \n  // Check buying signals\n  Object.entries(buyingSignals).forEach(([key, signal]) => {\n    if (signal.keywords.some(keyword => messageLower.includes(keyword))) {\n      opportunityScore += signal.score;\n      detectedSignals.push(signal.label);\n    }\n  });\n  \n  // Check negative signals\n  Object.entries(negativeSignals).forEach(([key, signal]) => {\n    if (signal.keywords.some(keyword => messageLower.includes(keyword))) {\n      opportunityScore += signal.score; // Note: score is negative\n      detectedSignals.push(signal.label);\n      alerts.push(`⚠️ Objection Detected: ${signal.label}`);\n    }\n  });\n  \n  // Check for competitors\n  const mentionedCompetitors = competitors.filter(comp => \n    messageLower.includes(comp.toLowerCase())\n  );\n  if (mentionedCompetitors.length > 0) {\n    alerts.push(`🎯 Competitor Mentioned: ${mentionedCompetitors.join(', ')}`);\n    detectedSignals.push('🏁 Competitor Evaluation');\n  }\n  \n  // Estimate deal size\n  let dealSizeEstimate = 'standard';\n  let dealMultiplier = 2;\n  Object.entries(dealSizeIndicators).forEach(([size, indicator]) => {\n    if (indicator.keywords.some(keyword => messageLower.includes(keyword))) {\n      dealSizeEstimate = size;\n      dealMultiplier = indicator.multiplier;\n      detectedSignals.push(indicator.label);\n    }\n  });\n  \n  // Determine lead temperature\n  let leadTemperature = '🧊 Cold';\n  let alertUrgency = 'low';\n  if (opportunityScore >= 70) {\n    leadTemperature = '🔥 Hot';\n    alertUrgency = 'high';\n    alerts.push('🚨 HOT LEAD DETECTED!');\n  } else if (opportunityScore >= 40) {\n    leadTemperature = '🌡️ Warm';\n    alertUrgency = 'medium';\n  } else if (opportunityScore >= 20) {\n    leadTemperature = '😎 Cool';\n    alertUrgency = 'low';\n  }\n  \n  // Extract numbers for deal size estimation - Improved regex\n  const numberMatches = messageLower.match(/\\$?\\d{1,3}(?:,\\d{3})*(?:\\.\\d{2})?[km]?|\\d+[km]/gi);\n  let estimatedValue = null;\n  if (numberMatches && numberMatches.length > 0) {\n    // Convert to standardized number\n    const lastNumber = numberMatches[numberMatches.length - 1];\n    let parsedValue = 0;\n    \n    if (lastNumber.toLowerCase().includes('k')) {\n      parsedValue = parseFloat(lastNumber.replace(/[^0-9.]/g, '')) * 1000;\n    } else if (lastNumber.toLowerCase().includes('m')) {\n      parsedValue = parseFloat(lastNumber.replace(/[^0-9.]/g, '')) * 1000000;\n    } else {\n      parsedValue = parseFloat(lastNumber.replace(/[$,]/g, ''));\n    }\n    \n    // Only set estimatedValue if we got a valid number\n    if (!isNaN(parsedValue) && parsedValue > 0) {\n      estimatedValue = parsedValue * dealMultiplier;\n    }\n  }\n  \n  // Prepare output\n  return [{\n    json: {\n      // Message context\n      callId: callId,\n      userName: userName,\n      timestamp: message.sent_at || new Date().toISOString(),\n      sender: message.sender || 'unknown',\n      message: message.message,\n      \n      // Scoring results\n      opportunityScore: opportunityScore,\n      leadTemperature: leadTemperature,\n      alertUrgency: alertUrgency,\n      \n      // Detected signals\n      detectedSignals: detectedSignals,\n      alerts: alerts,\n      \n      // Competitor intelligence\n      competitorsMentioned: mentionedCompetitors,\n      hasCompetitorMention: mentionedCompetitors.length > 0,\n      \n      // Deal estimation\n      dealSizeCategory: dealSizeEstimate,\n      dealMultiplier: dealMultiplier,\n      estimatedDealValue: estimatedValue,\n      formattedDealValue: estimatedValue ? `$${estimatedValue.toLocaleString()}` : 'Not detected',\n      \n      // Action recommendations\n      recommendedActions: generateRecommendations(opportunityScore, detectedSignals),\n      \n      // Metadata\n      processedAt: new Date().toISOString(),\n      workflowExecution: $execution?.id || 'unknown',\n      \n      // Success indicator\n      success: true,\n      error: null\n    }\n  }];\n  \n} catch (error) {\n  // Return error response\n  return [{\n    json: {\n      success: false,\n      error: error.message,\n      callId: 'error',\n      userName: 'Unknown',\n      timestamp: new Date().toISOString(),\n      opportunityScore: 0,\n      leadTemperature: '❌ Error',\n      alertUrgency: 'high',\n      alerts: [`🚨 Processing Error: ${error.message}`],\n      recommendedActions: ['🔧 Check input data format', '📞 Contact technical support'],\n      processedAt: new Date().toISOString()\n    }\n  }];\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "88281417-5a4a-414d-9c8f-295ac1b3aeaa",
      "name": "Enrutar Alertas",
      "type": "n8n-nodes-base.switch",
      "position": [
        920,
        -200
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "hot_lead",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.alertUrgency }}",
                    "rightValue": "high"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "competitor_alert",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "boolean",
                      "operation": "true",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.hasCompetitorMention }}",
                    "rightValue": "={{ true }}"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "qualified_lead",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ $json.opportunityScore }}",
                    "rightValue": 40
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "none"
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "0f6ed4eb-c8d4-4c1e-8c03-991d887c83f9",
      "name": "Slack: Alerta de Lead Caliente",
      "type": "n8n-nodes-base.slack",
      "position": [
        1260,
        -260
      ],
      "webhookId": "bb0d3a7c-7481-4a86-b52a-9511cdc2309e",
      "parameters": {
        "text": "=🔥 *HOT LEAD ALERT!*\n\n*Lead:* {{ $json.userName }}\n*Score:* {{ $json.opportunityScore }} {{ $json.leadTemperature }}\n*Call ID:* `{{ $json.callId }}`\n\n*Message:* _\"{{ $json.message }}\"_\n\n*Detected Signals:*\n{{ $json.detectedSignals.join('\\n') }}\n\n*Recommended Actions:*\n{{ $json.recommendedActions.join('\\n') }}\n\n{{ $json.estimatedDealValue ? `💰 *Estimated Deal Value:* ${$json.formattedDealValue}` : '' }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#sales-hot-leads"
        },
        "otherOptions": {
          "mrkdwn": true
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "fqQEQ6t5FN8BPrTs",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "35d57ba3-432e-444a-bde4-b6bc5a340ee7",
      "name": "Slack: Alerta de Competidor",
      "type": "n8n-nodes-base.slack",
      "position": [
        1240,
        -120
      ],
      "webhookId": "987e4ae2-0036-4cd1-8986-775c7ba988e7",
      "parameters": {
        "text": "=🎯 *Competitor Intelligence Alert*\n\n*Lead:* {{ $json.userName }}\n*Competitors Mentioned:* `{{ $json.competitorsMentioned.join(', ') }}`\n\n*Context:* _\"{{ $json.message }}\"_\n\n*Current Lead Score:* {{ $json.opportunityScore }} {{ $json.leadTemperature }}\n\n*Recommended Response:*\n⚔️ Emphasize unique differentiators\n📊 Share competitive comparison docs\n🎯 Address specific competitor weaknesses",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#sales-competitors"
        },
        "otherOptions": {
          "mrkdwn": true
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "fqQEQ6t5FN8BPrTs",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6ddcb61a-dc4d-4585-b0e2-e7c62eba7b3f",
      "name": "Slack: Lead Calificado",
      "type": "n8n-nodes-base.slack",
      "position": [
        1240,
        20
      ],
      "webhookId": "dfb87f01-c527-42dc-9d4c-296f83211373",
      "parameters": {
        "text": "=📈 *Qualified Lead Update*\n\n*Lead:* {{ $json.userName }}\n*Score:* {{ $json.opportunityScore }} {{ $json.leadTemperature }}\n\n*Latest Message:* _\"{{ $json.message }}\"_\n\n*Buying Signals:*\n{{ $json.detectedSignals.filter(s => !s.includes('❌') && !s.includes('💸') && !s.includes('⏸️') && !s.includes('🔍')).join('\\n') || 'None detected' }}\n\n*Next Steps:*\n{{ $json.recommendedActions.slice(0, 3).join('\\n') }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#sales-qualified"
        },
        "otherOptions": {
          "mrkdwn": true
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "fqQEQ6t5FN8BPrTs",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9efb26ba-abeb-48e3-ad95-e7a14c32ee34",
      "name": "Procesar Resumen de Llamada",
      "type": "n8n-nodes-base.code",
      "position": [
        720,
        20
      ],
      "parameters": {
        "jsCode": "// Process end-of-call summary with final scoring\nconst callData = $input.first().json.body;\nconst messages = callData.messages || [];\n\n// Aggregate scoring across entire conversation\nlet totalScore = 0;\nconst allSignals = new Set();\nconst competitorMentions = new Set();\nlet maxDealValue = 0;\nlet userMessageCount = 0;\n\n// Process each message\nmessages.forEach(msg => {\n  if (msg.sender === 'user') {\n    userMessageCount++;\n    const msgLower = msg.message.toLowerCase();\n    \n    // Check buying signals\n    const buyingKeywords = [\n      { keyword: 'interested', score: 15 },\n      { keyword: 'budget', score: 15 },\n      { keyword: 'timeline', score: 20 },\n      { keyword: 'demo', score: 25 },\n      { keyword: 'trial', score: 25 },\n      { keyword: 'purchase', score: 30 },\n      { keyword: 'implement', score: 30 },\n      { keyword: 'decision maker', score: 25 },\n      { keyword: 'our team', score: 20 }\n    ];\n    \n    buyingKeywords.forEach(item => {\n      if (msgLower.includes(item.keyword)) {\n        totalScore += item.score;\n        allSignals.add(`✅ ${item.keyword}`);\n      }\n    });\n    \n    // Check negative signals\n    const negativeKeywords = [\n      { keyword: 'not interested', score: -30 },\n      { keyword: 'too expensive', score: -25 },\n      { keyword: 'maybe later', score: -15 },\n      { keyword: 'just looking', score: -10 }\n    ];\n    \n    negativeKeywords.forEach(item => {\n      if (msgLower.includes(item.keyword)) {\n        totalScore += item.score;\n        allSignals.add(`❌ ${item.keyword}`);\n      }\n    });\n    \n    // Check competitors\n    const competitors = ['competitor', 'alternative', 'versus', 'comparing'];\n    competitors.forEach(comp => {\n      if (msgLower.includes(comp)) {\n        competitorMentions.add(comp);\n      }\n    });\n  }\n});\n\n// Calculate final metrics\nconst avgMessageScore = userMessageCount > 0 ? totalScore / userMessageCount : 0;\nconst qualificationLevel = \n  totalScore >= 100 ? '🏆 Highly Qualified' :\n  totalScore >= 50 ? '✅ Qualified' :\n  totalScore >= 20 ? '🤔 Needs Nurturing' :\n  '❄️ Not Qualified';\n\nreturn [{\n  json: {\n    callId: callData.call_id,\n    userName: callData.call_data.userName,\n    duration: callData.evaluation?.duration_minutes || 0,\n    totalMessages: messages.length,\n    userMessages: userMessageCount,\n    finalScore: totalScore,\n    averageScore: avgMessageScore.toFixed(1),\n    qualificationLevel: qualificationLevel,\n    uniqueSignals: Array.from(allSignals),\n    competitorsMentioned: Array.from(competitorMentions),\n    callSummary: {\n      topic: callData.evaluation?.topic || 'General Discussion',\n      sentiment: callData.evaluation?.user_sentiment || 'neutral',\n      endTime: callData.call_data.endedAt\n    },\n    recommendations: generateFinalRecommendations(totalScore, allSignals),\n    nextBestAction: totalScore >= 50 ? '📞 Call within 24 hours' : '📧 Add to nurture campaign'\n  }\n}];\n\nfunction generateFinalRecommendations(score, signals) {\n  const recs = [];\n  if (score >= 100) {\n    recs.push('🎯 Fast-track to sales manager');\n    recs.push('📄 Prepare contract immediately');\n    recs.push('💰 Custom pricing proposal needed');\n  } else if (score >= 50) {\n    recs.push('📧 Send personalized follow-up within 2 hours');\n    recs.push('📅 Schedule next meeting this week');\n    recs.push('📊 Prepare ROI calculation');\n  } else {\n    recs.push('🌱 Add to nurture campaign');\n    recs.push('📚 Send educational content');\n    recs.push('⏰ Check back in 30 days');\n  }\n  return recs;\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "86d700e6-027d-4771-b749-30ad2573bd34",
      "name": "Slack: Resumen de Llamada",
      "type": "n8n-nodes-base.slack",
      "position": [
        920,
        20
      ],
      "webhookId": "4efa4f35-14aa-4d1a-9d60-f7eff1f3c4f6",
      "parameters": {
        "text": "=📊 *Call Summary Report*\n\n*Lead:* {{ $json.userName }}\n*Call Duration:* {{ $json.duration }} minutes\n*Messages:* {{ $json.userMessages }} from user / {{ $json.totalMessages }} total\n\n*Final Qualification:* {{ $json.qualificationLevel }}\n*Total Score:* {{ $json.finalScore }} (Avg: {{ $json.averageScore }}/message)\n\n*Key Signals Detected:*\n{{ $json.uniqueSignals.join('\\n') || 'No strong signals detected' }}\n\n*Competitors Mentioned:* {{ $json.competitorsMentioned.length > 0 ? $json.competitorsMentioned.join(', ') : 'None' }}\n\n*Next Best Action:* {{ $json.nextBestAction }}\n\n*Recommendations:*\n{{ $json.recommendations.join('\\n') }}\n\n---\n_Call ID: `{{ $json.callId }}` | Ended: {{ $json.callSummary.endTime }}_",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#sales-summaries"
        },
        "otherOptions": {
          "mrkdwn": true
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "fqQEQ6t5FN8BPrTs",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "786595a2-20fc-4948-89da-918fc08d6b1d",
      "name": "Instrucciones de Configuración",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1500,
        -500
      ],
      "parameters": {
        "width": 340,
        "height": 540,
        "content": "## 🔧 Configuration Steps\n\n**1. Slack OAuth2 Setup:**\n- Go to Credentials → New\n- Select \"Slack OAuth2 API\"\n- Follow OAuth flow\n- Grant channel write permissions\n\n**2. Update Channel Names:**\n- Hot Leads \n- Competitors \n- Qualified\n- Summaries\n\n**3. Customize Competitors:**\n- Edit \"Score Sales Opportunity\"\n- Add your competitor names\n- Adjust scoring weights\n\n**4. Test Webhook:**\n- Use webhook test URL\n- Send sample user message"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {
    "BeyondPresence Real-Time Webhook": [
      {
        "json": {
          "body": {
            "call_id": "BZ0MTsPQUOJngw4k5Txg",
            "message": {
              "sender": "user",
              "message": "I want to know about weather",
              "sent_at": "2025-05-28T10:26:32.104000+00:00"
            },
            "call_data": {
              "agentId": "1c540d63-8044-4e87-9fc1-e713abb60944",
              "userName": "Shehroz Sajjad"
            },
            "event_type": "message"
          },
          "query": {},
          "params": {},
          "headers": {
            "host": "bey-test.app.n8n.cloud",
            "accept": "*/*",
            "cf-ray": "946d0def44f1bb74-FRA",
            "cdn-loop": "cloudflare; loops=1; subreqs=1",
            "cf-ew-via": "15",
            "cf-worker": "n8n.cloud",
            "x-real-ip": "2600:1900:0:3401::e00",
            "cf-visitor": "{\"scheme\":\"https\"}",
            "user-agent": "python-requests/2.31.0",
            "cf-ipcountry": "US",
            "content-type": "application/json",
            "x-is-trusted": "yes",
            "content-length": "277",
            "accept-encoding": "gzip, br",
            "x-forwarded-for": "2600:1900:0:3401::e00, 172.70.246.133",
            "cf-connecting-ip": "2600:1900:0:3401::e00",
            "x-forwarded-host": "bey-test.app.n8n.cloud",
            "x-forwarded-port": "443",
            "x-forwarded-proto": "https",
            "x-forwarded-server": "traefik-prod-users-gwc-72-585f59b6c7-zdqd9"
          },
          "webhookUrl": "https://bey-test.app.n8n.cloud/webhook/beyondpresence-sales-intelligence",
          "executionMode": "production"
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a83151b3-1111-41e2-a9f9-b8680f2dd64f",
  "connections": {
    "88281417-5a4a-414d-9c8f-295ac1b3aeaa": {
      "main": [
        [
          {
            "node": "0f6ed4eb-c8d4-4c1e-8c03-991d887c83f9",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "35d57ba3-432e-444a-bde4-b6bc5a340ee7",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "6ddcb61a-dc4d-4585-b0e2-e7c62eba7b3f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f94cb19d-0bca-4f42-8f25-11cc853f3323": {
      "main": [
        [
          {
            "node": "9dae992f-6930-4db1-9c18-b85deaa352df",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9dae992f-6930-4db1-9c18-b85deaa352df": {
      "main": [
        [
          {
            "node": "c7cc875b-4282-4197-9d56-879a287fe385",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "9efb26ba-abeb-48e3-ad95-e7a14c32ee34": {
      "main": [
        [
          {
            "node": "86d700e6-027d-4771-b749-30ad2573bd34",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c7cc875b-4282-4197-9d56-879a287fe385": {
      "main": [
        [
          {
            "node": "88281417-5a4a-414d-9c8f-295ac1b3aeaa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BeyondPresence en Tiempo Real Webhook": {
      "main": [
        [
          {
            "node": "f94cb19d-0bca-4f42-8f25-11cc853f3323",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Intermedio - Ventas, Inteligencia Artificial

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Intermedio
Número de nodos14
Categoría2
Tipos de nodos6
Descripción de la dificultad

Adecuado para usuarios con experiencia intermedia, flujos de trabajo de complejidad media con 6-15 nodos

Autor
M Shehroz Sajjad

M Shehroz Sajjad

@mshehrozsajjad

🚀 BeyondPresence Integration Specialist | n8n Expert Building the future of conversational AI automation. Creator of the BeyondPresence template collection for n8n, enabling real-time conversation intelligence, automated insights, and seamless business system integration. Specialties: Video agent automation, real-time webhooks, AI analysis, conversation intelligence

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34