Inapoi la Integrari
🔄

Make (Integromat) Integration

Conectează VAI Portal cu Make pentru scenarii complexe de automatizare, procesare vizuală a datelor și integrări multi-platformă.

Visual Scenarios

Creează fluxuri complexe cu interfață vizuală drag-and-drop.

Real-time Processing

Procesare instantanee a datelor cu trigger-e multiple.

Scheduled Automation

Rulează scenarii automate la intervale programate.

Advanced Filtering

Filtrează și transformă date cu funcții complexe.

Arhitectura Integrării

VAI Portal

Data Source

Make Platform

Visual Automation

Multiple Systems

API & Database

Webhooks & APIs

Template-uri de Scenarii

Lead Qualification

Medium

Califică lead-uri și le trimite către CRM-ul potrivit

Webhook
Router
Data Mapping
HTTP Request

Customer Onboarding

High

Proces complet de onboarding pentru clienți noi

Webhook
Iterator
Email
Calendar
Database

Support Ticket Flow

Medium

Management automat al tichetelor de suport

Webhook
Router
Slack
Email
Webhook

Data Backup

Low

Backup automat al conversațiilor și datelor importante

Scheduler
Iterator
Google Drive
Email

Cazuri de Utilizare

Lead Processing Pipeline

Procesează lead-uri din VAI prin multiple etape de calificare.


      VAI Agent → Lead Capture → Make Scenario → Multi-step Processing
           ↓              ↓              ↓
      Data Extract    Filter Logic    CRM Integration
    

Data Synchronization

Sincronizează date între VAI și sisteme terțe.


      VAI Portal → Data Export → Make Transform → External System
           ↓              ↓              ↓
      Real-time     Format Change    API Update
    

Report Generation

Generează rapoarte automate din datele conversațiilor.


      VAI Analytics → Data Collection → Make Processing → Report Delivery
           ↓              ↓              ↓
      Metrics Gather    Calculate     Email/Slack
    

Exemple de Implementare

Make Webhook Configuration

// Make Webhook Receiver Configuration
const express = require('express');
const crypto = require('crypto');
const app = express();
app.use(express.json());

// Verify Make webhook signature
function verifyMakeSignature(payload, signature, secret) {
  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(JSON.stringify(payload))
    .digest('hex');
  
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expectedSignature)
  );
}

// VAI to Make Webhook Endpoint
app.post('/webhooks/make', async (req, res) => {
  try {
    const signature = req.headers['x-make-signature'];
    const payload = req.body;
    
    // Verify webhook signature
    if (!verifyMakeSignature(payload, signature, process.env.MAKE_WEBHOOK_SECRET)) {
      return res.status(401).json({ error: 'Invalid signature' });
    }
    
    // Process VAI conversation data
    const processedData = await processVAIData(payload);
    
    // Send response back to Make
    res.json({
      status: 'success',
      processed_at: new Date().toISOString(),
      data: processedData
    });
    
  } catch (error) {
    console.error('Error processing Make webhook:', error);
    res.status(500).json({ error: 'Internal server error' });
  }
});

async function processVAIData(data) {
  const { conversation, agent, user } = data;
  
  // Extract key information
  const processedData = {
    conversation_id: conversation.id,
    agent_type: agent.type,
    user_email: user.email,
    timestamp: conversation.timestamp,
    sentiment: conversation.sentiment,
    intent: conversation.intent,
    entities: conversation.entities,
    summary: conversation.summary,
    priority: determinePriority(conversation),
    next_actions: extractNextActions(conversation),
    metadata: {
      duration: conversation.duration,
      message_count: conversation.messages.length,
      satisfaction_score: conversation.satisfaction || null
    }
  };
  
  // Enrich with additional data
  if (conversation.intent === 'purchase') {
    processedData.purchase_intent = extractPurchaseIntent(conversation);
  }
  
  if (conversation.sentiment === 'negative') {
    processedData.urgency = 'high';
    processedData.requires_followup = true;
  }
  
  return processedData;
}

function determinePriority(conversation) {
  const factors = {
    sentiment: conversation.sentiment === 'negative' ? 2 : 0,
    urgency: conversation.urgency === 'high' ? 2 : 0,
    purchase_intent: conversation.intent === 'purchase' ? 1 : 0,
    support_request: conversation.intent === 'support' ? 1 : 0
  };
  
  const score = Object.values(factors).reduce((sum, factor) => sum + factor, 0);
  
  if (score >= 3) return 'high';
  if (score >= 2) return 'medium';
  return 'low';
}

function extractNextActions(conversation) {
  const actions = [];
  
  if (conversation.intent === 'purchase') {
    actions.push({
      type: 'sales_followup',
      priority: 'high',
      deadline: new Date(Date.now() + 24 * 60 * 60 * 1000) // 24 hours
    });
  }
  
  if (conversation.sentiment === 'negative') {
    actions.push({
      type: 'support_escalation',
      priority: 'urgent',
      deadline: new Date(Date.now() + 2 * 60 * 60 * 1000) // 2 hours
    });
  }
  
  if (conversation.entities.includes('meeting_request')) {
    actions.push({
      type: 'schedule_meeting',
      priority: 'medium',
      deadline: new Date(Date.now() + 48 * 60 * 60 * 1000) // 48 hours
    });
  }
  
  return actions;
}

