Pular para conteúdo

MAILCHIMP Automations Start - Iniciar Automação

O que é este Node?

O Mailchimp Automations Start é o node responsável por reativar uma automação pausada, retomando o envio de emails automaticamente.

Por que este Node existe?

Reativar automações é essencial. Este node existe para:

  1. Retomar operação: Após manutenção ou ajustes
  2. Automação: Reativar baseado em horário/condições
  3. Sazonalidade: Iniciar em períodos específicos
  4. Recuperação: Reativar após resolver problemas
  5. Controle dinâmico: Gestão automatizada de status

Como funciona internamente?

Código interno (mailchimp.executor.ts:350-357):

case 'start':
  const startAutomationId = this.replaceVariables(data.automationId || '', context.variables);
  await axios.post(`${baseUrl}/automations/${startAutomationId}/actions/start-all-emails`, {}, {
    headers: {
      'Authorization': `Bearer ${apiKey}`,
    },
  });
  return { success: true, message: 'Automation started' };

O que acontece ao iniciar?

  • ✅ Automação volta a enviar emails
  • ✅ Novos gatilhos disparam normalmente
  • ✅ Assinantes na fila recebem emails
  • ⚠️ Emails atrasados serão enviados
  • ⚠️ Verifique conteúdo antes de reativar

Parâmetros

Campo Tipo Obrigatório Descrição
automationId string Sim ID da automação a iniciar

Exemplo: Reativar Automação Após Manutenção

{
  "name": "Reativar Automação Pós-Manutenção",
  "nodes": [
    {
      "id": "start_1",
      "type": "start",
      "position": { "x": 100, "y": 100 },
      "data": { "label": "Início - Manutenção Concluída" }
    },
    {
      "id": "mailchimp_get",
      "type": "mailchimp",
      "position": { "x": 300, "y": 100 },
      "data": {
        "label": "Verificar Status",
        "resource": "automations",
        "operation": "get",
        "config": {
          "apiKey": "{{mailchimp_api_key}}",
          "server": "{{mailchimp_server}}"
        },
        "automationId": "{{automation_id}}",
        "responseVariable": "automation"
      }
    },
    {
      "id": "condition_1",
      "type": "condition",
      "position": { "x": 500, "y": 100 },
      "data": {
        "label": "Está Pausada?",
        "parameters": {
          "condition": "{{automation.status}} == 'paused'"
        }
      }
    },
    {
      "id": "message_confirm",
      "type": "message",
      "position": { "x": 700, "y": 50 },
      "data": {
        "label": "Confirmar Reativação",
        "parameters": {
          "message": "🤖 Automação: {{automation.title}}\n📊 Status atual: Pausada\n📧 Emails na fila: (verificar)\n\n✅ Manutenção concluída?\n\nDigite SIM para reativar:"
        }
      }
    },
    {
      "id": "input_1",
      "type": "input",
      "position": { "x": 900, "y": 50 },
      "data": {
        "label": "Confirmação",
        "parameters": {
          "message": "Digite SIM:",
          "variable": "confirm"
        }
      }
    },
    {
      "id": "condition_2",
      "type": "condition",
      "position": { "x": 1100, "y": 50 },
      "data": {
        "label": "Confirmar?",
        "parameters": {
          "condition": "{{confirm}} == 'SIM'"
        }
      }
    },
    {
      "id": "mailchimp_start",
      "type": "mailchimp",
      "position": { "x": 1300, "y": 25 },
      "data": {
        "label": "Reativar",
        "resource": "automations",
        "operation": "start",
        "config": {
          "apiKey": "{{mailchimp_api_key}}",
          "server": "{{mailchimp_server}}"
        },
        "automationId": "{{automation_id}}",
        "responseVariable": "startResult"
      }
    },
    {
      "id": "message_started",
      "type": "message",
      "position": { "x": 1500, "y": 25 },
      "data": {
        "label": "Reativada",
        "parameters": {
          "message": "✅ AUTOMAÇÃO REATIVADA!\n\n🤖 {{automation.title}}\n📧 Emails voltarão a ser enviados automaticamente\n\n👥 Assinantes na fila receberão os emails pendentes"
        }
      }
    },
    {
      "id": "message_cancelled",
      "type": "message",
      "position": { "x": 1300, "y": 100 },
      "data": {
        "label": "Cancelado",
        "parameters": {
          "message": "❌ Reativação cancelada.\n\nAutomação permanece pausada."
        }
      }
    },
    {
      "id": "message_already_active",
      "type": "message",
      "position": { "x": 700, "y": 150 },
      "data": {
        "label": "Já Ativa",
        "parameters": {
          "message": "ℹ️ Automação já está ativa!\n\nStatus: {{automation.status}}"
        }
      }
    },
    {
      "id": "end_1",
      "type": "end",
      "position": { "x": 1700, "y": 75 },
      "data": { "label": "Fim" }
    }
  ],
  "edges": [
    { "source": "start_1", "target": "mailchimp_get" },
    { "source": "mailchimp_get", "target": "condition_1" },
    { "source": "condition_1", "target": "message_confirm", "label": "true" },
    { "source": "condition_1", "target": "message_already_active", "label": "false" },
    { "source": "message_confirm", "target": "input_1" },
    { "source": "input_1", "target": "condition_2" },
    { "source": "condition_2", "target": "mailchimp_start", "label": "true" },
    { "source": "condition_2", "target": "message_cancelled", "label": "false" },
    { "source": "mailchimp_start", "target": "message_started" },
    { "source": "message_started", "target": "end_1" },
    { "source": "message_cancelled", "target": "end_1" },
    { "source": "message_already_active", "target": "end_1" }
  ]
}

