Export and Import Workflow Definitions

In Commander, you can export and import workflows and workflow modules as workflow definitions that use standard JSON or YAML file formats.

Definitions for workflows and workflow modules only differ in that definitions for workflows provide information that defines them as parent containers that may run independently and may contain one or more workflow modules.

The ability to import and export workflow definitions allows you to reuse workflows and workflow modules between environments (for example, you could copy workflow or workflow modules from a staging environment to a production environment). It also allows you to easily share important workflows and workflow modules between Commander systems instead of manually configuring them separately for each Commander system.

When exporting and importing workflow definitions, you must consider credentials that may be associated with the steps in the workflow definition:

  • When you export a workflow definition, any credential names are also exported.
  • When you import a workflow definition with steps that contain credentials, credentials with the same name must exist on the Commander system where you're importing the file. If they don't match, the import will fail.

    However, if you edit the workflow definition in a text editor to remove the credential names before you import it, the workflow definition will import successfully. However, before you can use that workflow or workflow module, you must edit the imported workflow definition file and add the appropriate credentials.

For more information, see Manage Credentials.

If you export a workflow that includes workflow modules as steps, you must export the workflow modules separately. This is because the workflow is one workflow definition, and any workflow modules used by that workflow are separate workflow definitions. In other words, a workflow module can be referenced by workflows, but it isn't defined in a workflow.

You can find workflows for common DevOps scenarios on the public GitHub repository . You can download workflows from this site and import them to your local system.

Export workflows and workflow modules

Access:

Configuration > Command Workflows

Configuration > Self-Service > Approval tab

Configuration > Self-Service > Completion tab

Available to:

Commander Role of Superuser and Enterprise Admin

  1. On the appropriate Workflow page, click the Workflows tab to export a workflow, or click the Workflow Modules tab to export a module.
  2. Select a listed workflow or workflow module and click one of the following:
    • Export > Export JSON — Exports the workflow or module as a JSON file
    • Export > Export YAML — Exports the workflow or module as a YAML file

Import workflows and workflow modules

Access:

Configuration > Command Workflows

Configuration >Self-Service > Approval tab

Configuration > Self-Service > Completion tab

Available to:

Commander Role of Superuser and Enterprise Admin

A Commander installation may have only one global approval workflow for new requests and one global approval workflow for change requests. Therefore, keep in mind that you can't import new request approval workflows or change request approval workflows with global assignments if your Commander installation already has similar approval workflows with global assignments. For more information, see Assign Approval Workflows

  1. On the appropriate Workflow page, click the Workflows tab to import a workflow, or click the Workflow Modules tab to import a module.
  2. In the Import Workflow or Import Workflow Module dialog, click Browse and navigate to a saved Commander workflow or module. JSON and YAML file formats are supported.
  3. Select the file and click Open.

    The file validation results are displayed in the Messages area of the dialog.

    • If the file is successfully validated, review the displayed messages (it may indicate configuration tasks that must be performed after import). Then enter a comment about the workflow in the Description of Changes field, and click Import.
    • If the workflow you're importing matches an existing workflow with the same name on this Commander installation, the existing workflow will be overwritten. If you don't want to overwrite your existing workflow, click Close to cancel the operation.

    • If the file can't be validated, review the listed errors, then click Close to cancel the operation. You can't import the file until you resolve the errors.

    If the import is successful, depending on the imported workflow or module type, the appropriate Workflows page will display, and the new workflow or workflow module will be highlighted there.