Skip to main content
Glama

Uazapi WhatsApp MCP Server

by pabloweyne
workflow-lembretes.json4.59 kB
{ "name": "UAZAPI Lembretes - Cron", "nodes": [ { "parameters": { "rule": { "interval": [{ "field": "minutes", "minutesInterval": 1 }] } }, "id": "cron", "name": "A cada minuto", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [240, 300] }, { "parameters": { "operation": "get", "key": "uazapi:lembretes" }, "id": "redis-get", "name": "Buscar Lembretes", "type": "n8n-nodes-base.redis", "typeVersion": 1, "position": [460, 300], "credentials": { "redis": { "id": "REDIS_CREDENTIAL_ID", "name": "Redis" } } }, { "parameters": { "jsCode": "const now = new Date();\nlet lembretes = [];\ntry {\n const data = $input.first().json;\n if (data?.value) lembretes = JSON.parse(data.value);\n else if (Array.isArray(data)) lembretes = data;\n} catch (e) { return []; }\n\nconst toSend = [];\nconst toKeep = [];\n\nlembretes.forEach(l => {\n if (!l || l.status === 'enviado') return;\n try {\n const dt = new Date(l.data_hora);\n if (dt <= now) toSend.push({ ...l, status: 'enviando' });\n else toKeep.push(l);\n } catch (e) { toKeep.push(l); }\n});\n\nif (toSend.length === 0) return [];\n\nreturn toSend.map(l => ({ json: { ...l, toKeep, toKeepJson: JSON.stringify(toKeep) } }));" }, "id": "filter", "name": "Filtrar Prontos", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [680, 300] }, { "parameters": { "operation": "get", "key": "uazapi:config" }, "id": "redis-config", "name": "Config", "type": "n8n-nodes-base.redis", "typeVersion": 1, "position": [900, 300], "credentials": { "redis": { "id": "REDIS_CREDENTIAL_ID", "name": "Redis" } } }, { "parameters": { "jsCode": "const lembrete = $('Filtrar Prontos').first().json;\nlet config = { telegram_chat_id: '', admin_phone: '' };\ntry { config = { ...config, ...JSON.parse($input.first().json?.value || '{}') }; } catch(e) {}\nreturn { json: { ...lembrete, config } };" }, "id": "prepare", "name": "Preparar", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [1120, 300] }, { "parameters": { "method": "POST", "url": "=https://api.telegram.org/bot{{ $env.TELEGRAM_BOT_TOKEN }}/sendMessage", "sendBody": true, "specifyBody": "json", "jsonBody": "={ \"chat_id\": \"{{ $json.config.telegram_chat_id }}\", \"text\": \"🔔 LEMBRETE:\\n\\n{{ $json.texto }}\\n\\n⏰ {{ new Date().toLocaleString('pt-BR') }}\" }" }, "id": "telegram", "name": "Telegram", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [1340, 240] }, { "parameters": { "method": "POST", "url": "=https://api.uazapi.com/instances/{{ $env.UAZAPI_INSTANCE_ID }}/messages/send/text", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "specifyBody": "json", "jsonBody": "={ \"phone\": \"{{ $json.numero || $env.ADMIN_PHONE }}\", \"message\": \"🔔 LEMBRETE:\\n\\n{{ $json.texto }}\" }" }, "id": "whatsapp", "name": "WhatsApp", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [1340, 360], "credentials": { "httpHeaderAuth": { "id": "UAZAPI_CREDENTIAL_ID", "name": "UAZAPI Auth" } } }, { "parameters": { "operation": "set", "key": "uazapi:lembretes", "value": "={{ $('Filtrar Prontos').first().json.toKeepJson }}" }, "id": "redis-update", "name": "Atualizar Lista", "type": "n8n-nodes-base.redis", "typeVersion": 1, "position": [1560, 300], "credentials": { "redis": { "id": "REDIS_CREDENTIAL_ID", "name": "Redis" } } } ], "connections": { "A cada minuto": { "main": [[{ "node": "Buscar Lembretes", "type": "main", "index": 0 }]] }, "Buscar Lembretes": { "main": [[{ "node": "Filtrar Prontos", "type": "main", "index": 0 }]] }, "Filtrar Prontos": { "main": [[{ "node": "Config", "type": "main", "index": 0 }]] }, "Config": { "main": [[{ "node": "Preparar", "type": "main", "index": 0 }]] }, "Preparar": { "main": [[{ "node": "Telegram", "type": "main", "index": 0 }, { "node": "WhatsApp", "type": "main", "index": 0 }]] }, "Telegram": { "main": [[{ "node": "Atualizar Lista", "type": "main", "index": 0 }]] }, "WhatsApp": { "main": [[]] } }, "settings": { "executionOrder": "v1" } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pabloweyne/uazapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server