# Injecting Messages on a specific node for building approval workflows

**URL:** <https://discourse.nodered.org/t/injecting-messages-on-a-specific-node-for-building-approval-workflows/32640>\
**Category:** General\
**Created:** [9 September 2020 11:49 UTC](https://discourse.nodered.org/t/injecting-messages-on-a-specific-node-for-building-approval-workflows/32640 "2020-09-09T11:49:30Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [10 September 2020 08:45 UTC](https://discourse.nodered.org/t/injecting-messages-on-a-specific-node-for-building-approval-workflows/32640/12 "2020-09-10T08:45:19Z")

</div>

Here's another way to do it using a subflow.

1. Create a subflow to encapsulate the 'getting approval' process.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5a5a57772bde06d9301ef724d7e118a7ee4a7fd4.png)  
The subflow includes an HTTP-In node that sets its url dynamically using a Subflow property - APPROVAL\_URL.  
I've given the subflow two outputs - one for approved, one for denied - but of course you could do that however you wanted.
2. In the Subflow properties, defined two properties:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/e/0e4e5ab3010ef19ce66f5922d5db63d3f9a919ee.png)  
`APPROVAL_URL` is the property used in the HTTP In node. For convenience, this property is derived from another property - APPROVAL\_ID. And I have configured the UI for the APPROVAL\_URL property to be hidden.
3. Then, you can add an instance of this subflow wherever you want:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b217c5e0e46be3bfb52930a2c8754e77ec678e6.png)  
And when you edit its properties, you can set an identifier for the approval (ie the APPROVAL\_ID property defined above:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e9b7c343de54f958c306fd0a524f3ecd4e155d04.png)  
In this instance, that would cause the HTTP node to listen on `/approval/go-fishing`

You'd just need to make sure the APPROVAL\_URL property is passed as part of the approval request so the response comes back to the right place.

---

_[View the full topic](https://discourse.nodered.org/t/injecting-messages-on-a-specific-node-for-building-approval-workflows/32640)._
