Open Q&A
If there's no good subforum for your question - ask it here!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Send a json file via email using workflows

elenaperez
Dynatrace Guide
Dynatrace Guide

Hi team 😊

I have a workflow with a variable that contains a lot of information I want to send via email.

The information is too large to be sent via email directly so I need a json file to be sent. I don't see a way to attach files though.

What is the best way to do this? I've tried with Power Automate and Microsoft Entra but don't have enough permissions.

Maybe via FTP? But how?

Thanks in advance!

7 REPLIES 7

sujit_k_singh
Champion

Hi @elenaperez 

The built-in Send Email action in Dynatrace Workflows does not support file attachments  it only supports sending text/Markdown content in the email body, this is a known limitation.

The most reliable workaround: use the built-in HTTP Request action to call an external email API that supports attachments , encoding your JSON variable into the payload. Store the API key in the Credential Vault. This sidesteps the Power Automate/Entra permissions issue since you're not going through Microsoft at all.

Or 2nd approach could be, use HTTP Request to upload the JSON somewhere accessible (S3, Blob Storage or a file server.) then use the Send Email action to send a link to the file rather than the file itself.

Thanks,

Sujit

Dynatrace Professional Certified

I don't think I understand the solution. Where do I get the external email API from?
Could you provide an example of how you would do this, please?

Hi @elenaperez 

Sure, this is absolutely possible using Dynatrace Workflows. Here's how I've done it:

I have used here HTTP Request action with SendGrid API

Step 1: Generate JSON data (JavaScript action) sample example 

 

sujit_k_singh_2-1784337913446.png

Step 2: Send email with attachment (HTTP Request action)
Method: POST
URL: https://api.sendgrid.com/v3/mail/send
Authentication: Bearer token (store your SendGrid API key in Credential Vault)
Payload:

sujit_k_singh_4-1784338092761.png

 

Store your API key in Dynatrace Credential Vault

sujit_k_singh_5-1784338221035.png

now run the flow

This approach works for any JSON data — problem notifications, metric exports, custom reports, etc.

sujit_k_singh_6-1784338355852.png

sujit_k_singh_7-1784338427054.png

 

Now i got this email with attachment

sujit_k_singh_0-1784337729539.png

Thanks,

Sujit

Dynatrace Professional Certified

This won't be possible for them because their email blocks anything coming from SendGrid.
Would it be possible to send the json to an Ubuntu machine somehow? Maybe with EdgeConnect?

Hi @elenaperez 

Yes, its possible.

I tested this on my end — it works! Here's what I did:

  • Dynatrace tenant with EdgeConnect configured to reach my Ubuntu machine
  • Simple Flask webhook listener on the Ubuntu box (port 5000)
  • Dynatrace Workflow: On demand trigger → Run JavaScript (generate JSON) → HTTP Request (POST to webhook via EdgeConnect)

 

sujit_k_singh_1-1784632311812.png

 

sujit_k_singh_3-1784632400563.png

 

 

sujit_k_singh_2-1784632374326.png

 

Thanks,

Sujit

 

 

 

Dynatrace Professional Certified

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

Maybe this can be a product idea.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

sujit_k_singh
Champion

Hello,

Yes, this is right use case for product idea.

Thanks,

Sujit

Dynatrace Professional Certified

Featured Posts