Run and monitor workflows
Latest Dynatrace
Building workflows goes hand in hand with running them. For example:
- You add a new task or change a task, and now you would like to try your changes and run the workflow.
- You want to look into executions, that happened or are still ongoing, and inspect the status or outcome.
Running a workflow creates an execution. An execution has all the details about the state of each task of the workflow that is run.
Run a workflow
A workflow can be run manually via the Workflows App, via an API request, or via a trigger event or schedule.
To run a workflow manually
- List the available workflows. This is the default view when you start the Workflows app.
- Do one of the following:
- In the table, find the workflow, open the
menu, and select Run workflow.
- In the table, select the workflow name to open it, and then select Run.
- In the table, find the workflow, open the
- optional If the workflow has an event trigger defined, you'll be presented with a dialog where you can adjust the event context as you see fit. To confirm your changes, select Run.
- The execution monitor opens and displays the current state of the execution.
A workflow always runs with a user context, the actor. You can find the actor of a workflow in the workflow settings ( in the workflow editor). By default, the last editor of a workflow is the actor.
You can control which permissions you authorize the workflow service to use if your user is the actor. The workflow authorization setting is available via the Settings menu in the upper-right corner of the Workflows app.
Running your first workflow for the first time in an environment requires you to configure the authorization setting for the workflow service. In a modal, you need to authorize the workflow service. Opting for the default option (Allow and run), your user's permissions are granted to the workflow service. You can return to the authorization setting to make a more restrictive configuration at any time.
The workflow service can never exceed the permissions of your actual user, no matter the authorization settings.
Execution monitor
If you run a workflow or open an existing execution, you are presented with the execution monitor. The execution monitor consists of the following sections.
Title section
The title section shows you the title of the workflow that is running or did run. Next to the title, a badge will indicate the status of the execution itself (RUNNING, SUCCESS, ERROR). On the right-hand side, you find options to switch to the workflow editor, cancel a running execution, refresh the data, re-run the last execution, or open the execution history of the workflow.
Execution monitor pane
The execution monitor pane shows the workflow, its tasks, and their runtime state. Color and status label on the task node indicate the task's status. Task nodes also display the runtime once they're in a final state. Selecting the trigger node or task nodes updates the details and log pane with the details of the selection.
Log pane
The log pane shows the output of a task produced during its execution. The log should give you an idea of what happened during the task processing and provide details for analysis in case of an error.
Details Pane
The details pane on the right-hand side provides access to the detailed attributes of the execution depending on your selection in the execution monitor pane. Selecting the trigger node, gives access to the attributes of the workflow itself like details, input, and params. Selecting one of the tasks switches the details pane to attributes of this task like details, input, or result.
Details
Here you find information about status, additional state info, start and end-time, and runtime. If you select a specific task, it also shows the action type of the task. Tasks with predecessors (i.e., not tasks directly connected to the trigger) also show the conditions and their evaluation results to let you analyze in detail why a task ran or not.
Input
The Input tab gives you access to the inputs and values passed to a task. This information, combined with the log and results, forms the audit trail of your execution.
Params
This tab is only available for the workflow when selecting the trigger. It provides access to the parameters passed to the execution, for example, the event context in case the execution was triggered by one.
Result
This tab is only available if you select a task on the left. It gives you access to the result produced by a task.
Monitor an execution
If you open an execution by running a workflow or open a monitor of an existing execution, the execution monitor shows. The execution monitor will refresh itself until the execution has reached a final state (SUCCESS
, ERROR
). You can discover more details in the monitor by selecting individual tasks and looking at their output in the log pane and their attributes in the details pane.
To actively change the state of an execution or an individual task, see the sections below.
Cancel an Execution
In case, for example, you triggered an execution by accident, you always have the option to cancel a running execution. Canceling an execution will make all currently running tasks complete, but no further tasks being started. The execution will end in state CANCELLED
.
- Open executions from the top navigation.
- Select
> Cancel execution in the execution list or the upper right of the execution monitor
- All running tasks will complete, but no new tasks will start, and the execution will end in status
CANCELLED
Cancel a Task
You can intentionally cancel a task to, for example, not process all its loop iterations. You can NOT actively interrupt and cancel an already running task. The running task will be processed but will end in CANCELLED. Further processing of the workflow and successor tasks depends on their conditions configuration (for example, "run if success", or the opposite, "run if error or canceled")
- Open executions from the top navigation
- Select the execution from the list to open the execution monitor
- Select the task from the execution monitor pane you want to cancel
- Select Cancel task in the details pane
- The task will keep processing (for looped tasks, its current iteration only), but end in
CANCELLED
. Further processing of the workflow depends on task conditions configurations.
Repeat an Execution
During development, or to recover from a failure/incomplete state in third party systems, you might want to repeat an existing execution. There might be this event trigger that is hard to reproduce, where it would be handy if you could repeat the execution, after you made some changes to the workflow. Re-run means you want to leverage the input and params configuration of the original execution.
- Open executions from the top navigation
- Select
> Re-run execution context menu entry in the list of executions or in the execution monitor
- If the workflow defines an event trigger, you'll be presented the event context as it was for the original execution. Adjust the values as you see fit and confirm with Run.
In case you used expressions like {{ event() }}
and you repeat an execution that was triggered by an event trigger, the expressions will have access to the event context from the original execution.