function extractPurchaseIntent(conversation) {
  const purchaseKeywords = ['buy', 'purchase', 'price', 'cost', 'quote', 'demo'];
  const messageText = conversation.messages.map(m => m.content).join(' ').toLowerCase();
  
  const foundKeywords = purchaseKeywords.filter(keyword => messageText.includes(keyword));
  
  return {
    detected: foundKeywords.length > 0,
    keywords: foundKeywords,
    confidence: Math.min(foundKeywords.length / purchaseKeywords.length, 1),
    estimated_value: conversation.entities.includes('budget') ? extractBudget(conversation) : null
  };
}

function extractBudget(conversation) {
  const budgetPattern = /$?(d+(?:,d{3})*(?:.d{2})?)/g;
  const matches = conversation.messages.map(m => m.content).join(' ').match(budgetPattern);
  
  if (matches && matches.length > 0) {
    return {
      amount: parseFloat(matches[0].replace(/,/g, '')),
      currency: 'USD',
      confidence: 0.8
    };
  }
  
  return null;
}

// Start server
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Make webhook server running on port ${PORT}`);
});

Make API Integration

// Make API Client for Scenario Management
const axios = require('axios');

class MakeAPIClient {
  constructor(apiKey, apiEndpoint = 'https://api.make.com') {
    this.apiKey = apiKey;
    this.apiEndpoint = apiEndpoint;
    this.client = axios.create({
      baseURL: this.apiEndpoint,
      headers: {
        'Authorization': `Bearer ${this.apiKey}`,
        'Content-Type': 'application/json'
      }
    });
  }

  // Create a new scenario
  async createScenario(scenarioData) {
    try {
      const response = await this.client.post('/v2/scenarios', scenarioData);
      return response.data;
    } catch (error) {
      console.error('Error creating scenario:', error.response?.data || error.message);
      throw error;
    }
  }

  // Trigger a scenario
  async triggerScenario(scenarioId, data = {}) {
    try {
      const response = await this.client.post(`/v2/scenarios/${scenarioId}/run`, data);
      return response.data;
    } catch (error) {
      console.error('Error triggering scenario:', error.response?.data || error.message);
      throw error;
    }
  }

  // Get scenario execution history
  async getExecutionHistory(scenarioId, limit = 10) {
    try {
      const response = await this.client.get(
        `/v2/scenarios/${scenarioId}/executions?limit=${limit}`
      );
      return response.data;
    } catch (error) {
      console.error('Error fetching execution history:', error.response?.data || error.message);
      throw error;
    }
  }

  // Create VAI Lead Processing Scenario
  async createVAILeadScenario() {
    const scenarioDefinition = {
      name: 'VAI Lead Processing Pipeline',
      description: 'Process leads from VAI Portal through qualification and CRM integration',
      team_id: process.env.MAKE_TEAM_ID,
      blueprint: {
        flow: [
          {
            id: 'webhook_trigger',
            module: 'webhook',
            config: {
              url: process.env.VAI_WEBHOOK_URL,
              response_code: 200,
              response_body: '{"status": "received"}'
            }
          },
          {
            id: 'parse_data',
            module: 'json',
            config: {
              operation: 'parse',
              source: '{{webhook_trigger.body}}'
            }
          },
          {
            id: 'determine_priority',
            module: 'router',
            config: {
              routes: [
                {
                  condition: '{{parse_data.priority}} === "high"',
                  destination: 'high_priority_flow'
                },
                {
                  condition: '{{parse_data.intent}} === "purchase"',
                  destination: 'sales_flow'
                },
                {
                  condition: 'true',
                  destination: 'standard_flow'
                }
              ]
            }
          },
          {
            id: 'high_priority_flow',
            module: 'iterator',
            config: {
              document_id: '{{parse_data.next_actions}}',
              field: 'actions'
            }
          },
          {
            id: 'send_slack_alert',
            module: 'slack',
            config: {
              webhook_url: process.env.SLACK_WEBHOOK_URL,
              message: {
                text: '🚨 High Priority Lead from VAI',
                blocks: [
                  {
                    type: 'section',
                    text: {
                      type: 'mrkdwn',
                      text: `*High Priority Lead Detected*

