Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Store workflow template on server and access it as a general command

Jerry Liu edited this page Jan 16, 2015 · 9 revisions

Why to store workflow templates on server

Originally, webcommander only provided individual commands. Workflows, a combination of defined commands and parameters, were supposed to be composed and maintained by end users' themselves. It was not convenient to share and reuse workflows to do more complicated tasks.

To solve this problem, workflow templates (in form of JSON files) could now be stored on webcommander server. Each template shows as a general command on the index page. When user clicks on it, it opens the workflow page and shows the commands defined by the template automatically.

How to create a workflow template

  1. Open a browser and navigate to the workflow page.
  2. Select "Workflow > Define variables" as the very first command.
  3. In variableList, define global variables in form of name=value pairs. For all following commands, use variable names to define parameters. That means when another user wants to reuse this workflow, he just needs to modify the first command to change variable values. All other commands could be kept intact.
  4. Add as many commands as necessary.
  5. Export the workflow content and save it as a JSON file.
  6. Edit the JSON file by removing the first line with the code below.
  7. Save the JSON file in www/workflow/ folder or any sub folder.
    [{
        "synopsis": "Replace this with the text to display on the index page",
        "functionality": "Replace this with tags (separated by comma) so that it could be filtered",
        "description": "Replace this with a workflow description"
    },
    {

Refer to https://github.com/vmware/webcommander/blob/master/www/workflow/sample/upgrade-powershell.json for an example.

How to show it on the index page

Once the JSON file is saved, click "Generate command definition" command on the index page.