AutomationFlowsData & Sheets › Mainworkflow

Mainworkflow

MainWorkflow. Uses httpRequest, mySql, emailSend. Scheduled trigger; 8 nodes.

Cron / scheduled trigger★★★★☆ complexity8 nodesHTTP RequestMySQLEmail Send
Data & Sheets Trigger: Cron / scheduled Nodes: 8 Complexity: ★★★★☆ Added:

This workflow follows the Emailsend → HTTP Request 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 →

Download .json
{
  "name": "MainWorkflow",
  "nodes": [
    {
      "parameters": {
        "url": "=https://data.xotelo.com/api/rates?hotel_key={{$json.xotelo_hotel_key}}&chk_in={{new Date().toISOString().slice(0, 10)}}&chk_out={{new Date(Date.now() + 86400000).toISOString().slice(0, 10)}}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        0
      ],
      "id": "d7fe6e9f-b6d0-47b9-ab2f-bee916c730ab",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT * FROM hotels WHERE id != 1;",
        "options": {}
      },
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.4,
      "position": [
        220,
        0
      ],
      "id": "064a0f02-203f-4953-92ab-ba79119b4f63",
      "name": "Get Hotels",
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT email FROM users WHERE id = {{ $('Get Wishlists').item.json.user_id }};",
        "options": {}
      },
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.4,
      "position": [
        1300,
        0
      ],
      "id": "49e45592-b19b-401e-a110-64ebfb8b1968",
      "name": "Get Users",
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "fromEmail": "fortnitenotifier.moguism@gmail.com",
        "toEmail": "={{ $('Get Users').item.json.email }}",
        "subject": "Hay hoteles con descuento :D",
        "html": "=<p>Buenos d\u00edas, el siguiente hotel tiene un descuento, tal y como solicitaste:</p>\n<ul>\n<li><strong>{{ $('Get Hotels').item.json.name }}</strong>: {{ $('HTTP Request').item.json.result.rates[0].rate }}\u20ac</li>\n</ul>",
        "options": {}
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1540,
        0
      ],
      "id": "bf064405-b50e-47fb-a4c6-142a1e84b23e",
      "name": "Send Email",
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT id FROM hotel_services WHERE service_id = 1 AND hotel_id = {{ $('Get Hotels').item.json.id }};",
        "options": {}
      },
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.4,
      "position": [
        640,
        0
      ],
      "id": "05976cdb-7085-4195-b726-dbb8bf0ea3bb",
      "name": "Get Hotel Services",
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "table": {
          "__rl": true,
          "value": "date_prices",
          "mode": "list",
          "cachedResultName": "date_prices"
        },
        "dataMode": "defineBelow",
        "valuesToSend": {
          "values": [
            {
              "column": "price",
              "value": "={{ $('HTTP Request').item.json.result.rates[0].rate}}"
            },
            {
              "column": "date",
              "value": "={{ $('HTTP Request').item.json.result.chk_in }}"
            },
            {
              "column": "hotel_service_id",
              "value": "={{ $('Get Hotel Services').item.json.id }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.4,
      "position": [
        840,
        -160
      ],
      "id": "f902f01a-d576-4175-a204-833402bec603",
      "name": "Insert Date Prices",
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT * FROM wishlists WHERE desired_price > '{{ $('HTTP Request').item.json.result.rates[0].rate }}' AND hotel_service_id IN (SELECT id FROM hotel_services WHERE hotel_id IN (SELECT id FROM hotels WHERE xotelo_hotel_key = '{{ $('Get Hotels').item.json.xotelo_hotel_key }}'));",
        "options": {}
      },
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.4,
      "position": [
        1060,
        0
      ],
      "id": "600bcb40-2594-4acd-b1bb-316ddd1a39db",
      "name": "Get Wishlists",
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        20,
        0
      ],
      "id": "2402f1cb-aa33-4f11-a9f4-d20ba1858b14",
      "name": "Schedule Trigger"
    }
  ],
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Get Hotel Services",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Hotels": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Users": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email": {
      "main": [
        []
      ]
    },
    "Get Hotel Services": {
      "main": [
        [
          {
            "node": "Insert Date Prices",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Wishlists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Date Prices": {
      "main": [
        []
      ]
    },
    "Get Wishlists": {
      "main": [
        [
          {
            "node": "Get Users",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Hotels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6dde4c48-b2f9-4c64-955d-a79e0e9d2a2d",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "tTD1yIkmNVpuoHAU",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

MainWorkflow. Uses httpRequest, mySql, emailSend. Scheduled trigger; 8 nodes.

Source: https://github.com/moguism/hoteles-autobot/blob/98ebcdcb7f589b4a0848c22eabcea98ef1d772ca/n8n-workflows/MainWorkflow.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

Disparador 1.8. Uses itemLists, postgres, emailSend, httpRequest. Scheduled trigger; 85 nodes.

Item Lists, Postgres, Email Send +1
Data & Sheets

This n8n workflow runs daily to analyze active customer behavior, engineers relevant features from usage and transaction data, applies a machine learning or AI-based model to predict churn probability

HTTP Request, Postgres, Email Send
Data & Sheets

This n8n workflow automates continuous compliance monitoring across IT, OT, and cloud environments by aggregating security controls, validating policies (ISO 27001, NIST, GDPR, SOC2), detecting anomal

HTTP Request, Postgres, Email Send
Data & Sheets

Automates real-time market monitoring, technical analysis, AI-powered signal generation for cryptocurrencies (and stocks), filters high-confidence trades, and delivers actionable alerts via multiple c

HTTP Request, Postgres, Email Send
Data & Sheets

This scheduled workflow reads your Supabase project’s live schema, uses Anthropic Claude to plan safe PostgREST queries from a plain-English requirement, computes the requested metrics, and sends a da

HTTP Request, Email Send