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.

Build momentum

Make one workflow fit more files.

Adapt processing to each upload without building a separate service for every rule.

Ship custom workflows sooner

Use expressions to adapt processing settings to each file.

Keep outputs consistent

Calculate dimensions and other settings from source metadata.

Reduce manual decisions

Let file properties determine the processing rules you define.

Keep your backend simpler

Move file-specific calculations into your processing Template.

Reuse more of your setup

Handle different inputs with one adaptable Template.

Connect files to your product

Build output paths from file properties and your own metadata.

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

Your workflow. Your controls.

Code evaluation without the pain

Stop duplicating processing rules across scripts. Keep file logic next to the steps it controls.

Calculate settings on the fly

Use JavaScript expressions in supported processing parameters.

Work with file metadata

Read properties such as dimensions and duration in your expressions.

Build meaningful filenames

Derive export paths and names from available variables.

Handle missing values

Define fallbacks in your expressions for metadata that a file may not contain.

Route files with custom rules

Combine expressions and file filters to choose the next processing step.

Reuse saved Templates

Keep processing instructions in one place for uploads and batch jobs.

Inspect processing results

Use Assembly status and errors to debug file-dependent behavior.

Keep your app in the loop

Get per-file callbacks with /http/request (alpha), or an Assembly Notification when processing ends.

Keep spending in check

Set a soft bill limit for alerts or a hard limit to stop processing.

Make your file workflows adapt

Use expressions and file metadata to choose processing values inside your Assembly Instructions.
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
Evaluate expressions inside Assembly Instructions
GDPR
HIPAA
ISO 27001ISO27001
AES-256
SOC 2 Type II

HIPAA-regulated workloads require a Business Associate Agreement.

No credit card needed

Frequently asked questions

What does code evaluation do in a file workflow?

Dynamic evaluation lets JavaScript expressions calculate processing parameters from file properties and other available variables. For example, a resize width can depend on the original image dimensions. Start with the dynamic evaluation guide.

Do I need to deploy a separate JavaScript service?

No separate service is needed for supported expressions in Assembly Instructions. Transloadit evaluates them as part of processing. This is designed for file workflow logic, rather than hosting a general-purpose application. Read how the script Robot works.

Which file properties can my expressions use?

Use available Assembly Variables, including file metadata and your own user metadata where supported. Values vary with the input file and processing step, so provide fallbacks for optional fields. Explore Assembly Variables.

Can I use expressions to choose which files get processed?

Yes. Use expressions in a file filter to accept or decline files, then connect accepted files to the next steps. Simple array conditions are also available when you do not need JavaScript. See file filtering options.

Can I create filenames and storage paths dynamically?

Yes. Use available variables and expressions in supported path parameters to organize outputs by file properties or your application’s metadata. Check the export Robot’s path behavior for your storage provider. See S3 export options.

How is expression evaluation charged?

Simple Assembly Variable lookups are free. Expressions with logic or functions invoke the script run Robot and incur usage charges. Review the script Robot and its pricing.

How can I estimate and control costs?

Rates vary by operation and usage. Set a soft bill limit for alerts or a hard limit to stop processing. For larger workloads, ask about volume pricing and extra priority slots. Estimate your workflow costs.