Workflows provides a very intuitive graphical user interfaces, where users can create, update and execute workflows. This interface provides very broad details to help the user debugging failed executions, add clean-up policies, create Jinja templates, etc. For more details on Workflows framework capabilities, please read here.
However, users with a developer profile are used to interface with IDEs that facilitate code development and integration, and not to program their code via web browsers. Some situations, like connection issues/timeouts, undesired navigation or refresh of the development window can drive into lose code changes. The purpose of this Visual Studio Code extension for Workflows is to provide this type of users with a new interface to speed up their code design process/activities.
To install the visual studio code extension:
npm install .
npm run compile
vsce package
As prerequisite, we support vsCode rel ^1.76.0.
After successfully installing the extension, you should see in you Explorer > Workspace a new folder called Workflow Manager, with actions and workflows subfolders.
For setting the extension, access vsCode Settings (workspace) > Extensions > WorkflowManager where you should see the following attributes to configure:
After modifying these settings, vsCode requires to reload the window. The can be done either closing and reopening vsCode, or by opening the command palette and entering the Developer: Reload Window command
With the installation and setup process successfully completed, the user should be able to access the Workflow Manager folder within the workspace. This folder contains three folders:
By opening any of the three, the extension dynamically loads the list of actions, templates or workflow definitions and let's you open any of them by simply clicking on the "file". Content is also dynamically loaded from the remote system.
vsCode allows users to create, rename and remove files for any local folder. Similarly, the vsCode extension allows the user to perform the very same operations within the Workflow Manager folder for actions, templates and workflows, these operations then being applied on the remote NSP Workflows system:
With a workflow/action opened in the editor, the user can modify the definition adding new tasks, changing input attributes, description, tags, etc.
All the changed content can be uploaded to the remote system by simply saving the definition. This will trigger several operations in the background to simplify the user experience, including: workflow validation against the remote server, set the workflow to draft, upload and set to published.
When the workflow has been modified locally, the user can select the Compare Changes icon from the top right corner of the editor. This will open a another frame showing the changes made compared to the saved version.
The extension includes two options for validating workflow definitions:
The extension allows a user to download workflow definitions (one, multiple, all) by right clicking on the file/folder name and selecting Download.
The user can select the destination folder where the definitions will be stored to create a backup copy or to work locally/offline.
Opening a workflow definition adds few command buttons at the top right corner of the editor. The first one (play button -> "Execute workflow") allows the user to execute the workflow in the remote system. If input attributes are required, the extension translates them into a JSON and asks the user to fill them before triggering the execution.
When sent, the extension gathers the extension ID, so users can directly access the execution site in Workflows GUI if they whish.
Additionally, the user can click the second command button (health button -> "Last Execution Result"). This will show very brief information on when the last execution was created and the status of this last execution as a system message. This provides two more options to proceed with the visualization:
When running the extension, it automatically creates two files for validation and suggests:
By selecting some of the snippets suggests, the extension autocompletes an entire task definition for a given action to be used as an example.
The vsCode extension for Workflows provides the right pointers to the Workflows GUI for the user to access the system whenever it is desired. Few examples:
Workflow or action definitions have the home button at the top, which drives the user to the definition in Workflows .
The vsCode extension allows Jinja2 template to be tested within the extension.
Selecting the play icon allows the user to enter the context for the template and the rendered result will be displayed.
The vsCode extension allows input forms to be generated for the workflow
Selecting the Generate Form icon will create a schemaForm json body from the workflow inputs.
Saving this file will upload the changes to Workflows .
When a YAQL expression is highlighted in the extension, "Run Yaqalator" can be select from the contextual menu.
This allows the expression to be resolved against the entered context.
The extension provides a similar functionalities for users working on local definitions (stored as yaml files in their computers). Few considerations:
At the status bar, we included a cloud icon that allows to download the workflow examples from Nokia's official GitHub.
With the community, this site will get updated with new workflows, actions, templates, etc.
This first version, although covers a wide set of functionalities for helping workflow developers, could potentially incorporate additional features. Some items that we already identified:
For any suggestion, potential improvement or issue, please reach out to: