This activity makes it possible to run another workflow file (.neek format) from the current workflow.
This activity is convenient for reusing the existing workflows. This eliminates the necessity to recreate them manually. It also lets you achieve modularity while developing bots: every single subprogram can be edited separately as well as added or removed from the workflow at any time.
This is how a complete example would look like. There are some actions at the beginning of the workflow. As soon as they are complete, a subprogram is launched. Based on the result of its work, the workflow execution will continue according to the set scenario: it can either have one branch or an additional branch which is chosen in case the subprogram was not executed properly.
In this example a subprogram is run when the preceding actions are complete. Then the algorithm continues executing othe actions in this workflow
The only parameter here is Path to file. It lets you specify the path to the workflow file that needs to be executed. It is required.
There are two kinds of paths:
- Absolute path. It is used when the required workflow file is placed in the home directory or in any other place different from the directory that contains the current workflow (higher in the hierarchy).
- Relative path. It is used when the required file is in the same directory as the workflow file (or in a child directory).
Path to file parameter
The ‘Open in a view tab’ button lets you view the workflow file you are going to set as a subprogram in a separate Studio Pro tab.
Interaction between subprograms and variables
Altough generally it is not required to explicitly pass or return values, the possibility itself exists. Variables can be passed or returned through the arrows connecting blocks.
If you need to pass a variable to a subprogram, connect the subprogram block with a block that returns the value, and then inside the subprogram use the Save the previous step result option in the desired parameter of the block connected to the Start node.
If you want to return a value from a subprogram, then the last block in the subprogram should naturally return the value and in the outer program, the next block connected to the 'Subprogram' (that returns the value) should have the 'Save the previous step result' option enabled in the desired parameter.