Hi there “Process Automation” fans,
Welcome to a new installment of “Process Automation” tips.
A long-lasting topic on my list of explorations. I can still remember the enthusiasm from the person (I won’t call by name) during a demo session with OpenText long, long time ago. It was just a chit-chat session about all kinds of stuff where that specific person also showed the group of people a tool named “Node-RED”. This person had a big smile, but the group didn’t see it, or didn’t understand it, or was just busy with other stuff (including me in that time!). Only, I never forgot about the tool, and it kept me curious; Until now…Let me spoiler-alert you that I now do know what this person was so enthusiastic about! It’s indeed greatness up ahead…
Let get right into it…
First of all, what on earth is “Node-RED”? Well, this is the quote from their own website:
1 | Node-RED is a programming tool for wiring together hardware devices, |
It’s interesting indeed! Who doesn’t want to wire (or better “orchestrate”) services all together for the greater outcome…Hopefully you now have the feeling where this (and next) post is going to. Indeed, watch and learn on how to orchestrate “Process Automation” services to further enhance your platform management.
For this post we do the installation part and a first exploration with basic “nodes”. Next week we’ll cover our beloved platform services; nicely via a solid OTDS authenticated connection. 💪
Now, start your “Process Automation” VM. I use the same VM for Node-RED as it will run on its own; on a different port and is not using that much of resources.
You can also follow this manual, but below are some specifics that give you an extra head start.
Open your MobaXterm tool and login to the VM…I use the installation owner sysadmin
of the Process Automation platform having sufficient permission to run installation tasks at Unix (RHEL) level.
As Node-RED depends on NodeJS with its NPM package manager, your first set of commands is:
1 | sudo dnf module list nodejs |
After a 🍹, you can do node --version
which will give you something like this: v18.20.4
See also this supported node versions page for Node-RED!
Time to install Node-RED itself via: sudo npm install -g --unsafe-perm node-red
So, this command uses the NodeJS NPM package manager to install all the required JavaScript libraries (at a global modules location) to run it in an ‘unsafe-perm’ mode to force NPM to always run it in the correct context (like in Unix-“root”-context)…not for now!
Let’s start our new software tool with the (how obvious!) command: node-red
It gives some information on the state with a URL:
1 | 20 Jan 16:50:18 - [info] |
From your local laptop (where your VM is running), you can now access the Node-RED editor via URL: http://192.168.56.107:1880
NICEEEE…Simple, easy, and quick!! 😍
We see three panels:
- On the left are the available “nodes” you can use in a flow.
- In the center we see our flows (tabbed when multiple flows).
- On the right a helping panel to show output, do settings, find more help, etc.
- Finally, you also have a hamburger menu (top-right) which you can explore on your own…It’s no rocket-science!
…
The steps to start your first flow are easy:
- Drag & drop nodes into a flow.
- Connect/wire the nodes (the “orchestration” part) that depend on each other.
- Configure the nodes on what they need to do.
- Never, ever, forget to deploy the flow (with the top-right-red button) when you do a change.
- Test your flow starting the “inject”-node.
Extra notes to for better understanding; You can…
- …pass messages from one node to the next node.
- …manipulate messages during the flow and reuse its data.
- …use global-variables available across flows (within your Node-RED instance!).
- …use flow-variables within that flow.
- …have multiple “inject” nodes in one flow.
- …do parallel things; Not everything requires a sequential execution.
- …always add a “junction” on a wire between nodes to write output to a debug-node.
- …do an HTTP request (there is a node for it)! AND that’s where it gets interesting when we call our beloved platform…that’s for next week! 🥳
- …parse XML to JSON (via the XML-node)…Ohwww mama! I already love it so much…And all out-of-the-box!
If you can program, and understand services call, this tool is quickly understandable.
After a quick play, it all feels and smells a bit like BPM modeling in Process Automation, but much faster, more intuitive, easy to understand, and easy to follow the data as you can add as much debug output nodes as you need. I recommend making your first flow via this tutorial and expand with some more examples yourself. Make sure you understand the ‘inject’-node to start the flow and the ‘debug’-node to output data for verification.
It’s even possible to use a ‘function’-node where you can program (in JavaScript) your things, but not needed on how I intend to use this tool for.
Q/A
❓ Can I install third party nodes?
Ohw boy…Check the “Node-RED Library”. You can install them also directly from within your Node-RED instance:
I though “soap” would be an interesting thing for our purpose, but I already conclude that’s not even required…Again, next week!
❓ Where can I manipulate the settings of our Node-RED instance? sudo vi ~/.node-red/settings.js
Don’t forget to also restart Node-RED; Our instance from above can stop with
<Ctrl>+C
.
❓ Can I run Node-RED as a service? Yes, please! I leave it as a task for yourself.
❓ How about logging? See this, but to be honest; The debug-node was sufficient for me during my play-time! It can write to the console too.
…
Finally, have also a look at these resources to further enhance your basic knowledge before we go next-level!
- https://nodered.org/docs/faq/node-versions
- https://developers.redhat.com/hello-world/nodejs
- https://nodered.org/docs/getting-started/local#command-line-usage
- https://nodered.org/docs/faq/starting-node-red-on-boot
- https://nodered.org/docs/user-guide/runtime/securing-node-red
- https://nodered.org/docs/tutorials/first-flow
- https://flowfuse.com/blog/2024/05/understanding-node-flow-global-environment-variables-in-node-red
- https://www.youtube.com/watch?v=W-S_qlWjesg
Great, a quick basics “DONE” on Node-RED for this post. Installation is done, first impression is done…Let’s not run too fast or else you’ll struggle! Let this post first descend with you before we move on calling our beloved OPA platform with authentication services and services beyond. I have a head start…Trust me (😇), this tool is worth to earn at least two posts at “Process Automation Tips”; It’ll be great! Have a good weekend; I see you next week.
Don’t forget to subscribe to get updates on the activities happening on this site. Have you noticed the quiz where you find out if you are also “The Process Automation guy”?