How do I test in a workflow task how I am triggered?

Hello “workflow friends”,

Can you select to run a task based on the trigger e.g. “Manual trigger or Event trigger”.

Or can I select this within the js?

KR Henk

Hello,

If you want to know what type of trigger the workflow is using, it is shown in the label on the first tile.

If you set an event trigger, you still have the option to manually trigger an execution by hitting “Run” at the top.

Thanks

Hello  Cameron-Leong,

Thanks for your reply!

But what I like to know if the same information is available from within the workflow e.g.

If you have a manual trigger, can you skip a task based on this info,

Thanks Henk

The team provided a solution via a JS task that looks promising to me:

import { executionsClient } from "@dynatrace-sdk/client-automation"; export default async function ({ execution_id }) { const executionInfo = await executionsClient.getExecution({ id: execution_id, }) return { triggerType: executionInfo.triggerType }; }

The result would be a property named triggerType with a value like Manual .If you like to do it with the automation-utils, you could also write

import { execution } from '@dynatrace-sdk/automation-utils'; export default async function ({ execution_id }) { const ex = await execution(execution_id); return { triggerType: ex.triggerType }; }

In following actions you can add the conditions referencing to the result of this JS action.Does that help?

Wolfgang.

Yes this will help (-; Thanks to you and the team,

KR Henk