# Stream Set Temporary Variable Action

With the help of the Stream Set Temporary Variable Action it is possible to set a variable within a running stream and to query it at any point within this stream by using the wildcard [{stream.variable.?}](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/wildcards/variable-related-wildcards-3/stream-variable).

<figure><img src="https://content.gitbook.com/content/cJYkTyk9qgh7aCR6dHIm/blobs/3K1jrSLzD0Qe7jsjdPTG/image.png" alt="" width="345"><figcaption><p>Stream Set Temporary Variable Action</p></figcaption></figure>

#### Example

A path that occurs repeatedly within a stream.

To prevent static copy and paste actions, the stream variable can be used to define it in the first place, and make all other references dynamically based on the first definition.&#x20;

#### Lifetime of a stream variable

By default a stream variable is no longer available after the stream has ended.

As temporary variables can only be created and used in a stream it is possible to inherit them to another stream/job by using [Stream Execute Generic Stream Action](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/nodes/actions/misc-21/stream-execute-generic-stream-action), [Job Create Job Action](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/nodes/actions/job-action/job-create-job-action) or [Job as Json](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/nodes/actions/job-action/job-as-json-action).

The sub stream can retrieve and update the temporary variable and pass this on to the next one.

{% hint style="info" %}
Keep in mind, that the changed value won't be returned to the previous stream
{% endhint %}

#### Stream variable exception

An exception to this are [Pre-Streams](https://docs.helmut.de/helmut4-releases/helmut4-components/helmutio/streams/io-event-triggers/prestream). If a temporary variable has been defined in a pre-stream, this one will be passed on to the main stream defined in the profile.
