Latest Dynatrace
Building workflows goes hand in hand with running them. For example:
Running a workflow creates an execution. An execution has all the details about the state of each task of the workflow that is run. Each task executes an action with a given input and might produce a result.
Let's take a closer look at the concepts involved while running a workflow.
A workflow execution is the instantiation of a workflow. There can be as many executions of a workflow running at any given time as requested (within system capacity). A workflow execution is triggered manually via Workflows, automatically via an API call, a trigger event, or according to schedule.
A running workflow processes its tasks as defined by the workflow structure, which results in task executions.
Execution logs for simple workflows are visible only for a limited time. The Executions page does not display a history for these workflows. For more details on simple workflows, refer to Create a simple workflow in Dynatrace Workflows.
These are all possible workflow execution states.
Running
Success
Error
Canceled
A task execution is the instantiation of a task within a workflow. It runs an action with the defined input and might return a result.
A running task always has at least one action execution. In the case of task retries or loop configurations, triggering multiple action executions might happen. The outcome of the task executions defines the final state of the workflow execution.
These are all possible task execution states.
Idle
Running
Success
Error
Skipped
Discarded
Canceled
An action execution is the instantiation of an action (see Integrations). Invocation happens with the inputs defined on the task. Depending on the inputs and action implementation, it will either succeed or fail and might produce a result. For the processing of actions, the limitations for functions in the AppEngine apply. Action execution results can never be larger than 1 MB. The AutomationEngine is designed as a process orchestrator and isn't suitable as a data pipeline. Results larger than the limit will cause the task to fail. In case you need to work with data larger, you may want to use a custom JavaScript task to pull and store the data directly in its final destination.
The outcome of the action executions defines the behavior and final state of the task execution.
These are all possible action execution states.
Running
Success
Error
The loop task option makes it possible for a task to iterate over a list of items.
While there is only a single task execution, there is an action execution for each iteration. The implications for a task are the following.
Success
if all action executions succeed or Error
if at least one failed.The retry on error task option will retry a task based on a defined number of attempts and wait between retries by the given delay.
While there is only a single task execution, there is an action execution for each retry attempt. The implications for a task are the following:
Success
with the first successful action execution and Error
in case none succeeds.There is an option to combine loop task and retry on error.
The task timeout always applies.
Execution information is retained for 30 days from the start date of the execution. This is valid for workflow, task, and action execution information.
This also implies a workflow execution timeout of 30 days. After this period, no further processing will happen, as the execution state is purged.
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
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.
When triggering a workflow via the Automation service API, you can provide inputs to the workflow. That is the recommended approach to passing information to the workflow execution.
Find details about the request in the Swagger documentation for the /workflows/{id}/run
endpoint of the Automation service API.
This endpoint expects the following attributes in a JSON payload.
input
: A user JSON object with properties for accessing workflowsparams
: A system JSON object with properties for accessing workflows, for example, passed from automatic event triggersIt's separated from input to avoid collisions with custom input provided via API.
Both are accessible in the workflow via the execution()
expression. E.g execution()['input']['foo']
If you run a workflow or go to an existing execution, you are presented with the execution monitor. In the execution monitor you can see if a task was successful or if it's failed.
The execution monitor consists of the following sections.
The title section shows you the title of the workflow currently or formerly running.
Running
, Success
, or Error
indicates the status of the workflow execution.Below the title section, the execution graph pane shows the workflow, its tasks, and their runtime state.
Under the execution graph 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.
The details pane on the right provides access to the detailed attributes of the execution depending on your selection in the execution monitor pane.
The Detail tab consists of
If you select a specific task, it also shows the action type of the task. Tasks with predecessors (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.
The Input tab gives you access to the inputs and values passed to a task. You will see the evaluated value for any expression used in the input definition. This information, combined with the log and results, forms the audit trail of your execution.
The Params tab is available only 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.
The Result tab is available only if you select a task on the left. It gives you access to the result produced by the selected task.
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.
You can cancel a task so that you don't process all its loop iterations, but you can't actively interrupt and cancel a running task.
Cancelled
.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.
In case you triggered an execution by accident, you always have the option to cancel a running execution. Canceling an execution will cancel all currently running tasks and no further tasks will be started. The execution will end in state Cancelled
.
All running tasks will be completed, but no new tasks will begin, and the execution will end in status Cancelled
.
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.
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.