<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Delay send email action based on a variable input in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Delay-send-email-action-based-on-a-variable-input/m-p/301098#M2637</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I've a workflow with two actions. First is a JS action that returns an output like this one:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;delay_seconds = 300
recipients = [
 {
  "to": user.one@company.com
 },
 {
  "to": user.two@company.com
 }
]&lt;/LI-CODE&gt;
&lt;P&gt;Second is an email action. It uses result("js_action")["delay_seconds"] in "wait before" option. And it uses&amp;nbsp;result("js_action")["recipients"] in "loop task" option.&lt;/P&gt;
&lt;P&gt;This works as expected. Both users receive email after a delay of 300 seconds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I need to modify the workflow so that js_action returns an output like this one instead:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;recipients = [
 {
  "delay_seconds": 300
  "to": user.one@company.com
 },
 {
  "delay_seconds": 500
  "to": user.two@company.com
 }
]&lt;/LI-CODE&gt;
&lt;P&gt;But with this change I'm not able to use&amp;nbsp;_.item["delay_seconds"] in "wait before" option.&lt;/P&gt;
&lt;P&gt;How can I achieve this use case? User one should receive email with delay of 300s while user two should receive email with 500s delay.&lt;/P&gt;
&lt;P&gt;This is simplification of the real use case. I want to avoid creating 100s of workflows (1 per user or team). Instead I want user to define their preferences in ownership object and use workflow to notify them as per their preferences.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2026 05:49:21 GMT</pubDate>
    <dc:creator>intact658</dc:creator>
    <dc:date>2026-06-24T05:49:21Z</dc:date>
    <item>
      <title>Delay send email action based on a variable input</title>
      <link>https://community.dynatrace.com/t5/Automations/Delay-send-email-action-based-on-a-variable-input/m-p/301098#M2637</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I've a workflow with two actions. First is a JS action that returns an output like this one:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;delay_seconds = 300
recipients = [
 {
  "to": user.one@company.com
 },
 {
  "to": user.two@company.com
 }
]&lt;/LI-CODE&gt;
&lt;P&gt;Second is an email action. It uses result("js_action")["delay_seconds"] in "wait before" option. And it uses&amp;nbsp;result("js_action")["recipients"] in "loop task" option.&lt;/P&gt;
&lt;P&gt;This works as expected. Both users receive email after a delay of 300 seconds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I need to modify the workflow so that js_action returns an output like this one instead:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;recipients = [
 {
  "delay_seconds": 300
  "to": user.one@company.com
 },
 {
  "delay_seconds": 500
  "to": user.two@company.com
 }
]&lt;/LI-CODE&gt;
&lt;P&gt;But with this change I'm not able to use&amp;nbsp;_.item["delay_seconds"] in "wait before" option.&lt;/P&gt;
&lt;P&gt;How can I achieve this use case? User one should receive email with delay of 300s while user two should receive email with 500s delay.&lt;/P&gt;
&lt;P&gt;This is simplification of the real use case. I want to avoid creating 100s of workflows (1 per user or team). Instead I want user to define their preferences in ownership object and use workflow to notify them as per their preferences.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2026 05:49:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Delay-send-email-action-based-on-a-variable-input/m-p/301098#M2637</guid>
      <dc:creator>intact658</dc:creator>
      <dc:date>2026-06-24T05:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Delay send email action based on a variable input</title>
      <link>https://community.dynatrace.com/t5/Automations/Delay-send-email-action-based-on-a-variable-input/m-p/301124#M2640</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/57588"&gt;@intact658&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "Wait before" option is evaluated once for the entire task, not per loop iteration so _.item["delay_seconds"] won't work there.&lt;/P&gt;&lt;P&gt;You can go with Group by delay + Run Workflow action, I mean JS action groups recipients by delay_seconds, then loop through groups using Run Workflow action to trigger a child workflow per delay group. The child workflow has the email action with "wait before" set from the input parameter.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sujit&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2026 00:30:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Delay-send-email-action-based-on-a-variable-input/m-p/301124#M2640</guid>
      <dc:creator>sujit_k_singh</dc:creator>
      <dc:date>2026-06-24T00:30:56Z</dc:date>
    </item>
  </channel>
</rss>

