Dynamic Assembly Instructions
Use JavaScript expressions to make your file processing pipelines dynamic and conditional.
Use the full power of JavaScript to compute values dynamically based on file properties.
Provide default values for missing metadata using standard JavaScript operators.
Apply different processing based on file size, type, dimensions, or any metadata field.
Dynamic File Processing
Use JavaScript expressions to create intelligent processing pipelines.
Dynamic dimensions
Calculate output dimensions based on input file properties.
Fallback values
Handle missing metadata gracefully with default values using || operators.
Conditional logic
Apply different processing based on file type, size, or any metadata field.
JavaScript Expression Evaluation
Use dollar-brace syntax to evaluate JavaScript expressions in your Assembly Instructions.
${Math.min(width, 1920)}{"steps": {":original": {"robot": "/upload/handle"},"resized": {"use": ":original","robot": "/image/resize","width": "${Math.min(width, 1920)}","height": "${height / 2}"},"exported": {"use": "resized","robot": "/s3/store"}}}
Pricing
Bigger plans mean lower cost per GB. Need flexibility? Get a custom plan with spending limits. View all pricing options.
Perfect for trying out Transloadit
For teams with advanced needs
{
"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}"
}
}
}Stop hardcoding processing parameters
Use any JavaScript expression in your Assembly Instructions with dollar-brace syntax.
Reference file.meta.width, file.meta.height, file.size, and all metadata fields.
Use Math, Date, String methods, and other JavaScript built-ins for complex logic.
Handle missing metadata gracefully with || operators and ternary expressions.
Scripts execute in under 1ms with a 1-second timeout for safety.
Simple variable access is free. Only complex JavaScript expressions are charged.