Overview
The Subworkflow Node and Loop Subworkflow Node allow you to run an existing workflow inside another workflow.
Subworkflow Node runs the selected workflow only once.
Loop Subworkflow Node runs the selected workflow multiple times by accepting an array/list as input. This is useful for batch processing tasks, such as generating multiple images, processing multiple data points, or handling a list of user requests dynamically.
Parameters
Both nodes have the following four parameters
Config
Used when you don’t want to select a workflow from the existing list or cannot do so.
Requires downloading the workflow json, opening it in the editor, and inserting the config part manually.
Workflow ID
The ID of the workflow you want to run.
It is added automatically when selecting the required workflow from the dropdown menu. Please note that not all workflows appear in the list; you need to type the title to find it).
FYI, the Workflow ID can also be found in the last digits of the URL of the workflow page. eg. app.scade.pro/workflow-builder/77000
Params
Defines the inputs from the Start Node that will be sent to the subworkflow.
Format for Subworkflow Node. You can use expressions to pass the input from the Start node to the Subworkflow
{ "prompt": "{{context["gbZM-start"]["success"]["name-of-the-input-field"]}}" }
Format for Loop Subworkflow Node (when multiple inputs are required)
{
"success": [
{ "request": "federal holidays 2025 calendar" },
{ "request": "significance of federal holidays in the US 2025" },
{ "request": "changes to federal holidays in 2025" },
{ "request": "observance of federal holidays and related events 2025" },
{ "request": "federal holidays comparison years 2020-2025" },
{ "request": "impact of federal holidays on business operations 2025" }
]
}
Params Example (Optional)
Provides an example of acceptable parameters for the subworkflow.
Example
{
"Prompt": "reiciendis culpa! esse repellendus esse esse Hic",
"Width": 5646,
"Height": 5345,
"Model": "Quality & Speed"
}This shows what kind of inputs the connected subworkflow can process.
How to use on Scade
Example: Image generation using Loop Subworkflow
Scenario
You have a workflow that generates images, and you want to use it within another workflow to generate multiple images of different animals.
How it works
Instead of running the image generation workflow once, you use the Loop Subworkflow Node to run it multiple times.
You provide a list of different animal names as input.
If your input is not in the required format, use a Python Node to transform it into the correct array format.
The loop processes each entry in the list and generates an image for each animal.
The output will be a set of images, each corresponding to an animal from the list.
Generating an array/list for loop subworkflow using Python node
If your input requests are separated by commas, you can use Python node with the following code to format them correctly:
splitted_list = context["start"]["success"]["prompt"].split(",")
formatted_info = [{"[prompt": request} for request in splitted_list]
_result = formatted_info
Make sure that the key names in the formatted output match the input field names of the Start Node in the workflow you are calling. This ensures the requests are properly structured as an array for the Loop Subworkflow Node, regardless of how they were originally entered.
{{
"success": [
{
"prompt": "lion"
},
{
"prompt": "tiger"
},
{
"prompt": "elephant"
},
{
"prompt": "panda"
},
{
"prompt": "giraffe"
}
]
}
Expected outcome
The workflow will generate and return a set of images, one for each animal in the input list. This approach is ideal for batch processing tasks where multiple variations of the same operation are required.
By using the Loop Subworkflow Node, you can automate repetitive tasks efficiently and ensure that multiple inputs are processed without manual intervention.