<?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 Error: Do not use results for passing bulk data in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Error-Do-not-use-results-for-passing-bulk-data/m-p/222776#M43</link>
    <description>&lt;P&gt;I have a code like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;export default async function ({ execution_id }) {
    // get and verify event context
    console.log("Get and verify event context")
    var exec_req = await fetch(`/platform/automation/v1/executions/${execution_id}`)
    var execution_obj = await exec_req.json()
    if (!'event' in execution_obj.params) {
        return { problem: null }
    }
    var event = execution_obj.params.event

    // get problem details
    console.log("Loading Problem details...")
    var problem_request = { problemId: event['event.id'] }
    var problem = await problemsClient.getProblem(problem_request)

    return { problem }
    &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the error is:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;An error occurred: Action result is too large. Do not use results for passing bulk data.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the last line, &lt;STRONG&gt;return&lt;BR /&gt;&lt;/STRONG&gt;What other ways are there to return a large result in wokflows?&amp;nbsp;I am trying to get an answer in this documentation&amp;nbsp;&lt;A href="https://developer.dynatrace.com/develop/workflows/" target="_blank" rel="noopener"&gt;https://developer.dynatrace.com/develop/workflows/&lt;/A&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Many thanks&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2023 09:13:51 GMT</pubDate>
    <dc:creator>Duran_Narbona</dc:creator>
    <dc:date>2023-09-12T09:13:51Z</dc:date>
    <item>
      <title>Error: Do not use results for passing bulk data</title>
      <link>https://community.dynatrace.com/t5/Automations/Error-Do-not-use-results-for-passing-bulk-data/m-p/222776#M43</link>
      <description>&lt;P&gt;I have a code like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;export default async function ({ execution_id }) {
    // get and verify event context
    console.log("Get and verify event context")
    var exec_req = await fetch(`/platform/automation/v1/executions/${execution_id}`)
    var execution_obj = await exec_req.json()
    if (!'event' in execution_obj.params) {
        return { problem: null }
    }
    var event = execution_obj.params.event

    // get problem details
    console.log("Loading Problem details...")
    var problem_request = { problemId: event['event.id'] }
    var problem = await problemsClient.getProblem(problem_request)

    return { problem }
    &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the error is:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;An error occurred: Action result is too large. Do not use results for passing bulk data.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the last line, &lt;STRONG&gt;return&lt;BR /&gt;&lt;/STRONG&gt;What other ways are there to return a large result in wokflows?&amp;nbsp;I am trying to get an answer in this documentation&amp;nbsp;&lt;A href="https://developer.dynatrace.com/develop/workflows/" target="_blank" rel="noopener"&gt;https://developer.dynatrace.com/develop/workflows/&lt;/A&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 09:13:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Error-Do-not-use-results-for-passing-bulk-data/m-p/222776#M43</guid>
      <dc:creator>Duran_Narbona</dc:creator>
      <dc:date>2023-09-12T09:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow: Do not use results for passing bulk data</title>
      <link>https://community.dynatrace.com/t5/Automations/Error-Do-not-use-results-for-passing-bulk-data/m-p/222777#M44</link>
      <description>&lt;P&gt;I forgot to mention, I need to return the information for use in another workflow task.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 08:05:48 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Error-Do-not-use-results-for-passing-bulk-data/m-p/222777#M44</guid>
      <dc:creator>Duran_Narbona</dc:creator>
      <dc:date>2023-09-12T08:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Do not use results for passing bulk data</title>
      <link>https://community.dynatrace.com/t5/Automations/Error-Do-not-use-results-for-passing-bulk-data/m-p/222859#M45</link>
      <description>&lt;P&gt;The "Action result is too large" error typically occurs when you're trying to return a very large object or a result that exceeds the allowed size limit for the response. To resolve this issue, you can take the following steps:&lt;/P&gt;&lt;P&gt;1. Check the Size of `problem`: Since the error message mentions "Action result," it's likely that the `problem` object being returned is too large. You should inspect the size of the `problem` object and its nested properties.&lt;/P&gt;&lt;P&gt;2. Reduce the Size of `problem`: If the `problem` object is indeed too large, consider whether you can reduce its size by excluding unnecessary data. You might only need specific properties of the problem rather than the entire object.&lt;/P&gt;&lt;P&gt;3. Pagination: If the `problem` object contains a list of items or records (e.g., a list of comments or attachments), consider implementing pagination to fetch and return smaller subsets of data at a time.&lt;/P&gt;&lt;P&gt;4. Compress Data: If the data cannot be reduced further, you can consider compressing it before sending it as a response. JavaScript provides libraries and functions for data compression, such as `zlib` or `pako`, depending on your environment.&lt;/P&gt;&lt;P&gt;Here's an example of how you might apply compression to the response:&lt;/P&gt;&lt;P&gt;```javascript&lt;BR /&gt;import zlib from 'zlib';&lt;/P&gt;&lt;P&gt;export default async function ({ execution_id }) {&lt;BR /&gt;try {&lt;BR /&gt;// ... (fetching and processing data)&lt;/P&gt;&lt;P&gt;// Compress the problem data&lt;BR /&gt;const compressedProblem = zlib.deflateSync(JSON.stringify(problem));&lt;/P&gt;&lt;P&gt;return { compressedProblem };&lt;BR /&gt;} catch (error) {&lt;BR /&gt;console.error("An error occurred:", error);&lt;BR /&gt;return { compressedProblem: null };&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;5. Consider Streamlining: If you're working with extremely large datasets, consider a different approach that doesn't involve returning the entire dataset in a single response. For instance, you might implement streaming or provide options for users to request specific parts of the data.&lt;/P&gt;&lt;P&gt;Remember to adjust the client-side code that consumes this function to handle the compressed data appropriately.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 21:07:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Error-Do-not-use-results-for-passing-bulk-data/m-p/222859#M45</guid>
      <dc:creator>natanael_mendes</dc:creator>
      <dc:date>2023-09-12T21:07:11Z</dc:date>
    </item>
  </channel>
</rss>

