Skip to content
Docs
flero.ai

Data transformation

These nodes reshape, parse, and process data. They never make external calls (except File operations, which read/write to attached storage).


Data Transform

What: A general-purpose reshape / map / filter / aggregate node.

Operations (one or more, applied in order):

Operation What it does
map Copy / rename fields, assign static values
convert Cast field type (string ↔ number ↔ boolean ↔ datetime)
concat Join multiple fields into one with a separator
split Split a string into an array on a delimiter
filter Drop items that don't match a condition
sort Order an array by a field
group Group items by a key into an object of arrays
flatten Unnest nested arrays
calculate Evaluate a math expression into a new field
aggregate Sum / count / min / max / avg over an array

Inputs: Any (array or object).

Outputs: The transformed data.

Example: "Pull just the fields we care about and add a computed total."

Operations:
  - map:
      customerName:  {{ $input.customer.name }}
      orderId:       {{ $input.id }}
      itemCount:     {{ $input.items.length }}
  - calculate:
      total:         {{ $input.subtotal + $input.tax }}

Code

What: Runs arbitrary code. Use when the no-code nodes can't express what you need.

Languages: JavaScript (default), Python, or Dart.

Modes:

  • Run once for all items, code receives the entire input as input and returns once.
  • Run once for each item, code runs per item; input is the current item.

Configuration:

Field Notes
Language JS / Python / Dart
Mode All-items or per-item
Code The body
Timeout Max execution time (default 30 s)

Outputs: output (whatever the code returned) and error (if the code threw).

Example (JavaScript, per-item):

return {
  name: input.firstName + ' ' + input.lastName,
  isVip: input.totalSpent > 10000
};

Tips:

  • Available globals: input, console.log (writes to execution log), fetch (HTTP), Math, Date, JSON.
  • No filesystem access. No require/import, the sandbox is locked down.
  • Errors are returned on the error port, not thrown, you can handle them downstream.

Text Processing

What: String operations.

Operations: uppercase, lowercase, title-case, trim, pad, replace, replace regex, substring, split, join, contains, matches regex, slugify, normalise whitespace.

Inputs: A string field.

Outputs: Transformed string.


DateTime Operations

What: Date / time arithmetic and formatting.

Operations: parse string → date, format date → string (with a format string like yyyy-MM-dd HH:mm:ss), add / subtract (days, hours, minutes), difference between two dates, convert time zone, get day of week, get current time.


Encryption / Hashing

What: Cryptographic operations.

Operations:

  • Hash: MD5, SHA-1, SHA-256, SHA-512, HMAC.
  • Encrypt / decrypt: AES-GCM with a workspace-stored key.
  • Sign / verify: HMAC signatures (e.g. webhook signature validation).

Tips:

  • Never hard-code encryption keys in the node. Use $env.SECRET_KEY to reference a workspace environment variable.

File Operations

What: Read, write, list, copy, move, delete files in workspace-attached storage.

Operations: read, write, append, list, copy, move, delete, exists, get metadata.

Storage backends: Local disk (self-hosted), S3, GCS, Azure Blob (configured per workspace by an admin).


PDF Operations

What: PDF-specific operations.

Operations: create from HTML / Markdown / template, merge multiple PDFs, split by page range, extract text (OCR optional), extract images, add a watermark, fill a form, sign.


Image Processing

What: Image manipulation.

Operations: resize, crop, rotate, convert format (PNG / JPG / WebP), compress, apply filter (blur, grayscale, sharpen), add watermark / overlay text, extract metadata, generate thumbnail.


Data Parser

What: Parse between data formats.

Formats: JSON ↔ object, CSV ↔ array of objects, XML ↔ object, YAML ↔ object, TOML ↔ object.

Operations: parse (string → object) and stringify (object → string), each with format-specific options (e.g. CSV delimiter, XML namespace handling).


Tips & gotchas

  • Data Transform vs Code: start with Data Transform; drop to Code only when an operation isn't there. Easier to read and audit.
  • The Code node is sandboxed, but external fetch() calls are real HTTP calls. Use sandbox mode if you want them mocked.
  • PDF and Image operations can be CPU-intensive. Large batches benefit from a Loop with batchSize to spread the work.
  • File Operations require the storage backend to be configured by an admin. Self-hosted Flero defaults to local disk under ./workflow-files/.


Found something out of date? This page lives in the Flero docs content set.