Invoking coded automations inside low-code workflow
This section of the tutorial shows you how to invoke coded automations, specifically the Random and IncrementProxy workflows, within a low-code workflow by utilizing the Invoke Workflow File activity. This action will generate a random value, increment it, and display the final result in the console.
This tutorial and sample project are created using a Cross-platform project in Studio. It is important to remember that within Cross-platform projects, the Invoke Workflow File activity automatically imports arguments for the invoked workflow as fields of the activity. For Windows projects, you must click Arguments and manually add the arguments.
Steps
- In the Main workflow, add an Invoke Workflow File activity.
- Select the
Randomworkflow from the Workflow File Name dropdown.
- Select the
Because we are working inside a Cross-platform project, the arguments from the Random workflow (min and max) are automatically imported as fields in the activity.
:::note
For Windows projects: In the **Invoke Workflow File** activity, select **Browse for File** and change the file extensions you're browsing for, from **Workflow Files** (`*.xaml`, `*.uiwf`) to **All Files (\*.\*)**. This allows you to view all files, including `.cs`.
:::
2. Specify values for the min and max fields, between which determine the range within which the random value is generated.
3. In the Output field of the activity, create an Int32 variable named result, to store the generated value.
2. Add another Invoke Workflow File.
- This time select the
IncrementProxyworkflow from the Workflow File Name dropdown. - Specify the output
resultvariable in the Random field. - In the Output field of the activity, create an Int32 variable named
inc_result, to store the incremented random value. - Finally, add a Log Message activity and specify the
inc_resultvariable in the Message field, to print out the final value to the console.