AutomationMart
Home/Browse/IOT device control with MQTT and webhook
n8n

IOT device control with MQTT and webhook

n8nn8n3 modulesv1.0

IOT device control with MQTT and webhook This workflow is for users wanting a practical example of how to control IOT systems using the MQTT protocol in an an n8n environment. The template provides typical n8n MQTT and Webhook node implementation and configuration settings necessary to set IOT device inputs and outputs. How it works A webpage with IOT control 'on and 'off' buttons is presented to the user. When a button is selected on the webpage the value is sent via a webhook to trigger the ac

At a glance

IOT device control with MQTT and webhook is a ready-made n8n workflow you import as a workflow JSON file — no build required. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Modules
3
Price
Free
Version
v1.0
IOT device control with MQTT and webhook workflow diagram

About this workflow

IOT device control with MQTT and webhook This workflow is for users wanting a practical example of how to control IOT systems using the MQTT protocol in an an n8n environment. The template provides typical n8n MQTT and Webhook node implementation and configuration settings necessary to set IOT device inputs and outputs. How it works A webpage with IOT control 'on and 'off' buttons is presented to the user. When a button is selected on the webpage the value is sent via a webhook to trigger the active workflow. The workflow set node then prepares the received value into a message payload. It then passes the message to the MQTT node for publishing the topic with the payload to a cloud based MQTT broker. A remote ESP32 micro-controller subscribes to the broker and reads the payload contained in the topic. The ESP32 will then toggle the GPIO pin depending on the topic payload value. The IOT control webpage The webpage is a simple HTML page containing the clickable 'on' and 'off' buttons. It also has the get webhook URL that sends the selected value to the n8n workflow in this case running locally. The URL webhook format is The webpage code IOT-control.html IOT device The IOT device is an ESP32 micro-controller running on a remote network. To keep it simple GPIO2 is selected as the control output. In this case when the received value is "on" GPIO2 goes high a led will turn on in the ESP32. It will go off when the received value is "off". The program for the ESP32 IOT control is 'main.py' . You will require a micropython interpreter to be uploaded to the ESP32 for the program to run automatically. The code can be easily edited and modified to accommodate any further attached IOT devices. The ESP32 main.py code main.py How to customise this workflow to your needs ESP32 You will need a working ESP32 installed with a micro-python interpreter. The code main.py is provided. The main.py program can loaded and edited with a python IDE. I used Thonny for this example. Use a free MQTT broker to get started. I used "broker.emqx.io" in the code. IOT Control Webpage The webpage contains HTML and can be easily edit to enhance functionality. The embedded webhook is configured for n8n production mode. If you want to run the page in test mode you will use the following URL. n8n workflow. The workflow is a good demonstration of how to control IOT devices using n8n. Following these steps will give a good insight for microcontroller automation.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Manage Telegram task reminders with Claude and n8n data tables

Quick overview This workflow turns Telegram into a personal task manager by using Anthropic Claude to create, update, list, and delete tasks stored in an n8n Data Table, while also sending scheduled daily task summaries and automatically rolling forward overdue recurring tasks. How it works 1. Triggers when a new Telegram message arrives and checks whether the sender’s Telegram user ID is authorized. 2. If authorized, sends the message and conversation context to Anthropic Claude, which d

Free

Market research & business case generator with GPT-4o, Perplexity & Claude

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. 🧠 Market Research & Business Case Study Generator Category: AI + Research | GPT + Perplexity | Business Strategy Skill Level: Intermediate Use Case: Market Research, Business Planning, Strategic Analysis 📌 Description: This template automates the creation of comprehensive, data-backed business case studies—perfect for entrepreneurs, analysts, consultants, and market researchers. For more of

Free

GitHub automation hub: complete API controls for AI agents

Need help? Want access to this workflow + many more paid workflows + live Q&A sessions with a top verified n8n creator? Join the community Quick Setup Guide: 1️⃣ Import this template into your n8n instance. 2️⃣ Configure GitHub credentials for the nodes. 3️⃣ Connect your MCP client --------- THAT'S IT! ------- tl;dr Supercharge your GitHub project management and development by integrating powerful AI capabilities directly into your n8n workflows! This template deploys a robust SSE endpoint spec

Free

Generate and publish Instagram carousels with Gemini and Google Slides

Generate and publish Instagram carousels automatically Turn a single topic into a published Instagram Carousel in minutes. Creating educational carousel posts usually takes hours: writing the script, designing the slides in Figma/Canva, exporting images, and scheduling. This workflow automates the entire pipeline using Gemini AI, Google Slides, and the Meta Graph API. It generates the content, designs the visuals by manipulating a template, and publishes the carousel directly to your Instagram B

Free

Build your own N8N workflows MCP server

This n8n template shows you how to create an MCP server out of your existing n8n workflows. With this, any MCP client connected can get more done with powerful end-to-end workflows rather than just simple tools. Designing agent tools for outcome rather than utility has been a long recommended practice of mine and it applies well when it comes to building MCP servers; In gist, agents to be making the least amount of calls possible to complete a task. This is why n8n can be a great fit for M

Free

YouTube comment sentiment analysis with Google Gemini AI and Google Sheets

This workflow automatically collects all comments from a specified YouTube video and analyzes the sentiment of each comment using an AI model (e.g., GPT, Claude or Gemini). The sentiment (Positive, Neutral, or Negative), its strength, and confidence score are extracted and saved into a connected Google Sheet for easy access, reporting, and visualization. --- Advantages: 🧠 AI-Powered Sentiment Analysis Uses modern language models (LLMs) to categorize comments with high accuracy. 📺 Ideal for YouT

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free