Unify Logo Footer.svg
Unify Automations
Logo
Code by Unifyapps

Code by Unifyapps

Logo

4 mins READ

Code by UnifyApps enables custom code execution within automation workflows, supporting multiple programming languages including Groovy, Java, JavaScript, Python, and custom snippets for complex logic implementation.

Overview

Code by UnifyApps enables custom code execution within automation workflows, supporting multiple programming languages including Groovy, Java, JavaScript, Python, and custom snippets for complex logic implementation.

Screenshot_2026-08-31_at_12.36.36_PM_1.png
Screenshot_2026-08-31_at_12.36.36_PM_1.png

Actions Supported

Action

Description

Common Use Cases

Execute Groovy code

Perform custom actions using Groovy

Data transformation, string manipulation, Java library integration

Execute JavaScript

Perform custom actions using JavaScript

Web API integrations, JSON manipulation, frontend interactions

Execute Python script

Perform custom actions using Python

Data analysis, machine learning, scientific computing

Execute method from classpath

Invoke specified classpath methods

Accessing business logic, reusing enterprise methods

Execute Java code

Perform custom actions using Java

Enterprise integrations, high-performance operations

Execute custom code snippets

Execute pre-written code snippets

Reusing common logic patterns, standardized operations

Execute Playwright script

Perform browser actions and return results

Web scraping, UI testing, form automation

Libraries Supported

Python Libraries

  • LangChain Ecosystem: langchain, langchain-openai, langchain-experimental, langchain-community, langchain-huggingface.

  • Data Science and Machine Learning: pandas, numpy, torch, transformers, scikit-learn, boto3, sentence_transformers, spacy, nltk.

  • Security and Document Processing: presidio-analyzer, presidio-anonymizer, pymupdf, ebooklib, bcrypt, msoffcrypto-tool, cryptography.

  • Utilities and Helpers: openpyxl, requests, pytz, unstructured, markdownify, beautifulsoup4, lxml, xlrd, faker.

  • Framework Support: aiofiles, aiobotocore, pydantic, pydantic-mongo, parso, cohere.

Java, JavaScript, and Groovy libraries are generally supported. Contact support@unifyapps.com for specific library requests.

Use Case Example

A practical workflow captures email subject data and extracts components using regex:

  1. Define input parameters (email subject).

  2. Establish output parameters for extracted elements.

  3. Write code with proper return statements.

  4. Map inputs to the code block.

  5. Pass outputs to downstream automation steps.

Important: Use appropriate casing for input/output parameters, since these names are used directly in your code.

Implementing Groovy Code

A step-by-step example converts a number to a string:

  1. Define setup schema (input variables) and result schema (output format).Setup schema configuration with number input example

  2. Select "CODE BY UNIFYAPPS" app and "EXECUTE GROOVY CODE" action. The platform auto-fills available input parameters.Action selection interface with code editor

  3. Enter the Groovy code snippet.

  4. Map inputs from previous workflow steps.

  5. Output becomes available as data pills for downstream steps — map to the next step to continue the workflow.

Implementing Python Script

The process mirrors Groovy implementation:

  1. Define setup and result schemas with input/output variables.

  2. Select "CODE BY UNIFYAPPS" app and "EXECUTE PYTHON SCRIPT" action.

  3. Enter the Python code snippet.

  4. Map inputs from previous steps.

  5. Output becomes available as data pills for subsequent steps — map to continue the workflow or return results.

Notes

Keep the following in mind when using Code by UnifyApps:

  • Keep code blocks small and focused on a single transformation; complex multi-step logic embedded in one Code node is harder to test and debug.

  • Import only the libraries the code actually uses; unnecessary imports increase execution overhead.

  • Test code in isolation using the single-step test before wiring it into a full automation run.

  • Code runs in a sandboxed environment; check the supported libraries list before relying on file system access, outbound network calls, or long-running loops.

  • Use the Output schema field to define the structure of the code’s return value; without a schema, downstream nodes cannot reference specific fields as data pills.

FAQs

Can I use external libraries?

Yes, but only libraries pre-installed in the UnifyApps environment. Contact support@unifyapps.com for additional library requests.

How is data passed between code and workflows?

 Data flows through input and output mappings. Code receives input objects and returns values for subsequent steps.

Why does my local code fail in UnifyApps?

Common issues include missing dependencies, environment differences, timeout limitations, or permission restrictions. Check logs for specific error messages.

Why isn't output passing to downstream automation?

The most common issue is improper output variable mapping in return statements. Ensure return statement keys match output parameters exactly — matching is case-sensitive.