Custom workflows are collections of Python scripts written by customers (or provided by BlueCat) that provide extended, customized functionality within BlueCat Gateway, either in the UI or as functionality that can be used as part of Gateway's REST API. Behind the scenes, custom workflow scripts typically make use of BlueCat Gateway API calls.
When setting up a new Custom Workflow, BlueCat Gateway helps you get started with workflow creation by setting up the overall file structure for the workflow. When developing the workflow functionality, adhering to this file structure lets Gateway easily integrate your new workflow into the product.
To set up a new custom workflow:
-
Open the Create workflow window. (Click the Navigator button if necessary, then click
.) -
In Workflow name, enter the Python module name of your new workflow.
Note: The workflow name must start with a letter or underscore character (_
) and can contain only letters, numbers, and underscores. Workflow names must be unique, even across all Categories (see the next step). -
(Optional) In Workflow category, enter the nested category and subcategories for your new workflow.
Custom workflows with the same category will be grouped together in the navigator Gateway UI. The category and subcategory will also be used in the folder name for the workflow's scripts.
For example, if the Workflow Name is "example_workflow" and the Category is "Examples", then:
Under Available Actions in the UI, if the workflow is a UI workflow, it will appear under the Examples subheading. Within the Examples subheading, it will appear as the Available Actions Display Name that you enter later.
The workflow's files will be stored in a subfolder under the BlueCat Gateway folder named
Examples/example_workflow
.
Tip: Leave the Workflow Category field blank if you want to place the new workflow at the root level, or if the workflow won't appear in the BlueCat Gateway UI. (That is it will be used only by the REST API.) -
In Workflow description, enter a basic summary of what the workflow does.
-
Enter additional labels as needed by the specific workflow.
-
In Python Implementation Name, enter the Flask name for the workflow that is used for permissions.
As you type, Gateway fills in Python Implementation Name with an appropriate value. You can edit it if needed.
-
In Endpoint Name, enter the Endppoint Name. The full endpoint is the Python Implementation Name and the Endpoint Name separated by a slash:
This name is particularly useful for API-only workflows. As you type, Gateway fills in the Endpoint Name with an appropriate value. You can edit it if needed.<Python Implementation Name>/<Endpoint Name>
-
In Display Name, enter a name for your new workflow as it will appear to the user. This includes the Navigator on the left side and on tiles in the Gateway home page.
You can leave this field blank if the workflow will be used only by the REST API or by both the REST API and the UI.
-
-
Under Workflow Type, select which type of template to create.
To make your workflow available through the BlueCat Gateway user interface, select Workflow with UI.
Also select Workflow with UI if the workflow will be available through both the UI and the REST API.
To make your workflow available only to the Gateway REST API, select Workflow using only REST API.
-
When you're done, click Create workflow.
Gateway generates files and subdirectories for your new workflow. These include:<workflow name>_page.py
<workflow name>_form.py
(which contains validators for fields in the page of your workflow)__init__.py
Sub-folders for the workflow's HTML page in
<bluecat_gateway>/workflows/
. For example,<bluecat_gateway>/workflows/Examples/example_workflow
.
If you created a UI workflow (that is, if the Workflow Type was Workflow with UI), you must assign Gateway user groups to the workflow so that it will appear in the Gateway UI for users in those groups. For more details, see Setting page and REST endpoint permissions.
Regardless, you can now start editing the workflow's script to implement the desired functionality.