Zum Hauptinhalt springen

Automatisierungsvariablen

Pro-Automatisierungsvariablen zum Speichern und Übergeben von Daten zwischen Automatisierungsschritten, Skripten und Aktionsbedingungen.

Einführung

Automatisierungsvariablen ermöglichen es Aktionen, Daten untereinander in der gleichen Pipeline zu übergeben. Eine Aktion schreibt einen Wert in eine Variable — den Ausgabecode eines Skripts, einen benutzerdefinierten Feldwert, ein Patch-Ergebnis — und eine spätere Aktion oder Bedingung liest ihn.

Variablen sind auf die Automatisierung beschränkt, in der sie definiert sind. Sie werden nicht zwischen Automatisierungen übernommen.


Erstellen von Automatisierungsvariablen

Es gibt zwei Möglichkeiten, eine Automatisierungsvariable zu erstellen.

Aus der Registerkarte Variablen

  1. Öffnen Sie eine Automatisierung und klicken Sie aufVariablen in der linken Seitenleiste.

  2. Click + Add variable.

  3. Geben Sie einen Namen (keine Leerzeichen) und einen optionalen Standardwert ein.

  4. Click Speichern .

Automation Variables

Die hier erstellten Variablen sind sofort in allen Aktionen und Bedingungen der Automatisierung verfügbar.

Aus der Ausgabe einer Aktion

Jede Aktion kann ihre Ausgabe zur Laufzeit in eine Variable schreiben.

  1. Öffnen Sie eine Aktion im Bearbeitungsmodus und scrollen Sie nachZusätzliche Optionen .

  2. In the Aktionsausgabe einer Variable zuweisenFeld geben Sie einen Variablennamen ein oder wählen Sie einen vorhandenen aus.

  3. Speichern Sie die Aktion.

Action Output Variable

HINWEIS: This is the same mechanism shown by the orange (x) badge on pipeline cards. If you see an (x) badge on an action, that action is reading from or writing to a variable.Using Variables


In Actions and Scripts

Anywhere variable rendering is supported, click the variable icon to insert a variable by name. You can also type the reference directly using double-curly-brace syntax:

In Action Conditions

##{{MyVariable}}

Variables can be read in action conditions to control whether a step runs. For example: only fire a Create Alert action if a variable named

equals PatchingStatus . failedSee

Action-Bedingungen for the full reference on condition types and operators. Mapping to Script Variables

Script variables are named output slots defined in a script's

Variablen tab. The script writes a value to a script variable during execution, and the mapping in the Run Script action panel determines which automation variable stores that value — making it available to subsequent actions and conditions in the pipeline. Script variables are for capturing output, not supplying input. To pass data

into a script (device context, custom field values, system info), use system variables or custom fields via the picker in the script editor. {x}To map a script variable to an automation variable:

Open the

  1. Run Script action in edit mode. In the

  2. Script variables section, find the script variable you want to capture. Open the

  3. Automation variables dropdown on that row. Select an existing automation variable or click

  4. Create new variable.When the script runs, the value it writes to that script variable is stored in the mapped automation variable and carried forward through the pipeline.

HINWEIS:

The Script variables section only appears when the selected script has at least one variable defined in its Variables tab.You can also set an automation variable inline from within a script. Use the inline syntax when your script produces other output you don't want polluting the variable (logs, status messages, etc.). Use

Aktionsausgabe einer Variable zuweisen##{{variable=value}} when the script's only output is the value you want to capture. Embed this anywhere in your script output: Level's agent parses the script output for this pattern as the script runs. All other output passes through untouched. The variable must still be created in the script's Variables tab first.

TIPP:

##{{variable_name=value}}

This pattern — capture output → check it in a condition — is the standard way to build conditional failure handling in Level. See

Building Automations for a full walkthrough using this pattern. FAQWhere can I see all variables available in an automation? Open the automation and click


Variablen

  • in the left sidebar. This lists all automation variables defined for that automation. System variables are always available too but don't appear here — see System Variables for the full list. Can I use the same variable name in multiple automations? Yes. Variable names are scoped to the automation — in one automation has nothing to do with

  • in another. What value does a variable have before any action writes to it?PatchingStatus It uses the default value set when the variable was created. If no default was set, it's empty.PatchingStatus Can I read a variable from a previous automation run?

  • No. Variables reset at the start of each run. They don't persist between runs. It uses the default value set when the variable was created. If no default was set, it's empty.

  • Can I read a variable from a previous automation run? No. Variables reset at the start of each run. They don't persist between runs.

Hat dies deine Frage beantwortet?