- Einleitung
- Erste Schritte
- Prozessmodellierung mit BPMN
- Grundlagen der Prozessmodellierung
- Öffnen der Modellierungsarbeitsfläche
- Modellierung Ihres Prozesses
- Ausrichten und Verbinden von BPMN-Elementen
- Autopilot for Maestro (Vorschau)
- Prozess-Repository
- Prozessmodellierung mit Fallverwaltung
- Entwerfen eines persistenten Schemas für eine Fallentität
- Definieren von Fallschlüsseln (system vs. extern)
- Festlegung von Aufgaben-E/A und Write-Back-Vereinbarungen
- Austrittsregeln und Frühphasenbeendigung
- Modellierung von primären und sekundären Phasen
- Auslösen eines Falls über Data Fabric
- Implementieren von Personen und Berechtigungen auf Phasenebene
- Festlegen von SLAs und Regeln für die automatisierte Eskalation
- Konfigurieren einer Nachbearbeitungsschleife (erneuter Eintritt)
- Verwalten von Live-Fallinstanzen: Anhalten, migrieren und wiederholen
- Wörterbuch für die Fallverwaltungskomponente von Maestro
- Process modeling with Flow
- Erste Schritte
- Kernkonzepte
- Node reference
- Built-in nodes
- Connector nodes
- Build guides
- Best Practices
- Referenz (Reference)
- Prozessimplementierung
- Debugging
- Simulieren
- Veröffentlichen und Aktualisieren von agentischen Prozessen
- Häufige Implementierungsszenarien
- Extraktieren und Validieren von Dokumenten
- Prozessabläufe
- Prozessüberwachung
- Prozessoptimierung
- Referenzinformationen
Benutzerhandbuch zu Maestro
Was es tut
Runs JavaScript code and passes the return value to downstream nodes.
Configuration reference
| Feld | Erforderlich | Standard | Beschreibung |
|---|---|---|---|
| Skript | Ja | Keine | JavaScript code to execute. Must contain a return statement; the returned value becomes this node's output. |
The JavaScript environment
Scripts run in an isolated runtime and have access to:
$vars— the flow's variable scope. Access upstream node output via$vars.<nodeName>.<property>.metadata— flow execution metadata- Standard JavaScript built-ins — such as
JSON,Math,Date,Array,Object,String,Number,RegExp,Error,Promise,URL,URLSearchParams, and the timer functions.
For security, the runtime blocks network APIs (fetch, XMLHttpRequest, WebSocket), dynamic code execution (eval, Function), and storage APIs (indexedDB, caches). To call an external API, use the HTTP Request node instead.
Scripts are meant for fast, in-memory logic: keep them quick and avoid processing very large payloads, which can exceed runtime limits or time out.
Accessing upstream node output
Use $vars.<nodeName>.<property> where <nodeName> is the node's variable name (shown in the properties panel):
// Access HTTP Request node response
const body = $vars.httpRequest1.output.body;
const status = $vars.httpRequest1.output.statusCode;
// Access a flow variable
const count = $vars.myVariable;
// Access HTTP Request node response
const body = $vars.httpRequest1.output.body;
const status = $vars.httpRequest1.output.statusCode;
// Access a flow variable
const count = $vars.myVariable;
Rückgabewert
The script must return a value. The returned value becomes the node's output, accessible downstream as $vars.<nodeName>.output:
return {
message: "Processed",
count: items.length
};
return {
message: "Processed",
count: items.length
};
Eingaben und Ausgaben
Eingabe
The Script node can access any upstream variable via $vars. It does not have a typed input schema — anything in $vars is available.
Ausgabe
On success — $vars.<nodeName>.output:
The return value of the script. Shape depends on what the script returns.
On failure (when an error handle is connected) — $vars.<nodeName>.error:
{
"code": "string",
"message": "string",
"detail": "string",
"category": "string",
"status": 0
}
{
"code": "string",
"message": "string",
"detail": "string",
"category": "string",
"status": 0
}
Generate scripts with AI
The magic wand icon above the script editor accepts a plain-language description of what you want and generates the JavaScript for you. This is useful for accessing an upstream node's output or writing a quick transformation without looking up the exact $vars syntax.
Beispiele
Example 1 — Set a process variable
// Set a variable that downstream nodes can reference
return {
orderTotal: $vars.httpRequest1.output.body.price * $vars.httpRequest1.output.body.quantity,
currency: "USD"
};
// Set a variable that downstream nodes can reference
return {
orderTotal: $vars.httpRequest1.output.body.price * $vars.httpRequest1.output.body.quantity,
currency: "USD"
};
Downstream nodes access the values as $vars.script1.output.orderTotal and $vars.script1.output.currency.
Example 2 — Process an HTTP response
const data = $vars.httpRequest1.output.body;
return {
title: data.title,
userId: data.userId
};
const data = $vars.httpRequest1.output.body;
return {
title: data.title,
userId: data.userId
};
Example 3 — Conditional logic
const status = $vars.httpRequest1.output.statusCode;
if (status === 200) {
return { success: true, data: $vars.httpRequest1.output.body };
} else {
return { success: false, statusCode: status };
}
const status = $vars.httpRequest1.output.statusCode;
if (status === 200) {
return { success: true, data: $vars.httpRequest1.output.body };
} else {
return { success: false, statusCode: status };
}
Example 4 — Transform an array
const items = $vars.fetchItems1.output.body;
return {
count: items.length,
names: items.map(item => item.name)
};
const items = $vars.fetchItems1.output.body;
return {
count: items.length,
names: items.map(item => item.name)
};
When to use this vs Data Transform
| Use Script when... | Use Data Transform when... |
|---|---|
| You need full JavaScript logic — loops, conditionals, string manipulation | You need a simple field mapping or no-code transformation |
| You want to compute something from upstream node output | You want a visual mapper without writing code |
| The transformation is complex or stateful | The transformation is a straightforward reshape |
Zugehörige Seiten
- Variables and data flow —
$vars, expression syntax, variable scoping - HTTP Request node — typical upstream data source
- Decision node — branch based on Script output
- Was es tut
- Configuration reference
- The JavaScript environment
- Accessing upstream node output
- Rückgabewert
- Eingaben und Ausgaben
- Eingabe
- Ausgabe
- Generate scripts with AI
- Beispiele
- Example 1 — Set a process variable
- Example 2 — Process an HTTP response
- Example 3 — Conditional logic
- Example 4 — Transform an array
- When to use this vs Data Transform
- Zugehörige Seiten