*Email:* {{parse_data.user_email}}
*Agent:* {{parse_data.agent_type}}
*Priority:* {{parse_data.priority}}
*Sentiment:* {{parse_data.sentiment}}`
                    }
                  }
                ]
              }
            }
          },
          {
            id: 'sales_flow',
            module: 'http',
            config: {
              url: process.env.SALESFORCE_API_URL,
              method: 'POST',
              headers: {
                'Authorization': `Bearer ${process.env.SALESFORCE_TOKEN}`,
                'Content-Type': 'application/json'
              },
              body: {
                firstName: '{{parse_data.user.first_name}}',
                lastName: '{{parse_data.user.last_name}}',
                email: '{{parse_data.user_email}}',
                leadSource: 'VAI Portal',
                description: '{{parse_data.summary}}',
                priority: 'High'
              }
            }
          },
          {
            id: 'standard_flow',
            module: 'google_sheets',
            config: {
              operation: 'append',
              spreadsheet_id: process.env.LEADS_SPREADSHEET_ID,
              range: 'A:Z',
              values: [
                [
                  '{{parse_data.timestamp}}',
                  '{{parse_data.user_email}}',
                  '{{parse_data.agent_type}}',
                  '{{parse_data.intent}}',
                  '{{parse_data.sentiment}}',
                  '{{parse_data.priority}}',
                  '{{parse_data.summary}}'
                ]
              ]
            }
          },
          {
            id: 'send_confirmation',
            module: 'email',
            config: {
              to: '{{parse_data.user_email}}',
              subject: 'Thank you for contacting VAI Portal',
              body: `Hi {{parse_data.user.first_name}},

Thank you for reaching out to us. We have received your message and will get back to you shortly.

Best regards,
VAI Portal Team`,
              from: process.env.FROM_EMAIL
            }
          }
        ],
        connections: [
          { source: 'webhook_trigger', target: 'parse_data' },
          { source: 'parse_data', target: 'determine_priority' },
          { source: 'determine_priority', target: 'high_priority_flow', condition: 0 },
          { source: 'determine_priority', target: 'sales_flow', condition: 1 },
          { source: 'determine_priority', target: 'standard_flow', condition: 2 },
          { source: 'high_priority_flow', target: 'send_slack_alert' },
          { source: 'sales_flow', target: 'send_confirmation' },
          { source: 'standard_flow', target: 'send_confirmation' }
        ]
      }
    };

    return await this.createScenario(scenarioDefinition);
  }

  // Schedule periodic data sync
  async scheduleDataSync(intervalMinutes = 60) {
    const syncScenario = {
      name: 'VAI Data Sync',
      description: 'Periodic synchronization of VAI data',
      schedule: {
        type: 'interval',
        interval: intervalMinutes,
        unit: 'minutes'
      },
      blueprint: {
        flow: [
          {
            id: 'fetch_vai_data',
            module: 'http',
            config: {
              url: process.env.VAI_API_URL + '/conversations',
              method: 'GET',
              headers: {
                'Authorization': `Bearer ${process.env.VAI_API_TOKEN}`
              }
            }
          },
          {
            id: 'process_data',
            module: 'iterator',
            config: {
              document_id: '{{fetch_vai_data.body}}',
              field: 'conversations'
            }
          },
          {
            id: 'update_database',
            module: 'mysql',
            config: {
              operation: 'insert',
              table: 'vai_conversations',
              fields: {
                conversation_id: '{{process_data.id}}',
                agent_type: '{{process_data.agent_type}}',
                user_email: '{{process_data.user_email}}',
                timestamp: '{{process_data.timestamp}}',
                sentiment: '{{process_data.sentiment}}',
                summary: '{{process_data.summary}}'
              }
            }
          }
        ],
        connections: [
          { source: 'fetch_vai_data', target: 'process_data' },
          { source: 'process_data', target: 'update_database' }
        ]
      }
    };

    return await this.createScenario(syncScenario);
  }
}

// Usage example
const makeClient = new MakeAPIClient(process.env.MAKE_API_KEY);

// Create VAI integration scenarios
async function setupVAIIntegration() {
  try {
    // Create lead processing scenario
    const leadScenario = await makeClient.createVAILeadScenario();
    console.log('Lead processing scenario created:', leadScenario.id);

    // Schedule data sync
    const syncScenario = await makeClient.scheduleDataSync(30); // Every 30 minutes
    console.log('Data sync scenario created:', syncScenario.id);

    return {
      leadScenario: leadScenario.id,
      syncScenario: syncScenario.id
    };
  } catch (error) {
    console.error('Error setting up VAI integration:', error);
    throw error;
  }
}

module.exports = { MakeAPIClient, setupVAIIntegration };

Ghid de Configurare

1

Creează Cont Make

Înregistrează-te și obține API key pentru integrare.

make.com → Account → API Keys
2

Configurează Webhook

Creează webhook endpoint în VAI pentru a trimite date către Make.

3

Design Scenariu

Creează scenariu vizual cu modulele necesare pentru procesarea datelor.

4

Testează și Activează

Verifică fluxul de date și activează scenariul pentru producție.

Beneficii

Automatizare Vizuală

Creează fluxuri complexe fără programare.

Integrări Multiple

Conectează sute de servicii și API-uri.

Procesare Real-time

Răspuns instant la evenimente VAI.

Scalabilitate

Procesează volume mari de date eficient.

Pregătit pentru Make?

Integrează VAI Portal cu Make pentru a crea scenarii complexe de automatizare și a-ți optimiza fluxurile de lucru.