Sub-Workflow ausführen#
Verwenden Sie den Knoten "Sub-Workflow ausführen", um einen anderen Workflow auf dem Hostrechner auszuführen, auf dem Localmind Automate ausgeführt wird.
Knotenparameter#
Quelle#
Wählen Sie aus, wo der Knoten die Informationen des Sub-Workflows beziehen soll:
- Datenbank: Wählen Sie diese Option, um den Workflow anhand der ID aus der Datenbank zu laden. Sie müssen außerdem Folgendes eingeben:
- Aus Liste: Wählen Sie den Workflow aus einer Liste von Workflows aus, die für Ihr Konto verfügbar sind.
- Workflow-ID: Geben Sie die ID für den Workflow ein. Die URL des Workflows enthält die ID nach
/workflow/
. Wenn die URL eines Workflows beispielsweisehttps://my-LOCALMIND_AUTOMATE-acct.app.lma.cloud/workflow/abCDE1f6gHiJKL7
lautet, ist die Workflow-IDabCDE1f6gHiJKL7
.
- Lokale Datei: Wählen Sie diese Option, um den Workflow aus einer lokal gespeicherten JSON-Datei zu laden. Sie müssen außerdem Folgendes eingeben:
- Workflow-Pfad: Geben Sie den Pfad zu der lokalen JSON-Workflow-Datei ein, die der Knoten ausführen soll.
- Parameter: Wählen Sie diese Option, um den Workflow aus einem Parameter zu laden. Sie müssen außerdem Folgendes eingeben:
- Workflow-JSON: Geben Sie den JSON-Code ein, den der Knoten ausführen soll.
- URL: Wählen Sie diese Option, um den Workflow von einer URL zu laden. Sie müssen außerdem Folgendes eingeben:
- Workflow-URL: Geben Sie die URL ein, von der Sie den Workflow laden möchten.
Workflow-Eingaben#
Wenn Sie einen Sub-Workflow über die Optionen Datenbank und Aus Liste auswählen, werden die Eingabeelemente des Sub-Workflows automatisch angezeigt, sodass Sie Werte eingeben oder zuordnen können.
Optional können Sie angeforderte Eingabeelemente entfernen. In diesem Fall empfängt der Sub-Workflow null
als Wert des Elements. Sie können auch Versuchen, Typen zu konvertieren aktivieren, um zu versuchen, Daten automatisch in den angeforderten Typ des Sub-Workflow-Elements zu konvertieren.
Eingabeelemente werden nicht angezeigt, wenn der Workflow-Eingabe-Trigger-Knoten des Sub-Workflows den Eingabedatenmodus "Alle Daten akzeptieren" verwendet.
Modus#
Verwenden Sie diesen Parameter, um den Ausführungsmodus für den Knoten zu steuern. Wählen Sie aus diesen Optionen:
- Einmal mit allen Elementen ausführen: Übergeben Sie alle Eingabeelemente in eine einzige Ausführung des Knotens.
- Einmal für jedes Element ausführen: Führen Sie den Knoten einmal für jedes Eingabeelement der Reihe nach aus.
Knotenoptionen#
Dieser Knoten enthält eine Option: Auf Abschluss des Sub-Workflows warten. Damit können Sie steuern, ob der Haupt-Workflow auf den Abschluss des Sub-Workflows warten soll, bevor er mit dem nächsten Schritt fortfährt (aktiviert), oder ob der Haupt-Workflow fortfahren soll, ohne zu warten (deaktiviert).
Einrichten und Verwenden eines Sub-Workflows#
In diesem Abschnitt wird die Einrichtung sowohl des übergeordneten Workflows als auch des Sub-Workflows beschrieben.
Create the sub-workflow#
-
Create a new workflow.
Create sub-workflows from existing workflows
You can optionally create a sub-workflow directly from an existing parent workflow using the Execute Sub-workflow node. In the node, select the Database and From list options and select Create a sub-workflow in the list.
-
Optional: configure which workflows can call the sub-workflow:
- Select the Options menu > Settings. Localmind Automate opens the Workflow settings modal.
- Change the This workflow can be called by setting. Refer to Workflow settings for more information on configuring your workflows.
- Add the Execute Sub-workflow trigger node (if you are searching under trigger nodes, this is also titled When Executed by Another Workflow).
- Set the Input data mode to choose how you will define the sub-workflow's input data:
- Define using fields below: Choose this mode to define individual input names and data types that the calling workflow needs to provide.
- Define using JSON example: Choose this mode to provide an example JSON object that demonstrates the expected input items and their types.
- Accept all data: Choose this mode to accept all data unconditionally. The sub-workflow won't define any required input items. This sub-workflow must handle any input inconsistencies or missing values.
- Add other nodes as needed to build your sub-workflow functionality.
- Save the sub-workflow.
Sub-workflow mustn't contain errors
If there are errors in the sub-workflow, the parent workflow can't trigger it.
Load data into sub-workflow before building
This requires the ability to load data from previous executions, which is generally available on.
If you want to load data into your sub-workflow to use while building it:
- Create the sub-workflow and add the Execute Sub-workflow Trigger.
- Set the node's Input data mode to Accept all data or define the input items using fields or JSON if they're already known.
- In the sub-workflow settings, set Save successful production executions to Save.
- Skip ahead to setting up the parent workflow, and run it.
- Follow the steps to load data from previous executions.
- Adjust the Input data mode to match the input sent by the parent workflow if necessary.
You can now pin example data in the trigger node, enabling you to work with real data while configuring the rest of the workflow.
Call the sub-workflow#
- Open the workflow where you want to call the sub-workflow.
- Add the Execute Sub-workflow node.
-
In the Execute Sub-workflow node, set the sub-workflow you want to call. You can choose to call the workflow by ID, load a workflow from a local file, add workflow JSON as a parameter in the node, or target a workflow by URL.
Find your workflow ID
Your sub-workflow's ID is the alphanumeric string at the end of its URL.
-
Fill in the required input items defined by the sub-workflow.
- Save your workflow.
When your workflow executes, it will send data to the sub-workflow, and run it.
You can follow the execution flow from the parent workflow to the sub-workflow by opening the Execute Sub-workflow node and selecting the View sub-execution link. Likewise, the sub-workflow's execution contains a link back to the parent workflow's execution to navigate in the other direction.
Wie Daten zwischen Workflows übertragen werden#
As an example, imagine you have an Execute Sub-workflow node in Workflow A. The Execute Sub-workflow node calls another workflow called Workflow B:
- The Execute Sub-workflow node passes the data to the Execute Sub-workflow Trigger node (titled "When executed by another node" in the canvas) of Workflow B.
- The last node of Workflow B sends the data back to the Execute Sub-workflow node in Workflow A.