# 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/v4.7.0/helmut4-components/streamdesigner/wildcards/functional-wildcards/variable-related-wildcards/stream-variable).

<figure><img src="https://967744423-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFbUsR0ZkwLkIQt5Asw0b%2Fuploads%2Fvezy5MY0IdT6hMFUpB2A%2Fimage.png?alt=media&#x26;token=94c9a2d8-66df-4119-b033-a8a0773cfd0b" 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/v4.7.0/helmut4-components/streamdesigner/nodes/actions/misc/stream-execute-generic-stream-action), [Job Create Job Action](https://docs.helmut.de/helmut4-releases/v4.7.0/helmut4-components/streamdesigner/nodes/actions/job-action/job-create-job-action) or [Job as Json](https://docs.helmut.de/helmut4-releases/v4.7.0/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/v4.7.0/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.
