Do Node red Subflows only allow static content as environment variables?

Hello,

I’ve been working on creating a subflow to handle my notifications.
At first I was sending everything trough messages to the subflow (msg.title, msg.actions,…)

I wanted to make use of the “environment variables” functionality, as I figured that way I don’t have to use a change node to define all the messages but can define them in the environment variables in the subflow node.

However, I can’t seem to fill in those environment variables with anything but static elements such as a string or JSON.

I need to pass dynamic content to the subflow, for example sometimes I want to include a security camera snapshot in notification and for that I currently define msg.imageretrieveURL as “https://theurltomyhomeassistant/local/”&data.new_state.attributes.friendly_name&$now(’[Y0001][M01][D01] [H01][m01][s01]’, ‘+0100’)&".jpg"
In the subflow in the notifcation node i then use msg.imageretrieveURL to define where the snapshot is located.

Is my understanding correct that I can’t pass such dynamic content to the subflow using environment variables, but have to continue using messages?

I realize I should probably have created a TLDR version of my question:

Is there a way to fill a subflow environment variable with dynamic content such as
“/local/”&data.new_state.attributes.friendly_name&".jpg" or is my suspicion correct that it can only accept static content?

I haven’t actually looked at the NR source for sub-flows but through my testing, I think only static data is allowed because it needs to set when you deploy because that’s when the copy of the flow gets created.

1 Like

I was looking at this flow over the weekend when I was working on emailing a cam capture, I think it has examples of what you want to do but honestly I’m not sure

NVR example flow

1 Like

Thank you. I will then use messages and a change node to pass the relevant information to the subflow.

Thanks for the information. I have created the flow for capturing images and sending them allready :slight_smile: but will keep this in mind if I want to capture video or example.