PIPEDRIVE_ORGANIZATION_UPDATE - Atualizar Organização no Pipedrive
O que é este Node?
O PIPEDRIVE_ORGANIZATION_UPDATE é o node responsável por atualizar informações de uma organização existente no Pipedrive CRM.
Por que este Node existe?
Dados de empresas mudam ao longo do tempo. O PIPEDRIVE_ORGANIZATION_UPDATE existe para:
- Manter Dados Atualizados: Atualizar informações da empresa
- Correções: Corrigir dados incorretos
- Enriquecimento: Adicionar novos dados
- Gestão: Reatribuir responsável pela conta
Como funciona internamente?
Quando o PIPEDRIVE_ORGANIZATION_UPDATE é executado, o sistema:
- Recebe ID e dados: Coleta ID e campos a atualizar
- Processa variáveis: Substitui variáveis
- Faz requisição PUT: Envia para
/api/v1/organizations/{id} - Retorna atualizado: Dados atualizados da organização
Código interno (pipedrive.executor.ts:72-76):
else if (operation === 'update') {
const orgId = this.replaceVariables(node.data.organizationId, context.variables);
const org = JSON.parse(this.replaceVariables(JSON.stringify(node.data.organization), context.variables));
const response = await axios.put(`${endpoint}/${orgId}?${authParam}`, org, { headers });
result = response.data;
}
Quando você DEVE usar este Node?
Use PIPEDRIVE_ORGANIZATION_UPDATE quando precisar modificar organização existente:
Casos de uso
- Atualizar endereço: Empresa mudou de endereço
- Correção de dados: Nome ou informações incorretas
- Reatribuir responsável: Mudar vendedor da conta
Parâmetros
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| resource | string | Sim | Deve ser "organizations" |
| operation | string | Sim | Deve ser "update" |
| organizationId | string/number | Sim | ID da organização |
| organization | object | Sim | Campos a atualizar |
Exemplo: Atualizar Endereço
{
"name": "Pipedrive - Atualizar Endereço",
"nodes": [
{
"id": "start_1",
"type": "start",
"position": { "x": 100, "y": 100 },
"data": { "label": "Início" }
},
{
"id": "input_1",
"type": "input",
"position": { "x": 300, "y": 100 },
"data": {
"label": "ID",
"parameters": {
"message": "ID da organização:",
"variableName": "org_id"
}
}
},
{
"id": "input_2",
"type": "input",
"position": { "x": 500, "y": 100 },
"data": {
"label": "Novo Endereço",
"parameters": {
"message": "Novo endereço:",
"variableName": "new_address"
}
}
},
{
"id": "pipedrive_1",
"type": "pipedrive",
"position": { "x": 700, "y": 100 },
"data": {
"label": "Atualizar",
"resource": "organizations",
"operation": "update",
"config": {
"apiToken": "{{pipedrive_token}}",
"companyDomain": "sua-empresa"
},
"organizationId": "{{org_id}}",
"organization": {
"address": "{{new_address}}"
}
}
},
{
"id": "message_1",
"type": "message",
"position": { "x": 900, "y": 100 },
"data": {
"label": "Sucesso",
"parameters": {
"message": "✅ Endereço atualizado!"
}
}
},
{
"id": "end_1",
"type": "end",
"position": { "x": 1100, "y": 100 },
"data": { "label": "Fim" }
}
],
"edges": [
{ "source": "start_1", "target": "input_1" },
{ "source": "input_1", "target": "input_2" },
{ "source": "input_2", "target": "pipedrive_1" },
{ "source": "pipedrive_1", "target": "message_1" },
{ "source": "message_1", "target": "end_1" }
]
}
Boas Práticas
✅ SIM: - Use GET antes de atualizar - Envie apenas campos modificados - Valide existência antes
❌ NÃO: - Atualizar sem verificar - Sobrescrever todos os dados
Próximos Nodes
→ PIPEDRIVE_ORGANIZATION_GET - Buscar organização → PIPEDRIVE_ORGANIZATION_CREATE - Criar organização