# 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.?}](/helmut4-releases/v4.7.0/helmut4-components/streamdesigner/wildcards/functional-wildcards/variable-related-wildcards/stream-variable.md).

<figure><img src="/files/vnktK00EeubLyVLgvKMN" 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](/helmut4-releases/v4.7.0/helmut4-components/streamdesigner/nodes/actions/misc/stream-execute-generic-stream-action.md), [Job Create Job Action](/helmut4-releases/v4.7.0/helmut4-components/streamdesigner/nodes/actions/job-action/job-create-job-action.md) or [Job as Json](/helmut4-releases/v4.7.0/helmut4-components/streamdesigner/nodes/actions/job-action/job-as-json-action.md).

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](/helmut4-releases/v4.7.0/helmut4-components/helmutio/streams/io-event-triggers/prestream.md). 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.helmut.de/helmut4-releases/v4.7.0/helmut4-components/streamdesigner/nodes/actions/misc/stream-set-temporary-variable-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
