Transforms
Transforms reshape an action's data after it is fetched. Declare a
post_transforms: block — an array of transform functions applied in order.
actions:
- name: AddAttribute
http:
url: https://jsonplaceholder.typicode.com/todos/10
post_transforms:
- extract_value: ".body"
- add_attribute:
env: production
The filter transform reuses the
assertion vocabulary to keep
only matching elements. Every transform and its fields are listed below.
Transform
| Field | Type | Description |
|---|---|---|
rename_attributes | Map<string, string> (nullable) | Rename attributes (keys) within a JSON object. Maps old attribute names to new attribute names. Example ↓ |
remove_attributes | Array<string> (nullable) | Remove specified attributes from the JSON object. Provides an array of attribute names to exclude. Example ↓ |
keep_attributes | Array<string> (nullable) | Keep only specified attributes, removing all others. Provides an allowlist of attribute names. Example ↓ |
move_attributes | Map<string, string> (nullable) | Move attributes from one location to another. Maps source path to destination path. Example ↓ |
rename_keys | Map<string, string> (nullable) | Rename keys at the root level of a JSON object. Maps old key names to new key names. Example ↓ |
remove_keys | Array<string> (nullable) | Remove specified keys from the JSON object. Provides an array of key names to exclude. Example ↓ |
bcrypt | BcryptTransform (nullable) | Hash a value using bcrypt for secure password storage. Supports custom cost factor. Example ↓ |
add_attribute | object (nullable) | Add new attributes to the JSON object with specified key-value pairs. Example ↓ |
return_row | number (nullable) | Return a specific row from a result set by index (0-based). Example ↓ |
extract_value | string (nullable) | Extract a single value from the response using a JSON path. Example ↓ |
extract_array | TransformExtractArray (nullable) | Extract an array from a JSON response with options for flattening and deduplication. Example ↓ |
extract_with_json_path | string (nullable) | Extract data using a JSON path expression. Shortcut for simple extractions. Example ↓ |
extract_with_jq | string (nullable) | Extract data using jq filter syntax for complex JSON transformations. Example ↓ |
extract_with_regex | ExtractWithRegex (nullable) | Extract values from a string using regex capture groups. Example ↓ |
add_jwt | AddJWT (nullable) | Add a JWT token to the response with configurable expiration and payload. Example ↓ |
read_jwt | ReadJWT (nullable) | Read and decode a JWT token to extract its payload. Example ↓ |
numerics | Array<string> (nullable) | Convert string fields to numeric types. Provides an array of field names to convert. Example ↓ |
group_by | Array<string> (nullable) | Group array elements by specified fields. Used for aggregation operations. Example ↓ |
generate_password | TransformPasswordGen (nullable) | Generate a secure random password with customizable options for length and character types. Example ↓ |
replace_values | TransformReplaceValues (nullable) | Replace values in strings or arrays with support for regex and multiple replacements. Example ↓ |
flatten | TransformFlatten (nullable) | Flatten nested objects into a single level with configurable key separators. Example ↓ |
b64_decode | string (nullable) | Decode a Base64-encoded string. Example ↓ |
b64_decode_as_json | string (nullable) | Decode a Base64-encoded string and parse as JSON. Example ↓ |
b64_encode | TransformConfig (nullable) | Encode a value to Base64. Can be a direct string or custom transform configuration. Example ↓ |
yaml_to_json | TransformConfig (nullable) | Convert YAML-formatted string to JSON. Example ↓ |
parse_csv | TransformConfig (nullable) | Parse a CSV string into an array of header-keyed row objects. Point it at the CSV string in the action's data (e.g. the raw request body via input: a|raw_body|, or fetched text). Example ↓ |
to_csv | TransformConfig (nullable) | Serialize an array of row objects INTO a CSV string — the inverse of parse_csv. Columns come from the first row's keys and every later row is written in that same order. Pair… Example ↓ |
nested_transforms | Map<string, Array<Transform>> (nullable) | Apply nested transforms to specific keys. Maps keys to arrays of transform operations. Example ↓ |
math | TransformMath (nullable) | Perform mathematical operations on numeric values with expressions. target is OPTIONAL and defaults to the root object — omit it to read and write fields at the top level (as… Example ↓ |
aggregate | TransformAggregate (nullable) | Reduce a JSON array to a summary (sum/avg/min/max/count), optionally grouped. Example ↓ |
filter | TransformFilterSearch (nullable) | Filter array elements based on specified conditions. Example ↓ |
generate_bytes | GenerateBytes (nullable) | Generate random bytes with specified length. Example ↓ |
encrypt_value | EncryptValue (nullable) | Encrypt a value using AES-256-GCM encryption. Example ↓ |
hmac | HmacSign (nullable) | Compute an HMAC of a message — the signing counterpart to the is_valid_hmac assertion. Use it to sign webhook deliveries you SEND, then interpolate the result into a header. Example ↓ |
decrypt_value | DecryptValue (nullable) | Decrypt a value previously sealed with encrypt_value (AES-256-GCM). Example ↓ |
s3_generate_presigned_url | S3GeneratePresignedURL (nullable) | Generate a presigned URL for S3 file access. Example ↓ |
encode_uri | TransformConfig (nullable) | URI-encode an entire URL string. Example ↓ |
encode_uri_component | TransformConfig (nullable) | URI-encode a single component of a URL. Example ↓ |
decode_uri | TransformConfig (nullable) | URI-decode an encoded URL string. Example ↓ |
decode_uri_component | TransformConfig (nullable) | URI-decode a single component of an encoded URL. Example ↓ |
generate_slug | TransformConfig (nullable) | Generate a URL-friendly slug from a string. Example ↓ |
Field examples
rename_attributes
Rename attributes (keys) within a JSON object. Maps old attribute names to new attribute names.
Example
rename_attributes:
old_name: new_name
remove_attributes
Remove specified attributes from the JSON object. Provides an array of attribute names to exclude.
Example
remove_attributes:
- password
- secret
keep_attributes
Keep only specified attributes, removing all others. Provides an allowlist of attribute names.
Example
keep_attributes:
- id
- name
- email
move_attributes
Move attributes from one location to another. Maps source path to destination path.
Example
move_attributes:
user.name: name
user.email: email
rename_keys
Rename keys at the root level of a JSON object. Maps old key names to new key names.
Example
rename_keys:
user_id: userId
created_at: createdAt
remove_keys
Remove specified keys from the JSON object. Provides an array of key names to exclude.
Example
remove_keys:
- token
- internal_id
bcrypt
Hash a value using bcrypt for secure password storage. Supports custom cost factor.
Example
bcrypt:
key: password # Path to the password value (e.g., .password)
cost: 12 # Cost factor (higher = slower but more secure)
add_attribute
Add new attributes to the JSON object with specified key-value pairs.
Example
add_attribute:
user_uuid: a|uuid| # Auto-generate UUID
verification_token: a|uuid| # Auto-generate token
return_row
Return a specific row from a result set by index (0-based).
Example
return_row: 0 # Return the first row
extract_value
Extract a single value from the response using a JSON path.
Example
extract_value: .user.id
extract_array
Extract an array from a JSON response with options for flattening and deduplication.
Example
extract_array:
from: .items # Path to the array
paths: # Paths to extract from each element
- id
- name
flatten: true # Flatten nested arrays
dedupe: true # Remove duplicates
extract_with_json_path
Extract data using a JSON path expression. Shortcut for simple extractions.
Example
extract_with_json_path: .[0] # Get first element
extract_with_jq
Extract data using jq filter syntax for complex JSON transformations.
Example
extract_with_jq: '.users | map({id, name})'
extract_with_regex
Extract values from a string using regex capture groups.
Example
extract_with_regex:
value: .phone # Path to source string
expr: "(\\d{3})-(\\d{3})-(\\d{4})" # Regex with capture groups
keys: # Names for captured groups
- area
- prefix
- number
add_jwt
Add a JWT token to the response with configurable expiration and payload.
Example
add_jwt:
key: jwt # Output key for the token
secret: a|var::JWT_SECRET| # JWT secret (use encrypted variable)
exp: 1d # Expiration STRING (e.g., 1h, 1d, 30m)
data: # Claims — three accepted forms:
sub: a|FetchUser::id| # • object: explicit claim -> value (most flexible)
email: a|FetchUser::email|
# data: [id, email] # • array: copy these fields from this action's input
# data: all # • "all": copy every input field
Security: Store JWT secrets as encrypted AirPipe variables:
secret: a|var::ENCRYPTED_JWT_SECRET|
read_jwt
Read and decode a JWT token to extract its payload.
Example
read_jwt:
key: user_data # Output key for decoded payload
token: .auth_header # Path to JWT token
numerics
Convert string fields to numeric types. Provides an array of field names to convert.
Example
numerics:
- age
- price
- quantity
group_by
Group array elements by specified fields. Used for aggregation operations.
Example
group_by:
- category
- region
generate_password
Generate a secure random password with customizable options for length and character types.
Example
generate_password:
key: temp_password # Output key for generated password
length: 16 # Password length
numbers: true # Include numbers (0-9)
lowercase_letters: true # Include lowercase (a-z)
uppercase_letters: true # Include uppercase (A-Z)
symbols: true # Include symbols (!@#$)
replace_values
Replace values in strings or arrays with support for regex and multiple replacements.
Example - Simple string replacement
replace_values:
target_value: .message # Path to target value
find_str: old # String to find
new_str: new # Replacement string
Example - Multiple value replacement
replace_values:
target_value: .status
values: # Array of values to process
- pending
- approved
find_str: _
new_str: " "
flatten
Flatten nested objects into a single level with configurable key separators.
Example
flatten:
key_separator: . # Separator for nested keys
prefix: user # Optional prefix for all keys
target: .data # Path to nested object
b64_decode
Decode a Base64-encoded string.
Example
b64_decode: .encoded_data # Path to Base64 string
b64_decode_as_json
Decode a Base64-encoded string and parse as JSON.
Example
b64_decode_as_json: .payload # Path to Base64-encoded JSON
b64_encode
Encode a value to Base64. Can be a direct string or custom transform configuration.
Example
b64_encode: .data # Path to value to encode
yaml_to_json
Convert YAML-formatted string to JSON.
Example
yaml_to_json: .yaml_data # Path to YAML string
parse_csv
Parse a CSV string into an array of header-keyed row objects. Point it at the
CSV string in the action's data (e.g. the raw request body via
input: a|raw_body|, or fetched text).
Example
parse_csv: "$" # replace the root CSV string with the rows
# parse_csv: { json_path: "$", key: rows } # put the rows array under `rows`
to_csv
Serialize an array of row objects INTO a CSV string — the inverse of
parse_csv. Columns come from the first row's keys and every later row is
written in that same order. Pair it with an email attachment
(encoding: utf8) to send a report.
Example
to_csv: "$" # replace the root rows array with a CSV string
# to_csv: { json_path: "$", key: csv } # put the CSV string under `csv`
nested_transforms
Apply nested transforms to specific keys. Maps keys to arrays of transform operations.
Example
nested_transforms:
items: # Transform each item in the 'items' array
- remove_keys:
- internal_id
- rename_keys:
user_name: name
math
Perform mathematical operations on numeric values with expressions.
target is OPTIONAL and defaults to the root object — omit it to read and
write fields at the top level (as below). Inside an expression, reference a
field with the target. prefix; that prefix is the substitution token and is
resolved against the target object, so a bare price is left as-is and will
not resolve. Set target: only to scope to a nested object (e.g. .data).
Example
math:
expressions: # key = output field name
total: target.price * target.quantity
discounted: target.total * 0.9
decimal_places: 2 # optional: round to 2 places
aggregate
Reduce a JSON array to a summary (sum/avg/min/max/count), optionally grouped.
Example
aggregate: { over: body.data, sum: [amount], count: true, group_by: [status] }
filter
Filter array elements based on specified conditions.
Example
filter:
target: .users # Path to array to filter
conditions:
.age:
is_greater_than: 18
.status:
is_equal_to: "active"
generate_bytes
Generate random bytes with specified length.
Example
generate_bytes:
key: api_key # Output key for generated bytes
length: 32 # Number of bytes to generate
encrypt_value
Encrypt a value using AES-256-GCM encryption.
Example
encrypt_value:
key: encrypted_data # Output key for encrypted result
data: .sensitive_value # Path to value to encrypt
secret_key: a|var::ENCRYPTED_ENCRYPTION_KEY| # Encryption key (must be encrypted variable)
nonce: a|var::NONCE| # Unique nonce (must be encrypted variable)
Security:
- Store encryption keys as encrypted AirPipe variables
- Use unique nonce values for each encryption operation
hmac
Compute an HMAC of a message — the signing counterpart to the
is_valid_hmac assertion. Use it to sign webhook deliveries you SEND,
then interpolate the result into a header.
Example
hmac:
key: signature # Output key for the digest
data: a|BuildPayload::body| # The message to sign
secret: a|Subscriber::secret| # Per-recipient signing secret
algorithm: sha256 # sha1 | sha256 (default) | sha512
encoding: hex # hex (default) | base64
A digest produced here verifies under is_valid_hmac with the same
algorithm and encoding.
decrypt_value
Decrypt a value previously sealed with encrypt_value (AES-256-GCM).
Example
decrypt_value:
key: plaintext # Output key for the decrypted string
value: a|Row::enc_value| # Base64 ciphertext (the encrypt_value `.value`)
nonce: a|Row::enc_nonce| # Base64 nonce (the encrypt_value `.nonce`)
tag: a|Row::enc_tag| # Base64 GCM tag (the encrypt_value `.tag`)
secret_key: a|env::AIRPIPE_ENC_SECRET_KEY| # Same key used to encrypt
Security: decryption is authenticated — a wrong key, altered ciphertext, or altered tag fails loudly rather than returning garbage.
s3_generate_presigned_url
Generate a presigned URL for S3 file access.
Example
s3_generate_presigned_url:
bucket: my-bucket # S3 bucket name
file_key: documents/file.pdf # Path to file in bucket
expiration_secs: 3600 # URL expiration (seconds)
endpoint: https://s3.amazonaws.com # S3 endpoint
region: us-east-1 # AWS region
access_key_id: a|var::ENCRYPTED_AWS_ACCESS_KEY| # AWS access key (encrypted variable)
secret_access_key: a|var::ENCRYPTED_AWS_SECRET| # AWS secret key (encrypted variable)
key: presigned_url # Output key for generated URL
json_path: .file_url # Optional: Extract from response
Security: Store AWS credentials securely as encrypted AirPipe variables:
access_key_id: a|var::ENCRYPTED_AWS_ACCESS_KEY|
secret_access_key: a|var::ENCRYPTED_AWS_SECRET|
encode_uri
URI-encode an entire URL string.
Example
encode_uri: .url # Path to URL to encode
encode_uri_component
URI-encode a single component of a URL.
Example
encode_uri_component: .search_query # Path to component to encode
decode_uri
URI-decode an encoded URL string.
Example
decode_uri: .encoded_url # Path to encoded URL
decode_uri_component
URI-decode a single component of an encoded URL.
Example
decode_uri_component: .encoded_param # Path to encoded component
generate_slug
Generate a URL-friendly slug from a string.
Example
generate_slug: .title # Path to text to convert to slug
TransformConfig
One of:
- string
- CustomTransform
CustomTransform
| Field | Type | Description |
|---|---|---|
key | string | Required. |
json_path | string | Required. |
TransformExtractArray
| Field | Type | Description |
|---|---|---|
from | string (nullable) | The JSON path to the starting array |
paths | Array<string> (nullable) | Array of JSON paths to extract values from each element |
flatten | boolean (nullable) | Whether to flatten nested arrays |
dedupe | boolean (nullable) | Whether to remove duplicates |
TransformFilterSearch
| Field | Type | Description |
|---|---|---|
target | string (nullable) | |
conditions | Map<string, Test> | Required. Conditions to filter items in the array. |
TransformFlatten
| Field | Type | Description |
|---|---|---|
key_separator | string | Required. |
prefix | string (nullable) | |
target | string (nullable) |
TransformMath
| Field | Type | Description |
|---|---|---|
target | string (nullable) | |
expressions | Map<string, string> | Required. |
to_string | boolean (nullable) | |
decimal_places | number (nullable) | |
eval_type | MathEvalType (nullable) |
TransformPasswordGen
| Field | Type | Description |
|---|---|---|
key | string | Required. |
length | number | Required. |
numbers | boolean (nullable) | |
lowercase_letters | boolean (nullable) | |
uppercase_letters | boolean (nullable) | |
symbols | boolean (nullable) | |
spaces | boolean (nullable) | |
exclude_similar_characters | boolean (nullable) | |
strict | boolean (nullable) |
TransformReplaceValues
| Field | Type | Description |
|---|---|---|
target_value | string | Required. |
target_key | string (nullable) | |
find_str | string (nullable) | |
new_str | string (nullable) | |
regex | string (nullable) | |
values | Array<string> (nullable) |
BcryptTransform
| Field | Type | Description |
|---|---|---|
key | string (nullable) | |
value | string (nullable) | |
jq | string (nullable) | |
cost | number (nullable) |
AddJWT
| Field | Type | Description |
|---|---|---|
key | string | Required. |
secret | string | Required. |
exp | string (nullable) | |
data | any | Required. |
ReadJWT
| Field | Type | Description |
|---|---|---|
key | string | Required. |
token | string | Required. |
EncryptValue
| Field | Type | Description |
|---|---|---|
key | string | Required. |
data | string | Required. |
secret_key | string | Required. |
nonce | string | Required. |
DecryptValue
| Field | Type | Description |
|---|---|---|
key | string | Required. |
value | string | Required. |
nonce | string | Required. |
tag | string | Required. |
secret_key | string | Required. |
GenerateBytes
| Field | Type | Description |
|---|---|---|
key | string | Required. |
length | number | Required. |
ExtractWithRegex
| Field | Type | Description |
|---|---|---|
value | string | Required. |
expr | string | Required. |
keys | Array<string> | Required. |
S3GeneratePresignedURL
| Field | Type | Description |
|---|---|---|
operation | string (nullable) | get (default) mints a time-limited DOWNLOAD link; put mints a time-limited UPLOAD target the client can PUT straight to, so the file never transits AirPipe. |
bucket | string | Required. |
file_key | string | Required. |
expiration_secs | number | Required. |
endpoint | string | Required. |
region | string | Required. |
access_key_id | string | Required. |
secret_access_key | string | Required. |
key | string | Required. |
json_path | string (nullable) |
MathEvalType
Type: string — one of: int, float, string, bool
DataType
Type: string — one of: text, json, csv, xml