Running workflows
Avantra workflows can be triggered in several ways:
- Manually executed
The simplest method to execute a workflow is directly in the workflow builder itself. Either the entire workflow can be executed or only specific steps. - Scheduled
Workflows can be scheduled to run once at a specific time or reoccurring at specific times using the UI or a CRON-like syntax. - From a notification
In response to an event in Avantra, for example a Critical check, a workflow can be triggered to remedy the problem. - Externally by an API call
Using our SOAP API or our command line tools, workflows can be started and monitored externally to Avantra.
Executing a workflow
You can access Avantra's new UI (user interface) in three ways:
- Click
Try new experience in the menu bar in the top right of the Classic UI. This takes you to the homepage of the new UI.
- Navigate to Automation > Workflow Executions and click Try new experience. This takes you to the Automation page in the new UI.
- Navigate to Automation > Workflows, double-click on a workflow to open it and click Execute > Execute workflow (new). This opens the workflow configuration in the new UI.
Using variants will open the workflow execution configuration in the Classic interface. Variants are not supported in the new UI experience.
To run a worflow:
- Click Start new in the top right hand corner of the screen. This opens the workflow configuration.
- On the Start screen, select a Customer from the dropdown.
Only systems assigned to this customer and its sub-customers are available. The workflow execution inherits its permissions. - By default, notifications are off for workflows, you can turn on notifications by toggling the Complete this section to on. When enabled, you can define:
- When to be notified (workflow start, workflow end, step failure, workflow failure).
- Which messaging service to use.
- Who to notify by entering emails.
- Whether you are sent a copy of the notification by setting Send me a copy to true.
- Click Next.
- Continue through the workflow configuration screens. The screens you see are dependent on the workflow you are executing.
- The Summary screen gives you a final overview of the workflow you are about to execute.
- Click Execute to start the workflow.
The workflow will appear in the Currently running executions section on the main Automation page, detailing progress. While the workflow is running, you can click to stop the workflow.
Any steps that require user input can be actioned by clicking on the button in the Action column.
Variants
To simplify the execution of a workflow with input parameters, a variant can be created to save pre-defined input parameters of a workflow. These variants can then be selected when starting the execution of a workflow.
Creating a new variant
- Choose Automation > Workflows and double-click on the workflow that you wish to add a variant to.
- Click the Variants tab.
- Click New.
- Define a Name for the variant.
- (Optional) Enter a Description to document the purpose of the variant.
- Select a Customer that this variant applies to. The selection here affects user permissions to interact with this variant at execution.
- Specify, at max, one variant with the Default configuration flag to default this variant for each new execution.
- Checking the Exportable checkbox allows the workflow import and export function to export this variant for backup or use in a different Avantra system.
- Define default Values for each input parameter of the workflow.
- Click Apply.
The variant is now created for use at execution or assigned to schedules.
Variants can only be created with unique names to make it easier to select the correct one at execution time.
Executing a workflow with a variant
When executing a workflow with a variant, the workflow execution configuration opens in the Classic UI.
- In Automation > Workflows, double-click on the workflow that you wish to execute.
- Click Execute > Execute with a variant to open the workflow execution configuration.
- Select the variant you wish to execute from the Workflow Variants dropdown.
- Select a customer from the Execution customer dropdown. This customer selection determines the permissions of the workflow execution.
- Define whether notifications are to be sent for the execution.
- Populate any other fields, such as Workflow Inputs. The sections visible are dependent on the workflow you are executing.
- Click Execute to start the workflow.
You can monitor the execution as it is running, or if it requires user input from the new UI.
Workflow schedules
Schedules are used to automatically execute workflows at specific times or in response to specific events. A schedule can be created either using our UI or by using a CRON-like syntax for greater control.
Creating a schedule
- Navigate to Automation > Workflows and double-click on the workflow to add a schedule to.
- Click the Schedules tab.
- Click New.
- Define a Name for the schedule. The name cannot contain spaces.
- Double-click on the schedule record to open it.
- Check the Active checkbox to activate the schedule.
- If the workflow has any variants, you can select one from the Variant dropdown. Leaving the dropdown as
---means a variant won't be used. - Click Edit Scheudle to create the schedule pattern.
- Select a Timezone for the schedule.
- You can select one of the options to define the schedule pattern:
- Non-Recurrent: A one-time schedule that runs once at a specific date and time in the future.
- Recurrent: A simple recurring pattern for daily, weekly, monthly or yearly activities with start and end dates.
- Advanced: Use the advanced tab to specify more granular or complex recurrence patterns in a CRON-like syntax. Enter 5 values each separated by a space to determine the pattern, for example
0 11 1 11 *. See cron-syntax for a more detailed explanation of this syntax.
- Click the Info button to validate the schedule pattern and check when the next runs will be.
- Click OK to close the schedule dialog.
- You can verify or change the Name of the schedule.
- (Optional) Enter a Description to document the purpose of this schedule.
- Click Apply to save the schedule.
The schedule line will now appear in the table. It will be active if the Active checkbox is checked.
Understanding the CRON-like schedule
When defining a schedule, the Advanced tab allows specification of a CRON-like schedule, for example 0 11 * * *. There are five values here in a specific order separated by a space to define the schedule. These values are explained in the table below:
| Name | Allowed Values | Allowed Special Characters |
|---|---|---|
| Minute | 0-59 | , - * / |
| Hour | 0-23 | , - * / |
| day of the month | 1-31 | , - * / |
| month | 1-12 or JAN-DEC | , - * / |
| day of the week | 0-7 (0 or 7 is Sunday) or MON-SUN | , - * / |
Therefore 0 11 * * * means that a schedule will run every day at 11:00 AM.
These are some more examples:
| Expression | Meaning |
|---|---|
| 0/5 **** | Every 5 minutes |
| 0 **** | Every hour |
| 0,30 **** | Every 30 mins |
| 0 11 ** * | Every day at 11:00 AM |
| 0 11 ** MON-FRI | Monday to Friday at 11:00 AM |
| 0 9-17 ** MON-FRI | Every hour from 9 AM to 5 PM on Monday to Friday |
| 0 11 1/5 ** | 11:00 AM every 5 days starting first day of the month |
Always use the Info on the Schedule window to validate the expression entered.
Monitoring workflows
Workflows are monitored in the New UI experience. If you are in the Classic UI, navigate to Automation > Workflow Executions and click Try new experience. This takes you to the Automation page in the new UI.
There are three parts to the Automation page:
- Failed steps that require an action: You can click on the record number for the workflow, which opens the exectution details. You can then take action to fix the failure. There are also Retry,
Skip and
Stop buttons.
- Steps awaiting user input: Any workflow that requires user input will be listed here. Click on the button in the Action column to provide the necessary input.
- Currently running executions: This section lists all currently running workflow executions. Click on the record number to open the execution details and monitor the progress of the workflow. This is in the Classic UI. You'll be able to see workflow progress, its status, and other information. You can also stop the workflow by clicking
in the Action column.
If a workflow is executing a step and the Stop button is clicked, most workflow steps cannot be interrupted and will continue processing. Subsequent steps won't be started after a stop is issued though.
Dealing with errors
If a workflow step is configured with an On Failure value of Stop - Ask to resume or a Retry and the step fails with an error, the workflow pauses and asks the user how to deal with this situation.
The user can click the Stop to completely stop the workflow or the Resume to be then given the choice of skipping this step (useful if the action can be performed manually) or the step can be retried again if the error was caused by a temporary failure or can be addressed by altering the workflow parameters. See Changing Variables.
Changing variables
If a workflow is paused, either by a manual step or if a step fails and is asking how the failure can be solved, you can use the Change variables toolbar to inspect and change the values of the workflow inputs (entered to start the workflow) and the already executed step results that will be used in subsequent steps so that you can correct an entry.
This is very useful when running larger workflows and you realize you have incorrectly entered a password or file location that has caused an error.
Caution should be taken when editing a step output in this mode to ensure the correct format is used to prevent further unexpected errors.