📘 Advanced Automation with RUN Code in AUTOMY
Knowledge Center — Admin Studio
By Lily Dominguez Guerra ·
This manual will guide you step by step in creating a process using RUN Code, a powerful feature included in AUTOMY’s Digital Transformations Plan.
You do not need to be a programmer: simply describe to the AI what you want to automate, and it will generate the code for you.
Once created, this code does not consume additional tokens when executed within your processes. 🚀 What is RUN Code and what can you do with it? RUN Code is an advanced AUTOMY feature that allows you to execute code within a process.
Thanks to artificial intelligence, this code is automatically generated from instructions written in natural language. warning Tokens are only consumed when generating the code. warning Once created, the code can be reused as many times as necessary without consuming additional tokens. warning The maximum processing time per execution is 10 minutes. warning The maximum supported size per request is 1 GB. quote With RUN Code, you don’t need to know how to program; you need to clearly explain what you want to automate. author AUTOMY Innovation Team 🧠 How to write a good prompt A prompt is the natural language instruction you provide to the AI so it can generate the appropriate code. ✅ What should a good prompt include? 1️⃣ Form and field name Go to: Process Configuration > Forms Copy the internal name of the form.
Then: Options > Fields Copy only the last part of the internal field name.
Example: Use from form internal_name the field task_date 2️⃣ File type and expected structure Clearly specify: File type (.zip, .rar, .xlsx, etc.) Sheet name Expected headers Validations Data types 3️⃣ Expected result Examples: I need you to return a file in PDF format.
Return a table called result with columns: date (dd/mm/yyyy), product (text), total_sales (number).
Return the total value as a number. warning If the result is a table, you must specify the name and type of each column. 📎 Using Attachments in RUN Code 🔹 Dynamic references powerquery {{Form.internal_name.Attachment.internal_name.content}} powerquery {{Form.internal_name.Attachment.internal_name.downloadUrl}} 🔹 Available Properties Property What is it? What is it used for? content File content encoded in base64 Directly process the file inside the code file-name / fileName Original file name Validate extension or use name in logic content-type / contentType File MIME type Validate file type before processing size File size in bytes Validate size or decide strategy downloadUrl Temporary public URL Download file directly (more efficient for large files) warning If the Property is not specified, the default value is file-name. 🚀 Recommendation for large files When working with large files, you must optimize both input (reading) and output (returning) handling. 🔹 1️⃣ For reading large files (Input) warning If the file is large, avoid using content (base64) and use downloadUrl instead.
If not specified, the AI may default to content, which loads the entire file into memory and can cause performance or timeout issues. 📝 Recommended prompt phrase: Read the file using the downloadUrl to improve efficiency and avoid loading large base64 data into memory. ✅ What does this achieve? Reduces memory usage Improves processing speed Lowers timeout risk Increases stability quote When processing large files, how the file is read directly impacts performance and system stability. author AUTOMY Technical Recommendation 🔹 2️⃣ For returning large files (Output) warning If the generated output file is large, it must be compressed into .zip before converting it to base64.
If not explicitly requested, the AI may return the file directly in base64 without compression, increasing the risk of size-limit errors. 📝 Recommended prompt phrase: If the generated file is large, compress it into .zip format before converting it to base64 and return the ZIP encoded in base64. ✅ What does this achieve? Reduces file size Improves performance Minimizes size-limit errors Lowers timeout risk 🔹 Required Mapping…