The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Validaci\u00f3n Factura Chedraui",
"nodes": [
{
"parameters": {
"path": "gmail-push/"
},
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
-600,
-300
]
},
{
"parameters": {
"jsCode": "const raw = $json.message?.data;\nconst decoded = Buffer.from(raw, 'base64').toString('utf8');\nconst parsed = JSON.parse(decoded);\nreturn [{ json: parsed }];"
},
"name": "Decodificar PubSub",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-400,
-300
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"name": "mensaje",
"value": "={{ $json.mensaje }}"
},
{
"name": "origen",
"value": "={{ $json.origen }}"
},
{
"name": "hora",
"value": "={{ $now }}"
}
]
}
},
"name": "Set Campos",
"type": "n8n-nodes-base.set",
"typeVersion": 3,
"position": [
-200,
-300
]
},
{
"parameters": {
"jsCode": "const excelBinario = items[0].binary['attachment_2'];\nreturn [{\n json: {\n nombre: excelBinario.fileName || \"archivo.xlsx\",\n tipo: excelBinario.mimeType || \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n tama\u00f1o: excelBinario.fileSize || 0\n },\n binary: {\n excel: excelBinario\n }\n}];"
},
"name": "Extraer Excel",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
0,
-300
]
},
{
"parameters": {
"conditions": {
"conditions": [
{
"leftValue": "={{$json.tipo}}",
"rightValue": "officedocument",
"operation": "contains"
}
]
}
},
"name": "Validar Excel",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
200,
-300
]
},
{
"parameters": {
"binaryPropertyName": "excel",
"options": {
"headerRow": true,
"rawData": true
}
},
"name": "Leer Excel",
"type": "n8n-nodes-base.spreadsheetFile",
"typeVersion": 1,
"position": [
400,
-300
]
},
{
"parameters": {
"jsCode": "const claves = [\"105\", \"99\", \"23\"];\nreturn items.filter(item => {\n const fila = item.json;\n const cadena = (fila[\"CADENA\"] || \"\").toLowerCase();\n const suc = String(fila[\"SUC\"] || \"\").toLowerCase();\n return cadena === \"chedraui\" && claves.some(clave => suc.includes(clave));\n});"
},
"name": "Filtrar Chedraui",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
600,
-300
]
},
{
"parameters": {
"method": "POST",
"url": "https://api.green-api.com/waInstance7105315523/sendMessage/eacedae1cb5e4b54bbf6872c2edc9d25ed885b44d4c24fdc8a",
"jsonHeaders": "{ \"Content-Type\": \"application/json\" }",
"jsonBody": "={\n \"chatId\": \"5219513044999@c.us\",\n \"message\": \"\ud83d\udce6 Validaci\u00f3n de factura:\\nCADENA: {{$json['CADENA']}}\\nSUC: {{$json['SUC']}}\\nTIENDA: {{$json['TIENDA']}}\\nFACTURA: {{$json['FACTURA']}}\"\n}"
},
"name": "Enviar WhatsApp",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
800,
-300
]
}
],
"connections": {
"Webhook": {
"main": [
[
"Decodificar PubSub"
]
]
},
"Decodificar PubSub": {
"main": [
[
"Set Campos"
]
]
},
"Set Campos": {
"main": [
[
"Extraer Excel"
]
]
},
"Extraer Excel": {
"main": [
[
"Validar Excel"
]
]
},
"Validar Excel": {
"main": [
[
"Leer Excel"
]
]
},
"Leer Excel": {
"main": [
[
"Filtrar Chedraui"
]
]
},
"Filtrar Chedraui": {
"main": [
[
"Enviar WhatsApp"
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Validación Factura Chedraui. Uses spreadsheetFile, httpRequest. Webhook trigger; 8 nodes.
Source: https://gist.github.com/jenerCruz/37e7e76c2902b4f572940aadf92d1379 — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
MyToys. Uses ftp, httpRequest, spreadsheetFile, executeCommand. Webhook trigger; 16 nodes.
[SANTOBET] FLUXO TODO - BACKUP. Uses googleSheets, httpRequest, googleSheetsTrigger. Webhook trigger; 57 nodes.
cdp_router. Uses gmailTrigger, telegramTrigger, googleSheets, httpRequest. Event-driven trigger; 53 nodes.
cdp_router. Uses gmailTrigger, telegramTrigger, googleSheets, httpRequest. Event-driven trigger; 53 nodes.
FLUXO DISPARO DATA E HORA. Uses itemLists, googleSheets, httpRequest. Webhook trigger; 48 nodes.