Exemplo 2: Reativar Automaticamente em Horário Comercial

{
  "name": "Auto-Reativar em Horário Comercial",
  "nodes": [
    {
      "id": "start_1",
      "type": "start",
      "position": { "x": 100, "y": 100 },
      "data": { "label": "Início - Cron 8h" }
    },
    {
      "id": "message_1",
      "type": "message",
      "position": { "x": 300, "y": 100 },
      "data": {
        "label": "Log",
        "parameters": {
          "message": "🌅 Horário comercial iniciado (8h)\n\nReativando automações..."
        }
      }
    },
    {
      "id": "mailchimp_1",
      "type": "mailchimp",
      "position": { "x": 500, "y": 100 },
      "data": {
        "label": "Reativar Automação",
        "resource": "automations",
        "operation": "start",
        "config": {
          "apiKey": "{{mailchimp_api_key}}",
          "server": "{{mailchimp_server}}"
        },
        "automationId": "{{business_hours_automation_id}}",
        "responseVariable": "result"
      }
    },
    {
      "id": "message_2",
      "type": "message",
      "position": { "x": 700, "y": 100 },
      "data": {
        "label": "Sucesso",
        "parameters": {
          "message": "✅ Automação reativada para horário comercial!\n\nEmails voltarão a ser enviados."
        }
      }
    },
    {
      "id": "end_1",
      "type": "end",
      "position": { "x": 900, "y": 100 },
      "data": { "label": "Fim" }
    }
  ],
  "edges": [
    { "source": "start_1", "target": "message_1" },
    { "source": "message_1", "target": "mailchimp_1" },
    { "source": "mailchimp_1", "target": "message_2" },
    { "source": "message_2", "target": "end_1" }
  ]
}

Resposta do Node

{
  "success": true,
  "message": "Automation started"
}

Checklist Antes de Reativar

  • [ ] Manutenção/ajustes foram concluídos?
  • [ ] Conteúdo dos emails está correto?
  • [ ] Testei as mudanças?
  • [ ] Horário é apropriado?
  • [ ] Lista de destinatários está correta?
  • [ ] Não há emails problemáticos na fila?

Boas Práticas

SIM: - Verifique status antes de reativar - Teste conteúdo após mudanças - Reative em horários apropriados - Documente motivo da reativação - Monitore após reativar

NÃO: - Não reative sem verificar mudanças - Não reative em horários ruins - Não esqueça de monitorar - Não reative se ainda há problemas

Casos de Uso

  1. Pós-Manutenção: Após ajustes concluídos
  2. Horário Comercial: Reativar às 8h automaticamente
  3. Sazonalidade: Reativar em datas específicas
  4. Recuperação: Após resolver problemas técnicos
  5. Testes: Reativar após validar mudanças

Próximos Passos

Automations Get - Verificar se reativou → Automations Pause - Pausar novamente se necessário → Automations List - Ver todas as automações