Skip to content

Heptora Language Reference

This manual will guide you through the fundamental concepts and best practices for creating robust and secure business automations using Heptora’s proprietary language.

Heptora’s language is designed for simplicity and security. It’s based on C#, but with a key restriction:

  • Declarative over imperative: Define what to do, not how to do it
  • Secure by default: Restrictions prevent common errors
  • Modular: Reusable blocks instead of monolithic code
  • Auditable: Every action is logged automatically

Below are all the functions you can use to build your automations.


Functions to interact with the logging system.

void heptora.log.info(string message)

Description: Sends an informative log message. Useful for recording process progress and milestones.

Parameters:

  • message (string): The informative message to log

Example:

heptora.log.info("Starting invoicing process.");
heptora.log.info("Processing client: " + clientName);

void heptora.log.result(string messageType, string message)

Description: Logs a final process result, which can be ok, ko, or error.

Parameters:

  • messageType (string): Result type: "ok", "ko", or "error"
  • message (string): Result description

Example:

heptora.log.result("ok", "Report generated successfully.");
heptora.log.result("ko", "Invoice already marked as paid.");
heptora.log.result("error", "Could not connect to server.");

void heptora.log.force_ko(string message)

Description: Logs a controlled KO in execution and stops processing the current record.

Example:

heptora.log.force_ko("Invoice number is incorrect");

Functions to manage attachments sent at process execution completion.

void heptora.report.add_attachment(string filePath)

Description: Attaches a file to the current execution. This file will also be sent as an attachment in the execution summary email.

Example:

heptora.report.add_attachment("C:\\temp\\final_report.xlsx");

Functions for web browser automation.

void heptora.browser.open()

Description: Opens a persistent Chromium browser instance, ready for automation.


void heptora.browser.open_private()

Description: Opens a persistent Chromium browser instance in private/incognito mode.


void heptora.browser.go_to(string url)

Description: Navigates to a specific URL in the active browser page.

Example:

heptora.browser.go_to("https://myportal.com/login");
heptora.time.pause(3);

void heptora.browser.solve_captcha()

Description: Automatically solves the captcha on the current browser page.


Functions to read and write Excel files.

List<Dictionary<string, object>> heptora.excel.load(
string filePath,
string sheetName,
List<string> columns,
bool hasHeader
)

Description: Loads data from an Excel spreadsheet.

Returns: A list of dictionaries, where each dictionary represents a row.

Example:

List<string> columnsToProcess = new List<string> { "Name", "Email", "Phone" };
List<Dictionary<string, object>> data = heptora.excel.load(
"C:\\data\\clients.xlsx",
"Sheet1",
columnsToProcess,
true
);
heptora.data.set("clients", data);

void heptora.excel.write(
List<Dictionary<string, object>> excelData,
string filePath,
string sheetName
)

Description: Writes a data collection to an Excel file, creating or overwriting the file.

Example:

heptora.excel.write(newClients, "C:\\reports\\new_clients.xlsx", "January");

Functions to control execution pace.

void heptora.time.pause(double? time = null)

Description: Pauses execution for a specific number of seconds.

Example:

heptora.time.pause(3.5); // Pause for 3.5 seconds

Functions to automate Windows desktop applications.

void heptora.windows.open_app(string path)

Description: Opens an application, maximizes it, and brings it to the front.

Example:

heptora.windows.open_app("notepad.exe");

void heptora.windows.type(string text)

Description: Simulates typing text, character by character.

Example:

heptora.windows.type("This is automatic text.");

void heptora.windows.press(params string[] keys)

Description: Simulates pressing one or more keys.

Examples:

heptora.windows.press("enter");
heptora.windows.press("control", "s"); // Ctrl+S
heptora.windows.press("alt", "f4"); // Alt+F4

void heptora.windows.click_by_vision(string base64Image)

Description: Searches for an image (base64 encoded) on screen and clicks on it.


void heptora.windows.alert(string message)

Description: Shows a simple dialog with an informative message to the user.


