const response = await axios.get(
  "https://economia.awesomeapi.com.br/last/USD-BRL"
);
payload.dollar = response.data;

It is important to note that Execute JavaScript has some technical limitations designed to ensure safe usage and dynamic code execution. These restrictions guarantee that scripts are processed efficiently, enabling the creation of customized solutions without compromising the overall system performance. Below, we document the main limitations and supported libraries of this functionality:

  1. HTTP Requests: HTTP requests are allowed through the Axios library, as demonstrated in the following example:

Example of an HTTP request using Axios:

const response = await axios.get('https://economia.awesomeapi.com.br/last/USD-BRL');
payload.dollar = response.data;
const response = await axios.get(
  "https://economia.awesomeapi.com.br/last/USD-BRL"
);
payload.dollar = response.data;
  1. Maximum Memory Limit of 128MB: The Execute JavaScript function has a memory limit of 128MB. This ensures efficient processing and prevents system overload.
  2. Maximum Execution Time of 60 Seconds: Each execution of Execute JavaScript is limited to a maximum of 60 seconds. If the script exceeds this time limit, execution will be automatically interrupted to maintain the stability of the runtime environment.
  3. Available Libraries: In addition to the Axios library, Execute JavaScript also supports the following libraries: CryptoJS and Moment.js.
    • CryptoJS: A library for hashing, encryption, and decryption — ideal for securely handling sensitive data.
    • Moment.js: A library for date and time manipulation, analysis, and formatting, including time zones and interval calculations.