Add Logic to Your Processing Pipelines

Use JavaScript expressions to compute values, set fallbacks, and branch logic — all inline in your processing steps.

No credit card needed
Uploaded files
panorama.jpgLandscape
story_reel.pngPortrait
cover_art.jpgLandscape
headshot.pngPortrait
hero_banner.jpgLandscape
JavaScript expressions

Use the full power of JavaScript to compute values dynamically based on file properties.

Fallback values

Provide default values for missing metadata using standard JavaScript operators.

Conditional logic

Apply different processing based on file size, type, dimensions, or any metadata field.

Use Cases

Dynamic File Processing

Use JavaScript expressions to create intelligent processing pipelines.

Dynamic dimensions

Calculate output dimensions based on input file properties.

"width": "${file.meta.width * (720 / file.meta.height)}"
bird.webp
1600 × 1200
width960

Fallback values

Provide default values when file metadata is missing.

"title": "${file.meta.title || 'Untitled'}"
photo.jpg
3.8 MB · 4032 × 3024
title"Untitled"

Conditional logic

Apply different processing based on file type, size, or any metadata field.

"resize_strategy": "${file.meta.width > file.meta.height ? 'fit' : 'pad'}"
FileDimensionsResize strategy
panorama.jpg3840 × 1080Evaluating…fitfitportrait.png800 × 1200Evaluating…padpadbanner.jpg1920 × 400Evaluating…fitfitavatar.png512 × 512Evaluating…padpadcover.jpg2560 × 1440Evaluating…fitfitheadshot.png600 × 900Evaluating…padpadhero.jpg1920 × 800Evaluating…fitfitlogo.png256 × 256Evaluating…padpadslide.jpg1280 × 720Evaluating…fitfiticon.png64 × 64Evaluating…padpadsplash.jpg3000 × 1500Evaluating…fitfitthumb.png150 × 200Evaluating…padpadwallpaper.jpg2560 × 1080Evaluating…fitfitprofile.png400 × 400Evaluating…padpadbackdrop.jpg4096 × 2160Evaluating…fitfitstamp.png128 × 128Evaluating…padpadfeature.jpg1600 × 900Evaluating…fitfitbadge.png96 × 96Evaluating…padpadpromo.jpg1200 × 630Evaluating…fitfitphoto.png800 × 1067Evaluating…padpadpanorama.jpg3840 × 1080Evaluating…fitfitportrait.png800 × 1200Evaluating…padpadbanner.jpg1920 × 400Evaluating…fitfitavatar.png512 × 512Evaluating…padpadcover.jpg2560 × 1440Evaluating…fitfitheadshot.png600 × 900Evaluating…padpadhero.jpg1920 × 800Evaluating…fitfitlogo.png256 × 256Evaluating…padpadslide.jpg1280 × 720Evaluating…fitfiticon.png64 × 64Evaluating…padpadsplash.jpg3000 × 1500Evaluating…fitfitthumb.png150 × 200Evaluating…padpadwallpaper.jpg2560 × 1080Evaluating…fitfitprofile.png400 × 400Evaluating…padpadbackdrop.jpg4096 × 2160Evaluating…fitfitstamp.png128 × 128Evaluating…padpadfeature.jpg1600 × 900Evaluating…fitfitbadge.png96 × 96Evaluating…padpadpromo.jpg1200 × 630Evaluating…fitfitphoto.png800 × 1067Evaluating…padpad
Processing steps with JavaScript expressions
{
  "steps": {
    ":original": {
      "robot": "/upload/handle"
    },
    "resized": {
      "use": ":original",
      "robot": "/image/resize",
      "width": "${Math.min(width, 1920)}",
      "height": "${Math.min(height, 1080)}",
      "imagemagick_stack": "${size > 5000000 ? 'v3.0.1' : 'v2.0.10'}"
    },
    "exported": {
      "use": "resized",
      "robot": "/s3/store",
      "path": "${fields.category || 'uncategorized'}/${file.name}"
    }
  }
}
Transloadit

Stop hardcoding processing parameters

Transloadit's code evaluation service lets you create intelligent pipelines that adapt to each file automatically.
JavaScript expressions

Use any JavaScript expression inline with dollar-brace syntax.

Access file metadata

Reference file.meta.width, file.meta.height, file.size, and all metadata fields.

Standard library

Use Math, Date, String methods, and other JavaScript built-ins for complex logic.

Fallback values

Handle missing metadata gracefully with || operators and ternary expressions.

Fast execution

Scripts execute in under 1ms with a 1-second timeout for safety.

Flexible evaluation

Use simple variable access or more complex JavaScript expressions in the same workflow.

Related resources

Take Code Evaluation into production

The guides, Robot reference, and working demos teams reach for when Code Evaluation has to run reliably at scale.

Pricing

What Code Evaluation costs to run

Every plan runs every Robot, so nothing about this service is held back for a bigger one. You are paying for the volume you put through it.

  • Community

    Free

    Perfect for trying out Transloadit

    5 GB every month
    200 priority slots/region
    2 collaborators
    0.5 GB file size limit
    Audio & video are trimmed
    Output images are watermarked
    Service stops at 5 GB
    Monthly spending limits and alerts
    Video turbo mode from Pro
  • Lite

    $29/ month

    For lower-volume workloads

    15 GB every month
    400 priority slots/region
    2 collaborators
    1 GB file size limit
    Full-length audio & video
    Unwatermarked image outputs
    Overage processing at $2/GB
    Monthly spending limits and alerts
    Video turbo mode from Pro
  • Pro

    Billing cycle
    $54/ month

    $54 per month. Billed annually · save 22%

    For growing workloads and more capacity

    40 GB every month
    1,000 priority slots/region
    3 collaborators
    5 GB file size limit
    Full-length audio & video
    Unwatermarked image outputs
    Overage processing at $1.80/GB
    Monthly spending limits and alerts
    Video turbo mode
  • Enterprise

    Custom

    For teams with advanced needs

    Tailored monthly GB allowance
    Custom priority slots per region
    Unlimited collaborators
    Tailored file size limits
    Tiered pricing available
    Custom features & invoicing
    Custom Slack channel
    Monthly spending limits and alerts
    Enterprise support SLAs
    Faster file processing
    Whitelabeling support
    Video turbo mode

Try Transloadit for free

Start creating dynamic processing pipelines today.
Hardcoded processing values
Dynamic expressions
Missing metadata errors
Fallback values
One-size-fits-all processing
Conditional logic
Complex dimension calculations
Math expressions
Static output filenames
Dynamic path templates
Inflexible workflows
JavaScript-powered pipelines
GDPR
HIPAA
ISO 27001ISO27001
AES-256
SOC 2 Type II
No credit card needed ·