Code Executor for Workflow Automation

CODE EXECUTOR

Run JavaScript Code Inside Your Workflows

Code Executor lets you write and run JavaScript code within your automation workflows in a secure sandboxed environment. Easily perform data transformation, calculations, filtering, and format conversion.

Get Started Contact Sales

What Does It Do?

Code Executor runs JavaScript code between workflow steps to process your data exactly the way you need. It takes data from previous steps, executes your code, and passes the result to the next step.

MODERN JAVASCRIPT

ES2020+ Support

Supports modern JavaScript features including arrow functions, template literals, destructuring, spread operator, and nullish coalescing.

DATA TRANSFORMATION

Powerful Array Methods

Easily transform your data using methods like map, filter, reduce, find, and sort.

SECURE ENVIRONMENT

Sandboxed Execution

Your code runs in an isolated sandbox environment. File system access, network requests, and system commands are blocked.

Code Executor

SUPPORTED FEATURES

Harness the full power of JavaScript in your workflows.

  • Rich Built-in Libraries: Math, Date, JSON, Array, and String methods
  • String Operations: toLowerCase, toUpperCase, split, replace, trim, includes
  • Math Calculations: Math.round, Math.floor, Math.random, Math.pow
  • Date Operations: JavaScript Date object for date and time operations
  • JSON Operations: Format conversions with JSON.parse and JSON.stringify
Try It Now

Execution Modes

Run code once or in loop mode depending on your needs.

RUN ONCE

Single Execution

Your code runs once and produces a result. Ideal for simple data transformations and calculations.

const items = steps.step_4.full_response ?? [];

if (items.length === 0) {
  return { total: 0, average: 0, count: 0 };
}

const total = items.reduce((sum, o) => sum + o.amount, 0);
const average = total / items.length;

return { total, average, count: items.length };
FOREACH

Loop Mode

Runs your code for each element in an array. Ideal for batch data processing.

const items = steps.step_4.full_response ?? [];

if (items.length === 0) {
  return [];
}

return items.map(item => ({
  name: item.name.toUpperCase(),
  priceWithTax: item.price * 1.18,
  date: new Date().toISOString()
}));

Use Cases

Here are some examples of what you can do with Code Executor.

Data Filtering

Filter incoming data based on conditions.

const activeUsers =
  input.users.filter(
    u => u.status === "active"
  );
return { result: activeUsers };
Data Transformation

Transform data structures to fit your needs.

return input.items.map(item => ({
  name: item.name.toUpperCase(),
  priceWithTax: item.price * 1.18,
  date: new Date().toISOString()
}));
Calculations

Perform complex calculations in a single step.

const total = input.orders
  .reduce((sum, o) => sum + o.amount, 0);
const average =
  total / input.orders.length;
return { total, average };

Security & Limits

Isolated execution in a sandboxed environment

File system access is blocked

Network access and system commands are restricted

Time and memory limits are enforced for each execution

Secure Sandbox
Isolated Execution Environment

Why Code Executor?

Build custom business logic beyond ready-made integrations.

Custom Business Logic

Write custom code where ready-made integrations fall short.

Data Transformation

Transform data formats without relying on external APIs.

Complex Calculations

Solve conditions and calculations in a single step.

Instant Execution

Run code directly inside your workflow without setting up a development environment.

Questions & Answers

puq.ai is a powerful workflow automation platform that helps you connect apps and automate repetitive tasks without coding.
puq.ai uses a visual workflow builder where you can add actions to create automated workflows between your favorite apps and services.
puq.ai supports 500+ popular apps and services including Slack, Gmail, Google Sheets, Trello, Shopify, and many more.
Yes, puq.ai uses enterprise-grade security with encrypted connections and follows industry best practices for data protection.
No coding required! puq.ai is designed to be user-friendly with a visual interface that anyone can use.
Yes, you can schedule workflows to run at specific times, intervals, or based on triggers from your connected apps.
Yes, you can start with a free trial to explore puq.ai features and see how it can help automate your workflows.
We offer comprehensive support through documentation, tutorials, and our customer support team to help you succeed.

Ready to Automate Your Workflows?

Join thousands of businesses that trust puq.ai to streamline their operations and boost productivity.

Get Started