void heptora.beta.windows.press_macro(
string requiredKey1,
string requiredKey2,
params string[] optionalKeys
)

Description: Simulates a complex keyboard shortcut with multiple simultaneous keys.

Example:

heptora.beta.windows.press_macro("control", "shift", "escape"); // Task Manager

Functions to pass data between process blocks.

void heptora.data.set(string name, object value)

Description: Stores a value with a unique name that can be retrieved in later blocks.

Examples:

heptora.data.set("clientName", "Ana García");
List<string> products = new List<string> { "Laptop", "Mouse" };
heptora.data.set("shoppingList", products);

object? heptora.data.get(string name)

Description: Retrieves a previously saved value with heptora.data.set().

Returns: The stored value as object?. Requires casting to the original type.

Examples:

string name = (string)heptora.data.get("clientName");
List<string> products = (List<string>)heptora.data.get("shoppingList");

Divide large processes into smaller, reusable blocks.

Example structure:

  • Block 1: “Login”
  • Block 2: “Process Invoice”
  • Block 3: “Send Notification”

Record key steps of your automation with heptora.log.info().

heptora.log.info("=== START: Invoicing Process ===");
heptora.log.info("Step 1: Loading Excel data...");
heptora.log.info("Step 2: Opening web portal...");
heptora.log.info("=== END: Process completed ===");

Use heptora.data.set() and heptora.data.get() to communicate between blocks instead of temporary files.


Use heptora.time.pause() after actions that require loading time:

  • After navigation: 2-3 seconds
  • After clicks: 1-2 seconds
  • After opening apps: 3-5 seconds

Use descriptive names for variables:

✅ Good:

heptora.data.set("invoicesToProcess", invoices);
heptora.data.set("validationResult", isValid);
heptora.data.set("pendingClientList", clients);

❌ Bad:

heptora.data.set("d", data);
heptora.data.set("x", result);
heptora.data.set("temp", list);

heptora.log.info("=== BLOCK 1: Load Data ===");
List<string> columns = new List<string> {
"InvoiceNumber",
"Client",
"Amount",
"Status"
};
List<Dictionary<string, object>> invoices = heptora.excel.load(
"C:\\data\\january_invoices.xlsx",
"Invoices",
columns,
true
);
heptora.data.set("invoicesToProcess", invoices);
heptora.log.info("Total invoices loaded: " + invoices.Count);
heptora.log.info("=== BLOCK 2: Portal Login ===");
heptora.browser.open();
heptora.time.pause(2);
heptora.browser.go_to("https://invoice-portal.com/login");
heptora.time.pause(3);
heptora.windows.type("user@company.com");
heptora.windows.press("tab");
heptora.windows.type("MyPassword123");
heptora.windows.press("enter");
heptora.time.pause(4);
heptora.log.info("Login completed");
heptora.log.info("=== BLOCK 3: Process Invoice ===");
List<Dictionary<string, object>> invoices =
(List<Dictionary<string, object>>)heptora.data.get("invoicesToProcess");
Dictionary<string, object> invoice = invoices[0];
string number = (string)invoice["InvoiceNumber"];
string status = (string)invoice["Status"];
if (status == "Paid") {
heptora.log.force_ko("Invoice already paid. No processing required.");
}
// Process invoice...
heptora.log.result("ok", "Invoice " + number + " processed successfully");

Heptora’s language is designed to be declarative and secure. Traditional control structures are handled at the platform level through block and flow configuration.

How do I iterate over a list without foreach?

Section titled “How do I iterate over a list without foreach?”

Use iterator blocks configured in the platform. Each block will execute automatically for each list element.

Currently, Heptora language doesn’t include direct HTTP functions. For API integrations, contact support to evaluate custom block options.


If this guide didn’t solve your problem or you found an error in the documentation:

  • Technical support: help@heptora.com
  • Clearly describe the problem you encountered
  • Include screenshots if possible
  • Indicate which documentation steps you followed

Our support team will help you resolve any issue.