Automation Utils
Automation utilities.
npm install @dynatrace-sdk/automation-utils
Functions
actionExecution
actionExecution(id?): Promise<ActionExecution>
Retrieves the action execution details for the current workflow.
Parameters
Name | Type | Description |
---|---|---|
id | string | The ID of the action execution to retrieve. If not provided, the ID from the caller service metadata is used. |
Returns
Description |
---|
The action execution details. |
Code example
//To get current action execution detail
import { actionExecution } from '@dynatrace-sdk/automation-utils';
const actionExe = await actionExecution();
Code example
//To get loopItem from current action execution
import { actionExecution } from '@dynatrace-sdk/automation-utils';
const actionExe = await actionExecution();
const loopItem = actionExe.loopItem;
// or
const { loopItem } = actionExe;
execution
execution(id?): Promise<IExecution>
Retrieves the execution details for the current workflow.
Parameters
Name | Type | Description |
---|---|---|
id | string | The ID of the execution to retrieve. If not provided, the ID from the caller service metadata is used. |
Returns
Description |
---|
The execution details. |
Code example
//To get current execution detail
import { execution } from '@dynatrace-sdk/automation-utils';
const exe = await execution();
Code example
//To get event context from current execution
import { execution } from '@dynatrace-sdk/automation-utils';
const exe = await execution();
const eventContext = exe.event();
Code example
//To get current task execution result
import { execution } from '@dynatrace-sdk/automation-utils';
const exe = await execution();
const result = await exe.result();
getExecutionLink
getExecutionLink(): null | string
Returns
Description |
---|
The link to a workflow execution, or null if called within a simple workflow or outside a workflow. |
getTaskExecutionLink
getTaskExecutionLink(): null | string
Returns
Description |
---|
The link to a workflow execution, including the currently executed task name, or null if called within a simple workflow or outside a workflow. |
getWorkflowLink
getWorkflowLink(): null | string
Returns
Description |
---|
The link to a workflow, or null if called outside a workflow. |
result
result(predecessorTaskName): Promise<any>
Retrieves the result of a task execution in the current workflow.
Parameters
Name | Type | Description |
---|---|---|
predecessorTaskName*required | string | The name of the predecessor task. |
Returns
Description |
---|
The result of the predecessor task execution. |
Code example
//To get a predecessor task execution's result
import { result } from '@dynatrace-sdk/automation-utils';
const taskExecutionResult = await result('predecessor_task_1');
Constants
actionExecutionId
ID of the running action execution.
executionId
ID of the running execution.
taskName
Name of the running task.
workflowId
ID of the running workflow.
Still have questions?
Find answers in the Dynatrace Community