Creating and Editing a Workflow
Business Enterprise
To create a new Workflow, click on the “New Workflow” button at the top right of the Workflow Management screen. You will be prompted to select the type of initial Trigger and then the Workflow Studio Builder screen will be shown.
To edit an existing Workflow, go to the Action menu for that Workflow (click the three dots) and select Edit. The Workflow Studio will then open with the existing Workflow in Builder view.
The top right corner of the header will display warnings if your Workflow is invalid and allow you to publish the workflow if there are any unpublished changes. The top-left corner of the header allows you to change the title of the workflow, and the View History option underneath will let you look through the different saved versions of the workflow.
Once valid, all Workflow changes will be saved automatically.
So, if you make changes to the Workflow and you change your mind, go to View History and restore an older version. As for the rest of the Builder screen, it is divided into three main areas.
Activity List
Activities are the building blocks of Workflows. Each activity represents a specific task the workflow will perform or event it will wait for, in the order set by the user.
The activity list displays all available activities you may use when building your workflow. Activities grouped into categories can be viewed by clicking the arrow button to expand and collapse the list. To quickly find an activity, you can use the search bar provided. If you hover over a specific activity, you will see a popup which explains what it can do for you.
Once you have identified an activity you wish to add to the workflow, simply click and drag it to a drop point on the canvas. Note that you cannot directly drag a category (ie. the entries with a collapse button), as you must drag the specific activity within it which you wish to use.
Canvas
The canvas is where the current workflow build is displayed. It is laid out similar to a flowchart with a beginning and end which can be reached through one or more branches. Activities will activate in order from top to bottom along the path you set. You can drag an activity from the activity list onto the canvas at any position with a + symbol, known as a drop point. You can then click on any activity placed in the canvas to view more details and configure it as required.
Activity Sidebar
When you click an activity in the canvas, a sidebar will appear with details about that activity. The sidebar is split into three tabs: Details, Input Data, and Output Data.
The red and white exclamation marks will show you which Activities and Tabs contain fields that need to be filled in to make the Workflow valid.
The details tab displays generic information about the activity and allows you to customize its name and description. For the trigger of the workflow (first node in the canvas) this tab also allows you to change the trigger type (ex. Entity Created, Entity Updated, Entity Status Changed).
The input data tab allows you to configure the inputs which that activity accepts. Some inputs may be mandatory, while others are optional. For details of required inputs for each activity type, review the https://gruntify.atlassian.net/wiki/spaces/GRUNTIFY/pages/834961409.
The output data tab displays the output data which the activity will return on success. Some activities do not return any data and so the tab may appear blank. For activities which return form data (such as ‘Read [entity]’ tasks), the tab will also allow you to select the expected form which will be returned. This must be done in order to use form fields as parameters in subsequent activities in the workflow.
Zooming, Undo and Redo
The building panel has a number of on-screen controls:
Undo and Redo controls.
Zoom controls.
From left to right they are:
Reset the zoom back to normal
Zoom In - make all boxes bigger on screen.
Zoom Out - make all boxes smaller on screen.
Full Screen - expand the canvas to take up the whole of the screen area, hiding the builder toolbar in the process. Click again to return to normal.
Zooming can also be done using your mouse wheel.
To move the visible drawing area around (so that you can see other parts of the design) click down with the mouse on the background, drag, and release. You will see the hand cursor go from open, to closed when the mouse is down and back to open when you release.
Parameter, String, Number, and other Data Types
On many of the fields on the Input tabs, you will see a drop-down with choices such as String, Number, Parameter, or Reset. This allows you to switch the type of inputs that go in that field.
Most fields will have two to four options - Reset and Parameter, or Reset, Parameter, Advanced Expression, and the natural type for that field. For example, the URL button link for the Send Email activity has the String option for you to type in your own URL or Parameter option for you to pick a Link URL that was generated in a previous activity.
Parameter Type | Description |
|---|---|
| Reset appears in all the drop-downs. If you are having problems with a format click on the Reset and it will go back to the default and you can start again. |
| A Parameter is the selection of a value from elsewhere in the workflow. |
| An Advanced Expression allows you to select a parameter from the workflow using a JavaScript expression. For advanced users, this allows for powerful data transformations. |
| A Reference allows you to select some data from your Workspace, such as a form, team, or user. |
| An Array is a list of the same sort of things. It indicates that you can enter one or more values in this field. For example, a list of email addresses or a list of job statuses. To delete a value click on the “x” in the value tag: |
| Options will contain a drop-down list of choices. For example, Location Type options on a New Asset are Geometry and Geolocation. |
| String allows you to enter a text value. |
| Boolean is an on/off or true/false value. A toggle field in a Gruntify form is a Boolean value. |
| Number allows you to enter a numeric value. This is used for entries such as Latitude and Longitude. |
Understanding the Step Ids
Warning: Complex Explanation Follows
Each node in the Workflow has a Step Id, such as request5625. The step id is displayed under the node title on the diagram, and on the Details tab for the node. We recommend that you do not edit this field. If you do the Workflow may break.
This step id is what Gruntify uses to link up the parts of the Workflow. If you look at the image below (click on it to zoom it up), you will see four Request Connector nodes. All four refer to the same Request in Gruntify - the one created by Inspect New Asset. So, a different step id doesn’t mean a different request - it means each step is doing something different with the request.
On the Parameter Selection screen that appears when you edit a Generate Link to Request/Job activity, you will see the names and step ids for possible matching “Create” and “Check Status” nodes as these nodes list the request (or job) itself as an output on the Output tab. If you were to look at the outputs from the Get Request Form Information node, then you would see the “Read Form” nodes output the data from the form, not the request (or job) itself.
This may sound very confusing. Don’t worry - you don’t actually need to understand these step ids. When you use that Parameter Selection box, Gruntify will sort out the step id for you and put the correct step ids in the fields in the Input Data tab.
But if you can follow the step ids, then it might help you sort out issues in your workflows.
But the most important lesson is:
Don’t change the step ids unless you understand how all this works! Otherwise, the Workflow is likely to break now or in the future.
Remember, the Workflow is the definition of the Process, and whenever the Workflow runs it makes an Instance. So the Builder lets you build (and edit) the Workflow Definition, and the Instances let you view current and previous runs.