# How to automatically trigger a node-red flow by external app using the API

**URL:** <https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703>\
**Category:** General\
**Tags:** node-red-dashboard\
**Created:** [19 April 2023 05:51 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703 "2023-04-19T05:51:16Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [19 April 2023 05:51 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/1 "2023-04-19T05:51:16Z")

</div>

how to automatically trigger a node-red flow by external app using the API

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [19 April 2023 06:17 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/2 "2023-04-19T06:17:35Z")

</div>

The external app can send to node red using HTTP, MQTT, Serial, UDP, TCP or web sockets. You could even use a Telegram bot. You will need to supply more info about your app and what protocols it can use.

---

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [19 April 2023 07:30 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/3 "2023-04-19T07:30:33Z")

</div>

it is [bubble.io](http://bubble.io) app please guide about http and mqtt how to create the flow

---

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [19 April 2023 07:33 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/4 "2023-04-19T07:33:41Z")

</div>

please give an example flow i can refer to

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 April 2023 08:06 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/5 "2023-04-19T08:06:22Z")

</div>

> [@nit-cyber](#):
>
> it is [bubble.io](http://bubble.io) app

Do you mean you want to send a signal from your [bubble.io](http://bubble.io) application to node-red?  
If so then where is [bubble.io](http://bubble.io) running and where is node-red running?  
You first need to decide which method you can use to send from bubble. Can it use MQTT? If so then that might be the easiest.

If you want to learn more about MQTT then see this tutorial [MQTT Essentials - All Core Concepts Explained](https://www.hivemq.com/mqtt-essentials/)

---

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [19 April 2023 08:46 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/6 "2023-04-19T08:46:17Z")

</div>

yes i want this bubble is running online and node-red on local host

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 April 2023 08:56 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/7 "2023-04-19T08:56:28Z")

</div>

So first you need to find what methods bubble supports from the suggestions from @E1cid earlier. Once you know which one you want to use then the node-red end is not difficult.

**[Edit]** Ideally you want to use a method that does not require opening up ports on your router. Using MQTT with a broker on an internet accessible server would be a good way.

---

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [19 April 2023 09:38 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/8 "2023-04-19T09:38:13Z")

</div>

please tell using http in and email trigger

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 April 2023 10:28 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/9 "2023-04-19T10:28:24Z")

</div>

Look in the node red cookbook for examples on using http. But, as I said, using that method would require opening ports on your router, so you would also have to look at this FAQ post for advice on how to safely access node-red over the internet.

> [@Safely accessing Node-RED over the Internet](https://discourse.nodered.org/t/safely-accessing-node-red-over-the-internet/45024):
>
> Update 2025-02-19 The best advice for most people doing home automation is still: Don't expose Node-RED to the outside world! Where you really have to have some outside access, keep it as hands-off and restricted as possible. For example, using a Telegram bot. Also keep it as minimal as possible, e.g. Don't expose the Editor - EVER! If you want to provide remote control of your heating or the precious plants in your greenhouse, provide explicit controls with strong limits. Don't expose ever…

What don't you understand about using the email node.

As a beginner, I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [21 April 2023 10:28 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/10 "2023-04-21T10:28:41Z")

</div>

please tell hove to receive email by gmail in node red i want to trigger by email

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 April 2023 15:02 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/11 "2023-04-21T15:02:07Z")

</div>

> [@nit-cyber](#):
>
> please tell hove to receive email by gmail in node red

I believe that you first have to setup your gmail account to allow that. If you search the forum for gmail I am sure you will find how to do it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 June 2023 15:03 UTC](https://discourse.nodered.org/t/how-to-automatically-trigger-a-node-red-flow-by-external-app-using-the-api/77703/12 "2023-06-20T15:03:05Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
