Homeโ€บโš™๏ธ Track 4: Automate & Governโ€บModule 132 min read ยท 14/21

Workflows

Tutorial

Workflows

Workflows are the automation engine โ€” they react to events, run on schedules, and connect Dynatrace to external systems like email, Slack, Jira, and AWS.

Anatomy of a Workflow

Trigger โ†’ Task 1 โ†’ Task 2 โ†’ Task 3
  โ†“         โ†“         โ†“         โ†“
What starts  DQL query  Format    Send email
the workflow            results

Trigger Types

Trigger             What Starts It                          Use Case
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Davis problem       New or reopened problem                  Alert notifications
Davis event         Any Davis event                         Fine-grained handling
Schedule            Time-based (cron, interval, fixed)      Daily reports, weekly trends
On demand           Manual "Run" button                     Testing, ad-hoc

Available Connectors

Connector                What It Does
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Email                    Send email notifications
Slack                    Send Slack messages
Jira                     Create/update Jira issues
Microsoft Teams          Send Teams messages
ServiceNow               Create incidents
PagerDuty                Trigger pages
AWS                      Lambda, S3, EC2 operations
Kubernetes               Query/manipulate K8s resources
GitHub / GitLab          Create issues, trigger pipelines
HTTP Request             Call any REST API
DQL Query                Run DQL and use results
JavaScript               Custom logic, formatting

Building a Problem Notification Workflow

  1. Ctrl+K โ†’ "Workflows" โ†’ Create new
  2. Trigger: Davis problem
  3. Add task: Send email
  4. Subject: {{ event()["event.name"] }}
  5. Body: Problem details with Jinja expressions
  6. Save โ†’ the workflow fires on every new problem

Jinja Expressions

// Access trigger event data
{{ event()["event.name"] }}
{{ event()["display_id"] }}

// Access previous task results
{{ result("query_task").records[0].hostname }}

// Conditional logic
{% if result("check").value > 90 %}CRITICAL{% else %}OK{% endif %}

Service User Actors

Workflows should run as a service user, not a personal account:

Step  Action
โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1     Create service user (Account Management โ†’ IAM)
2     Create policy with required scopes
3     Bind policy to service user's group
4     Set service user as workflow actor

โš ๏ธ Set actor (who tasks run as), NEVER owner (who controls the workflow). Setting owner to a service user permanently locks you out.

๐Ÿ›  Try it: Open Ctrl+K โ†’ "Workflows" โ†’ click "+ Workflow" โ†’ add a trigger (try "Schedule" โ†’ daily at 09:00) โ†’ add a task ("Execute DQL query" โ†’ fetch dt.entity.host | summarize count()). You just built your first automation.

Run JavaScript Action Limits

When using custom JavaScript tasks in workflows, be aware of these hard limits:

Limit                    Value
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Execution timeout        120 seconds (NOT extendable)
RAM                      256 MB
Script size              ~5 MB (including context)
Result size              6 MB
Result type              JSON only (no binary)
HTTP calls               Must be on global allowlist

โš ๏ธ Never return secrets in JS task results โ€” they're visible to anyone with read access to the workflow.