Overview
Code by UnifyApps is a powerful automation component that allows users to execute custom code as part of their automation workflows. It serves as a flexible action step that supports multiple programming languages including Groovy, Java, JavaScript, Python, and custom snippets, enabling developers to implement complex logic and integrations that might not be feasible with standard pre-built actions.


Actions supported
Code by UnifyApps enables the execution of the following actions:
Action | Description | Common Use Cases |
| Executes Groovy code to perform custom actions | Data transformation, complex string manipulation, integration with Java libraries |
| Executes JavaScript to perform custom actions | Web API integrations, JSON manipulation, frontend interactions |
| Executes Python script to perform custom actions | Data analysis, machine learning, scientific computing, complex calculations |
| Invokes a method from the specified classpath | Accessing existing business logic, reusing enterprise methods, legacy system integration |
| Executes Java code to perform custom actions | Enterprise integrations, high-performance operations, using Java libraries |
| Executes pre-written snippets of code to perform custom actions | Reusing common logic patterns, standardized operations, team-shared functions |
| Executes playwright scripts to perform browser actions and returns the result | Web scraping, UI testing, form automation, screenshot capture |
Libraries Supported
Code by UnifyApps provides access to numerous libraries across different programming languages to help you build powerful automations.
Python Libraries
The following Python libraries are available on the platform:
LangChain Ecosystem
Library | Description |
| Framework for developing applications powered by language models |
| OpenAI integration for LangChain |
| Experimental features for LangChain |
| Community-contributed LangChain integrations |
| Hugging Face integration for LangChain |
Data Science & Machine Learning
Library | Description |
| Data analysis and manipulation tool |
| Scientific computing with Python |
| Machine learning framework |
| NLP for PyTorch and TensorFlow |
| Machine learning for Python |
| AWS SDK for Python |
| Sentence, text and image embeddings |
| Natural language processing |
| Natural language toolkit |
Security & Document Processing
Library | Description |
| Context aware PII identification |
| Anonymize detected PII entities |
| PDF document processing |
| E-book handling library |
| Password hashing |
| MS Office document encryption |
| Cryptographic recipes and primitives |
Utilities & Helpers
Library | Description |
| Read/write Excel files |
| HTTP library |
| World timezone definitions |
| Extract data from documents |
| Document format extensions |
| Convert HTML to Markdown |
| Screen-scraping library |
| XML and HTML processing |
| Extract data from Excel files |
| Generate fake data |
Framework Support
Library | Description |
| File support for asyncio |
| Async client for AWS services |
| Data validation using Python type hints |
| Pydantic and MongoDB integration |
| Python parser |
| Access to Cohere's language models |
Java & Groovy Libraries
The platform supports all commonly used Java, Javascript and Groovy libraries. Users can raise a request to support@unifyapps.com for queries regarding any library.
Use case
Let's demonstrate how to properly set up a code using Code by UnifyApps. In this example, our automation is triggered via a new mail in our Outlook account. We will capture the subject of the email and extract certain components from it using Regex.
Start off by defining the input parameters for the code block. In our scenario, we will just need to take in the subject from the upstream automation.
Since we are expecting to extract certain elements from the subject, go ahead and define your necessary output parameters.
Note
Ensure that you are using appropriate casing since these input/output parameters will be used in your code as well. Good practice is to either use snake casing or camel casing for the keys of the variables.
Next, we can write the code as required in the editor. We can also expand the editor for easier use.
Remember to return the desired output statements using a return statement.
Note
It is essential to return the output of the code so as to be able to use it in the downstream automation. You have to map the variables in your code against the output parameters defined and then write a return statement.
We also have the ability to run the code in an asynchronous mode, i.e., that the workflow won’t wait for the code to finish and simply move on to the next steps.
Finally, you have to map the input parameters with their respective data pills and the code is then ready to execute.