Summarize open problems with Davis CoPilot in Workflows

  • Tutorial
  • 4min
  • Published Apr 07, 2025

Preview

With Davis CoPilot in Workflows, you can automate problem summarization and ask Davis CoPilot to suggest remediation steps that can be sent to your email.

Target audience

This guide is written for:

  • Operations engineers
  • Pipeline engineers
  • Systems engineers
  • Site reliability engineers (SREs)
  • Build automation engineers

Scenario

Let’s assume you want to automate analyzing new problems and get immediate suggestions for resolving the issue. To do this, you need to create a workflow that uses Davis CoPilot to summarize all open problems and automatically suggest the best way to remediate them. When a new problem is opened, the workflow will automatically run, and the Davis CoPilot response will be sent to your email.

Before you begin

Prerequisites

To use Davis CoPilot in Workflows, ensure that you have:

  • Conversational recommender (ALLOW davis-copilot:conversations:execute;) permission.
  • Installed Davis CoPilot for Workflows.

Steps

  1. Go to Workflows Workflows.
  2. Select Workflow to create a new workflow.
  3. From Event triggers, select a Davis problem trigger.
  4. Configure the fields:
    • Set the Event state to active.
    • Set the Event category to Custom.
    • Set Affected entities to include entities with all defined tags below.
    • Set Additional custom filter query to
      matchesPhrase(event.name, "Host cpu stateful anomaly detector 1h")

      This example demonstrates filtering for a specific problem. However, you can apply a filter to include all new problems as well.

An example of setting a Davis Problems trigger for new problems

  1. Select Add task.
  2. In the search field, enter Run JavaScript, or select Run JavaScript from the list of the Workflows Workflow actions. For more information about the JavaScript workflow action, see Run JavaScript action for Workflows.
  3. Enter the workflow task name.
  4. In the Input tab, enter the following Source code:
    import { execution } from '@dynatrace-sdk/automation-utils';
    export default async function ({ executionId }) {
    const ex = await execution(executionId);
    let rawEvent = ex.params.event;
    let problemDescription = rawEvent["event.description"];
    return {
    description : rawEvent["event.description"],
    problem_id : rawEvent["display_id"]
    };
    }

An example of setting a javascript action to extract problem details

  1. Select Add task.
  2. In the search field, enter Davis CoPilot, or select Prompt Davis CoPilot from the list of the Workflows Workflow actions.
  3. Configure Davis CoPilot:
    • In the Prompt field, enter the following prompt:
      A new Davis Problem with id {{result("extract_problem_details").problem_id}} has just been opened. Please provide a summary of what happened and actionable steps to remediate it. Provide output as plain text without any formatting or markdown
    • In the Additional context field, enter the following:
      Use the following information about the Davis Problem with Id {{result("extract_problem_details")["problem_id"]}}:
      """
      {{result("extract_problem_details")["description"]}}
      """
    • Enable Auto-trim.
    • Set Document retrieval to Disabled.

And example of setting a Davis CoPilot action for summarizing new problems

  1. Select Add task.
  2. In the search field, enter Send email, or select Email for Workflows Send email from the list of the Workflows Workflow actions. For more information about the Email workflow actions, see Email Connector.
  3. Enter the workflow task name.
  4. Configure the fields:
    • In Configure email > Recipients, set the To field to your email address. If you want to add more than one email address, use ; to separate them.
    • In the Content, Subject field, enter the following text:
      New Davis Problem {{ result("extract_problem_details")["problem_id"] }} started
    • Set the Message field to the following:
      A Davis Problem with ID {{ result("extract_problem_details")["problem_id"] }} has been opened.
      Davis CoPilot has analyzed it and provided the following information:
      {{ result("analyze_problem_with_davis_copilot")["text"] }}

An example of configuring an email to send DavisCoPilot results

  1. Select Save.
  2. Select Run to test the workflow.

Once a new problem appears, you should receive an email from no-reply@dev.apps.dynatracelabs.com. You can see the example of the message content below:

An example of an email from CoPilot in workflows use case