This workflow follows the HTTP Request → Postgres recipe pattern — see all workflows that pair these two integrations.
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": "n8n \u2014 Motor de Automatizaci\u00f3n Maestro (HUB)",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "entrada-pedidos-universal",
"responseMode": "responseNode"
},
"id": "webhook-entrada-hub",
"name": "Entrada Pedidos (Webhook)",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
240,
300
],
"notes": "Recibe pedidos de: WhatsApp, Kiosco, App/Web o POS"
},
{
"parameters": {
"jsCode": "// Normaliza los datos de entrada seg\u00fan el canal\nconst body = $input.first().json.body;\nconst canal = body.canal || 'DESCONOCIDO';\n\nreturn [{\n json: {\n pedido: {\n id: 'ORD-' + Date.now().toString().slice(-6),\n cliente: body.cliente || 'Sin Nombre',\n telefono: body.telefono || '',\n items: body.items || [],\n total: body.total || 0,\n canal: canal,\n metodoPago: body.metodoPago || 'PENDIENTE',\n notas: body.notas || ''\n }\n }\n}];"
},
"id": "normalizar-datos",
"name": "Normalizar Datos",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
460,
300
]
},
{
"parameters": {
"operation": "insert",
"table": "pedidos",
"columns": "numero, cliente_nombre, cliente_telefono, items, total, canal, estado",
"values": "={{ $json.pedido.id }}, {{ $json.pedido.cliente }}, {{ $json.pedido.telefono }}, {{ JSON.stringify($json.pedido.items) }}, {{ $json.pedido.total }}, {{ $json.pedido.canal }}, 'RECIBIDO'"
},
"id": "guardar-central",
"name": "Guardar en Base de Datos",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2,
"position": [
680,
300
]
},
{
"parameters": {},
"id": "split-processing",
"name": "Distribuir Pedido",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
900,
300
],
"notes": "Aqu\u00ed el flujo se divide en los 3 sistemas de procesamiento de la imagen"
},
{
"parameters": {
"method": "POST",
"url": "https://damion-duckier-kate.ngrok-free.dev/api/orders",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "ngrok-skip-browser-warning",
"value": "true"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "=",
"value": "={{ JSON.stringify($json.pedido) }}"
}
]
}
},
"id": "enviar-cocina-kds",
"name": "\ud83d\udfe2 Salida 1: Enviar a Mi PC (API)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
1120,
150
],
"notes": "Env\u00eda el pedido desde la nube (n8n) hasta tu PC local v\u00eda ngrok"
},
{
"parameters": {
"operation": "executeQuery",
"query": "SELECT descontar_inventario_por_pedido($1)"
},
"id": "procesar-inventario",
"name": "\ud83d\udd35 Salida 2: Inventario",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2,
"position": [
1120,
300
]
},
{
"parameters": {
"url": "{{ $env.POS_API_URL }}/facturar",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "=",
"value": "={{ JSON.stringify($json.pedido) }}"
}
]
}
},
"id": "enviar-facturacion",
"name": "\ud83d\udfe0 Salida 3: POS + Facturaci\u00f3n",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
1120,
450
]
},
{
"parameters": {
"url": "https://graph.facebook.com/v18.0/{{ $env.WHATSAPP_PHONE_NUMBER_ID }}/messages",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "=",
"value": "={{ JSON.stringify({ messaging_product: 'whatsapp', to: $json.pedido.telefono, type: 'text', text: { body: `\u2705 *Pedido Confirmado: ${$json.pedido.id}*\\nEstamos preparando tu orden. Te avisaremos cuando est\u00e9 lista.` } }) }}"
}
]
}
},
"id": "whatsapp-confirmacion",
"name": "\u26aa Salida: Confirmaci\u00f3n WhatsApp",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
1400,
200
]
},
{
"parameters": {
"url": "{{ $env.PRINTER_WEBHOOK_URL }}",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "=",
"value": "={{ JSON.stringify($json.pedido) }}"
}
]
}
},
"id": "ticket-comanda",
"name": "\u26aa Salida: Ticket / Comanda",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
1400,
400
]
}
],
"connections": {
"Entrada Pedidos (Webhook)": {
"main": [
[
{
"node": "Normalizar Datos",
"type": "main",
"index": 0
}
]
]
},
"Normalizar Datos": {
"main": [
[
{
"node": "Guardar en Base de Datos",
"type": "main",
"index": 0
}
]
]
},
"Guardar en Base de Datos": {
"main": [
[
{
"node": "Distribuir Pedido",
"type": "main",
"index": 0
}
]
]
},
"Distribuir Pedido": {
"main": [
[
{
"node": "enviar-cocina-kds",
"type": "main",
"index": 0
}
],
[
{
"node": "procesar-inventario",
"type": "main",
"index": 0
}
],
[
{
"node": "enviar-facturacion",
"type": "main",
"index": 0
}
]
]
},
"enviar-cocina-kds": {
"main": [
[
{
"node": "whatsapp-confirmacion",
"type": "main",
"index": 0
}
]
]
},
"procesar-inventario": {
"main": [
[
{
"node": "ticket-comanda",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
n8n — Motor de Automatización Maestro (HUB). Uses postgres, httpRequest. Webhook trigger; 9 nodes.
Source: https://github.com/Davisday13/PIKTA_SOFT_FACT/blob/a7037c21a0e5bf0fd7828a973b085d2ca53029ee/web/flujo_maestro_n8n.json — 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.
Scraping. Uses httpRequest, postgres, @apify/n8n-nodes-apify, respondToWebhook. Webhook trigger; 61 nodes.
Workflow B — AI Listing Engine. Uses httpRequest, postgres, errorTrigger. Webhook trigger; 47 nodes.
Fluxo de voluntárias ZendeskXANXBD. Uses functionItem, zendesk, httpRequest, postgres. Webhook trigger; 25 nodes.
Fluxo de voluntárias ZendeskXANXBD. Uses functionItem, zendesk, httpRequest, postgres. Webhook trigger; 25 nodes.
Fluxo de voluntárias ZendeskXANXBD. Uses functionItem, zendesk, httpRequest, postgres. Webhook trigger; 25 nodes.