Skip to content
Talk to our solutions team

Task Reference

The tasks that read, transform and write streaming records between pipeline stages, with every parameter and worked examples.

Perform aggregate operations (sum, avg, min, max, count) across multiple fields on streaming pipeline records. Results are emitted as a single record after all input records have been processed.

Simple form (single field, single operation)

Section titled “Simple form (single field, single operation)”
ParameterTypeRequiredDescription
fieldstringYesField name to aggregate
opstringYesOperation: sum, avg, min, max

Full form (multiple fields, multiple operations)

Section titled “Full form (multiple fields, multiple operations)”
ParameterTypeRequiredDescription
fieldslistYesList of field specifications
fields[].fieldstringYesField name
fields[].opslistYesOperations: sum, avg, min, max, count

Results are emitted as a single record with keys named {field}_{op}:

Key PatternExampleDescription
{field}_sumamount_sumSum of all values
{field}_avgamount_avgAverage of all values
{field}_minamount_minMinimum value
{field}_maxamount_maxMaximum value
{field}_countamount_countCount of values for the field
countcountTotal records processed (always included)
tasks:
- name: total
aggregate:
field: amount
op: sum
outputs:
- result
- name: result
print: "Total: {{amount_sum}}, Records: {{count}}"
tasks:
- name: stats
aggregate:
fields:
- field: amount
ops: [sum, avg, min, max]
- field: quantity
ops: [sum, min, max]
outputs:
- report
- name: report
writecsv:
path: /data/summary.csv
tasks:
- name: read-data
read-csv:
path: /data/daily-metrics.csv
outputs:
- aggregate
- name: aggregate
aggregate:
fields:
- field: cpu_usage
ops: [avg, max]
- field: memory_usage
ops: [avg, max]
- field: request_count
ops: [sum]
outputs:
- write-db
- name: write-db
writedb:
table: daily_summary

Perform multi-field aggregation computations from Script scripts.

FunctionDescription
aggregate.compute()Compute aggregate operations on a set of records
ParameterTypeDefaultDescription
fieldslistList of {field: string, ops: []string} (required)
recordslistList of maps representing records (required)

Supported operations: sum, avg, min, max, count

FieldTypeDescription
successboolWhether the computation succeeded
resultmapAggregated values keyed as {field}_{op}, plus count
errorstringError message if failed
// Compute sum and average of amounts
var result = aggregate.compute({
fields: [
{ field: "amount", ops: ["sum", "avg", "min", "max"] },
{ field: "quantity", ops: ["sum"] }
],
records: [
{ amount: 100, quantity: 5 },
{ amount: 200, quantity: 3 },
{ amount: 150, quantity: 8 }
]
});
// result.result = { amount_sum: 450, amount_avg: 150, amount_min: 100,
// amount_max: 200, quantity_sum: 16, count: 3 }
// Read CSV and aggregate in one script
var data = csv.read({ path: "/data/sales.csv" });
if (data.success) {
var stats = aggregate.compute({
fields: [
{ field: "revenue", ops: ["sum", "avg"] },
{ field: "units", ops: ["sum", "min", "max"] }
],
records: data.records
});
if (stats.success) {
console.log("Total revenue: " + stats.result.revenue_sum);
console.log("Total units: " + stats.result.units_sum);
}
}

Execute multi-language scripts for each pipeline record using the Script scripting engine. Similar to Plugin but supports JavaScript, Lua, Starlark, and V8. The user’s script must define a function named morph.

ParameterTypeRequiredDefaultDescription
languagestringNojavascriptScript language: javascript, js, lua, starlark, javascript-v8, v8
executestringYes*Script code executed per record
rowsstringYes*Per-record script (alias for execute)
endstringNoScript executed after all records are processed

* One of execute or rows is required.

The script must define a function named morph that receives an input argument:

function morph(input) {
// input.data - the current record (map)
// input.env - the pipeline environment variables (map)
}

These functions are injected as globals and available in all supported languages:

FunctionDescription
write(key, value)Sink a value to a named output pipe
setmemory(key, value)Store a value in pipeline memory
getmemory(key)Retrieve a value from pipeline memory
deletememory(key)Delete a value from pipeline memory
hasmemory(key)Check if a key exists in pipeline memory
memorykeys()Get all memory keys
memorykeyslike(pattern)Get memory keys matching a pattern
clearmemory()Clear all pipeline memory
tasks:
- name: transform
morph:
language: javascript
execute: |
function morph(input) {
write("output", {
full_name: input.data.first_name + " " + input.data.last_name,
email: input.data.email.toLowerCase()
});
}
outputs:
- output
tasks:
- name: transform
morph:
language: lua
execute: |
function morph(input)
local price = tonumber(input.data.price)
write("output", {
product = input.data.name,
price_with_tax = price * 1.1
})
end
outputs:
- output
tasks:
- name: aggregate
morph:
language: javascript
rows: |
function morph(input) {
var category = input.data.category;
var current = hasmemory(category) ? getmemory(category) : 0;
setmemory(category, current + parseFloat(input.data.amount));
}
end: |
function morph(input) {
var keys = memorykeys();
for (var idx in keys) {
var cat = keys[idx];
write("summary", { category: cat, total: getmemory(cat) });
}
}
outputs:
- summary
tasks:
- name: transform
morph:
language: starlark
execute: |
def morph(input):
data = input["data"]
write("output", {
"event": data["type"].upper(),
"timestamp": data["ts"]
})
outputs:
- output

Execute inline morph scripts from within another Script script. Enables nested script execution for dynamically generating transformation code or running user-provided scripts.

FunctionDescription
morph.execute()Run a morph script inline with specified language and input
ParameterTypeDefaultDescription
languagestringjavascriptScript language: javascript, js, lua, starlark, javascript-v8, v8
codestringScript source defining a morph(input) function (required)
inputanyInput data passed to the morph function
FieldTypeDescription
successboolWhether the execution succeeded
resultanyReturn value from the morph function
errorstringError message if failed
// Execute a JavaScript morph inline
var result = morph.execute({
language: "javascript",
code: 'function morph(input) { return input.x * 2; }',
input: { x: 21 }
});
// result = { success: true, result: 42 }
// Execute a Lua morph from JavaScript
var result = morph.execute({
language: "lua",
code: 'function morph(input) return input.name .. " processed" end',
input: { name: "Alice" }
});
// result = { success: true, result: "Alice processed" }
// Combine csv.read + morph.execute for dynamic processing
var data = csv.read({ path: "/data/records.csv" });
if (data.success) {
var transformCode = 'function morph(input) { return { upper: input.name.toUpperCase(), len: input.name.length }; }';
for (var i = 0; i < data.records.length; i++) {
var transformed = morph.execute({
code: transformCode,
input: data.records[i]
});
console.log(JSON.stringify(transformed.result));
}
}

No-op passthrough that forwards each record unchanged to all output sinks. Useful as a placeholder or for testing pipelines.

No parameters required.

tasks:
- name: passthrough
noop:
outputs:
- next-stage

Execute JavaScript code for each pipeline record. Provides built-in functions for writing to sinks and reading/writing pipeline memory for aggregation patterns.

ParameterTypeRequiredDefaultDescription
executestringYes*JavaScript code executed once per pipeline (one-time mode)
rowsstringYes*JavaScript code executed per record (row mode)
endstringNoJavaScript code executed after all records are processed

* One of execute or rows is required. If execute is empty, rows is used in per-record mode.

FunctionDescription
write(key, value)Sink a value to a named output pipe
setmemory(key, value)Store a value in pipeline memory
getmemory(key)Retrieve a value from pipeline memory
deletememory(key)Delete a value from pipeline memory
hasmemory(key)Check if a key exists in pipeline memory
memorykeys()Get all memory keys
memorykeyslike(pattern)Get memory keys matching a pattern
clearmemory()Clear all pipeline memory

Record data is available as env.data and environment variables as env.env in the JavaScript context.

tasks:
- name: transform
plugin:
rows: |
var record = env.data;
var total = parseFloat(record.price) * parseInt(record.quantity);
write("output", {product: record.name, total: total});
outputs:
- output
tasks:
- name: aggregate
plugin:
rows: |
var record = env.data;
var category = record.category;
var current = hasmemory(category) ? getmemory(category) : 0;
setmemory(category, current + parseFloat(record.amount));
end: |
var keys = memorykeys();
for (var k in keys) {
write("output", {category: keys[k], total: getmemory(keys[k])});
}
outputs:
- output

Print each pipeline record to stdout using a Liquid template string. Useful for debugging pipelines.

ParameterTypeRequiredDefaultDescription
(direct value)stringYesLiquid template string for printing. Record fields available as template variables
tasks:
- name: debug-print
print: "Record: id={{id}}, name={{name}}, amount={{amount}}"

Read CSV files and stream each row as a key-value record into the data pipeline. The first row is used as the header to name each field.

ParameterTypeRequiredDefaultDescription
(direct value)stringYes*Shorthand: file path as the direct parameter value
pathstringYes*Single CSV file path. Supports Liquid templates and ~ expansion
pathslistYes*List of path specs for reading multiple files
paths[].srcstringYesSource directory. Supports Liquid templates and ~ expansion
paths[].includelistNoGlob patterns to include. Supports Liquid templates
paths[].excludelistNoGlob patterns to exclude. Supports Liquid templates
waitdurationNoDelay between reading each record (e.g. 100ms, 1s)
entitymap/URLNoEntity definition for record validation
validateentitystringNoEntity name to validate against (when multiple entities defined)

* One of direct value, path, or paths is required.

tasks:
- name: ingest
read-csv: /data/users.csv
outputs:
- process
tasks:
- name: ingest
read-csv:
path: /data/users.csv
outputs:
- process
vars:
month: "2025-01"
tasks:
- name: ingest
read-csv:
path: "~/exports/{{month}}/report.csv"
outputs:
- process
tasks:
- name: ingest
read-csv:
path: /data/large.csv
wait: 100ms
outputs:
- process
tasks:
- name: ingest
read-csv:
paths:
- src: /data/reports/
include:
- "sales_*.csv"
- "revenue_*.csv"
exclude:
- "*_draft.csv"
outputs:
- process
tasks:
- name: ingest
read-csv:
paths:
- src: /data/region-us/
include: ["*.csv"]
- src: /data/region-eu/
include: ["*.csv"]
outputs:
- merge
tasks:
- name: ingest
read-csv:
path: /data/products.csv
entity:
name: product
fields:
- name: sku
type: string
required: true
- name: price
type: decimal
required: true
validateentity: product
outputs:
- store
tasks:
- name: ingest
read-csv:
path: /data/orders.csv
outputs:
- write
- name: write
writedb:
table: orders

Read and write CSV files from Script scripts.

FunctionDescription
csv.read()Read a CSV file into an array of records
csv.write()Write records to a CSV file
ParameterTypeDefaultDescription
pathstringCSV file path (required)
FieldTypeDescription
successboolWhether the read succeeded
recordsarrayArray of key-value maps (one per row)
errorstringError message if failed
// Read a CSV file
var result = csv.read({
path: "/data/users.csv"
});
if (result.success) {
for (var i = 0; i < result.records.length; i++) {
console.log(result.records[i].name + ": " + result.records[i].email);
}
}

Read records from a PostgreSQL database query and stream them into the pipeline. Supports SSL/TLS and vault-based credential retrieval.

ParameterTypeRequiredDefaultDescription
hoststringYesDatabase host. Supports Liquid templates
usernamestringYesDatabase user. Supports Liquid templates
passwordstringYesVault path for password retrieval. Supports Liquid templates
querystringYesSQL query to execute. Supports Liquid templates
databasestringNousernameDatabase name
portintNo5432Database port
certificatestringNoSSL client certificate (PEM content)
keystringNoSSL client key (PEM content)
issuerstringNoSSL CA certificate (PEM content)
sslmodestringNoverify-caSSL mode
waitdurationNoDelay between reading each record
entitymap/URLNoEntity definition for record validation
tasks:
- name: read-users
read-db:
host: db.example.com
username: reader
password: "{{vault.db_password}}"
query: "SELECT id, name, email FROM users WHERE active = true"
outputs:
- process
tasks:
- name: read-secure
read-db:
host: db.example.com
username: reader
password: "{{vault.db_password}}"
database: analytics
port: 5433
sslmode: verify-full
certificate: "{{vault.db_cert}}"
key: "{{vault.db_key}}"
issuer: "{{vault.db_ca}}"
query: "SELECT * FROM events"
outputs:
- process

Query and execute statements against PostgreSQL databases from Script scripts.

FunctionDescription
db.query()Execute a SELECT query and return records
db.execute()Execute an INSERT/UPDATE/DELETE statement
ParameterTypeDefaultDescription
connectionstringPostgreSQL connection string (required)
querystringSQL query to execute (required)
FieldTypeDescription
successboolWhether the query succeeded
recordsarrayArray of key-value maps (one per row)
errorstringError message if failed
// Query a PostgreSQL database
var result = db.query({
connection: "postgres://user:pass@host:5432/db?sslmode=disable",
query: "SELECT * FROM users"
});
if (result.success) {
for (var i = 0; i < result.records.length; i++) {
console.log(result.records[i].name + ": " + result.records[i].email);
}
}

Read records from a Data API entity store using a bulk query. Requires entity definition files and a database pool configuration.

ParameterTypeRequiredDefaultDescription
fileslistYesEntity definition file paths
dbpoolmapYesDatabase pool configuration
querystringYesEntity query to execute
entitymap/URLNoEntity definition for record validation
tasks:
- name: read-entities
readentity:
files:
- /schemas/user.yaml
dbpool:
host: db.example.com
port: 5432
username: reader
password: "{{vault.db_password}}"
database: app
query: "SELECT * FROM user WHERE active = true"
outputs:
- process

Query and mutate Data API entity stores from Script scripts.

FunctionDescription
entity.query()Query records from an entity store
entity.mutate()Write records to an entity store

Note: Entity operations require a pipeline environment with Data API EntityManager. The namespace functions are stubs in Script standalone mode and return errors directing to the YAML pipeline interface.

ParameterTypeDefaultDescription
fileslistEntity definition file paths
dbpoolmapDatabase pool configuration
querystringEntity query to execute
FieldTypeDescription
successboolWhether the query succeeded
recordsarrayArray of entity records
errorstringError message (stub always returns error)
// Entity queries are not available in Script standalone mode.
// Use the YAML pipeline interface (readentity) instead.
var result = entity.query({
files: ["/schemas/user.yaml"],
dbpool: {},
query: "SELECT * FROM user"
});
// result = { success: false, error: "entity operations require pipeline environment" }

Read records from a datastore entity using metadata service configuration. Lazily initializes the entity manager and caches it for reuse.

ParameterTypeRequiredDefaultDescription
datastorestringYesDatastore name
querystringYesEntity query to execute
metaurlstringNotenantmeta.urlMetadata service URL override
entitymap/URLNoEntity definition for record validation
tasks:
- name: read-from-datastore
readentity-in-datastore:
datastore: customer-db
query: "SELECT * FROM orders WHERE status = 'pending'"
outputs:
- process

See readentity for the entity namespace documentation. The entity.query() and entity.mutate() functions are shared across ReadEntity, ReadEntityDatastore, and WriteEntityDatastore tasks.

// Entity queries are not available in Script standalone mode.
// Use the YAML pipeline interface (readentity-in-datastore) instead.
var result = entity.query({
datastore: "customer-db",
query: "SELECT * FROM orders"
});
// result = { success: false, error: "entity operations require pipeline environment" }

Read Excel spreadsheet files and stream each row as a pipeline record. The first row of each sheet is used as the header.

ParameterTypeRequiredDefaultDescription
(direct value)stringYes*Shorthand: file path
pathstringYes*Excel file path. Supports Liquid templates and ~ expansion
pathslistYes*List of path specs with src, include, exclude
waitdurationNoDelay between records
entitymap/URLNoEntity definition for record validation

* One of direct value, path, or paths is required.

tasks:
- name: read-report
read-excel:
path: /data/report.xlsx
outputs:
- process
tasks:
- name: read-all
read-excel:
paths:
- src: /data/imports/
include: ["*.xlsx"]
exclude: ["~$*"]
outputs:
- process

Read and write Excel files from Script scripts.

FunctionDescription
excel.read()Read an Excel file into an array of records
excel.write()Write records to an Excel file
ParameterTypeDefaultDescription
pathstringExcel file path (required)
sheetstringSheet name (reads all sheets if omitted)
FieldTypeDescription
successboolWhether the read succeeded
recordsarrayArray of key-value maps (one per row)
errorstringError message if failed
// Read records from an Excel file
var result = excel.read({ path: "/data/report.xlsx", sheet: "Sales" });
if (result.success) {
for (var i = 0; i < result.records.length; i++) {
console.log(result.records[i].product + ": " + result.records[i].amount);
}
}

Read Apache Parquet files and stream each row as a pipeline record. All values are converted to strings.

ParameterTypeRequiredDefaultDescription
(direct value)stringYes*Shorthand: file path
pathstringYes*Parquet file path. Supports Liquid templates and ~ expansion
pathslistYes*List of path specs with src, include, exclude
waitdurationNoDelay between records
entitymap/URLNoEntity definition for record validation

* One of direct value, path, or paths is required.

tasks:
- name: read-data
read-parquet:
path: /data/events.parquet
outputs:
- process

Read and write Parquet files from Script scripts.

FunctionDescription
parquet.read()Read a Parquet file into an array of records
parquet.write()Write records to a Parquet file
ParameterTypeDefaultDescription
pathstringParquet file path (required)
FieldTypeDescription
successboolWhether the read succeeded
recordsarrayArray of key-value maps (one per row)
errorstringError message if failed
// Read records from a Parquet file
var result = parquet.read({ path: "/data/events.parquet" });
if (result.success) {
for (var i = 0; i < result.records.length; i++) {
console.log(JSON.stringify(result.records[i]));
}
}

Make an HTTP request and parse the CSV response into pipeline records. The first row of the response is used as the header.

ParameterTypeRequiredDefaultDescription
verbstringYesHTTP method (GET, POST, etc.). Supports Liquid templates
urlstringYesREST endpoint URL. Supports Liquid templates
headersmapNoHTTP request headers. Supports Liquid templates
timeoutstringNo10sConnection timeout
waitdurationNoDelay between records
entitymap/URLNoEntity definition for record validation
tasks:
- name: fetch-data
read-rest:
verb: GET
url: "https://api.example.com/export.csv"
headers:
Authorization: "Bearer {{token}}"
timeout: 30s
outputs:
- process

Make HTTP requests from Script scripts.

FunctionDescription
rest.request()Make an HTTP request and return the response
ParameterTypeDefaultDescription
urlstringRequest URL (required)
verbstringGETHTTP method
headersmapHTTP request headers
timeoutstring10sConnection timeout
FieldTypeDescription
successboolWhether the request succeeded
statusintHTTP status code
resultanyResponse body
errorstringError message if failed

Note: In pipeline mode, the ReadREST response is parsed as CSV into records. In Script standalone mode, rest.request returns the raw response body.

// Fetch data from a REST endpoint
var result = rest.request({
url: "https://api.example.com/data.csv"
});
if (result.success) {
console.log("Status: " + result.status);
console.log("Body: " + result.result);
}

Make an HTTP request with an optional JSON payload and sink the full response as a single record.

ParameterTypeRequiredDefaultDescription
verbstringYesHTTP method. Supports Liquid templates
urlstringYesREST endpoint URL. Supports Liquid templates
payloadstringNo""Request body template. Supports Liquid templates
headersmapNoHTTP request headers. Supports Liquid templates
timeoutstringNo10sConnection timeout
waitdurationNoDelay between records
tasks:
- name: fetch-json
read-rest-json:
verb: POST
url: "https://api.example.com/query"
payload: '{"filter": "{{filter_value}}"}'
headers:
Content-Type: application/json
outputs:
- process

See readrest for the rest namespace documentation. The rest.request() function is shared across ReadREST, ReadRESTJSON, and ReadRESTJSONPipe tasks.

// POST a JSON payload and read the response
var result = rest.request({
verb: "POST",
url: "https://api.example.com/data",
body: { key: "value" },
headers: { "Authorization": "Bearer token" }
});
if (result.success) {
console.log("Status: " + result.status);
console.log("Response: " + JSON.stringify(result.result));
}

Execute a shell command and parse its CSV stdout output into pipeline records. The first line is used as the header.

ParameterTypeRequiredDefaultDescription
commandstringYesShell command to execute
waitdurationNoDelay between records
entitymap/URLNoEntity definition for record validation
tasks:
- name: read-process-output
read-stdout:
command: "cat /var/log/metrics.csv"
outputs:
- process

Execute shell commands and parse CSV output from Script scripts.

FunctionDescription
stdout.exec()Execute a command and parse its CSV output into records
ParameterTypeDefaultDescription
commandstringShell command to execute (required)
FieldTypeDescription
successboolWhether the execution succeeded
recordsarrayArray of key-value maps parsed from CSV output
outputstringRaw command output
errorstringError message if failed
// Execute a command and parse CSV output
var result = stdout.exec({
command: "echo 'name,age\nAlice,30\nBob,25'"
});
if (result.success) {
for (var i = 0; i < result.records.length; i++) {
console.log(result.records[i].name + " is " + result.records[i].age);
}
}

Replicate each incoming record unchanged to all output sinks. Useful for fan-out patterns where the same data feeds into multiple downstream tasks.

No parameters required.

tasks:
- name: fan-out
replicate:
outputs:
- write-csv
- write-db
- write-analytics

See sum for the full compute namespace documentation.

ParameterTypeDefaultDescription
recordmapRecord to replicate (required)
FieldTypeDescription
successboolWhether the replication succeeded
resultmapDeep copy of the input record
errorstringError message if failed
// Create a deep copy of a record
var result = compute.replicate({
record: { name: "Alice", age: 30, role: "admin" }
});
if (result.success) {
var copy = result.result;
console.log(copy.name); // "Alice"
}

Full-featured REST API client for data pipelines. Supports service authentication, retry logic, polling with wait-for conditions, and post-request JavaScript processing. Parses JSON array or object responses into individual pipeline records.

ParameterTypeRequiredDefaultDescription
typestringYesHTTP method
urlstringYesREST endpoint URL. Supports Liquid templates
payloadstringNoRequest body template
payloadkeystringNoKey to extract from payload
datakeystringNoKey to extract from response JSON
setbodystringNoKey name to store response body
setstatuscodestringNoKey name to store HTTP status code
headersmapNoHTTP request headers
sendheadersmapNoHeaders to include in output
timeoutstringNo10sConnection timeout
serviceauthboolNofalseUse service-to-service JWT auth
mlresponseboolNofalseMulti-line response mode
failonerrorboolNotrueFail pipeline on HTTP error
doretryboolNofalseEnable retry on failure
retrycountintNo-1Number of retries (-1 = unlimited)
waitformapNoPolling config with callback expression
postrequestmapNoPost-processing JavaScript expression
tasks:
- name: fetch-records
read-rest-json-pipe:
type: GET
url: "https://api.example.com/records"
datakey: data
outputs:
- process
tasks:
- name: fetch-secure
read-rest-json-pipe:
type: POST
url: "https://internal-api/bulk"
payload: '{"ids": {{ids}}}'
serviceauth: true
doretry: true
retrycount: 3
timeout: 30s
outputs:
- process

See readrest for the rest namespace documentation. The rest.request() function is shared across ReadREST, ReadRESTJSON, and ReadRESTJSONPipe tasks.

Note: Pipeline-only features (Vault service authentication, JavaScript post-processing, retry logic, and wait-for polling) are not available in Script standalone mode. Use rest.request for direct HTTP calls.

// POST with JSON body and auth header
var result = rest.request({
verb: "POST",
url: "https://api.example.com/data",
body: { key: "value" },
headers: { "Authorization": "Bearer token" }
});
if (result.success) {
console.log("Status: " + result.status);
console.log("Response: " + JSON.stringify(result.result));
}

Add a fixed numeric value to a field in each pipeline record. The result is emitted per record.

ParameterTypeRequiredDefaultDescription
headerstringYesColumn name containing the numeric value
valuefloatYesValue to add to each record’s field
tasks:
- name: add-tax
sum:
header: price
value: 10.5
outputs:
- process

Numeric and string computation functions for Script scripts.

FunctionDescription
compute.sum()Add two numeric values
compute.concat()Concatenate two strings
compute.replicate()Create a deep copy of a record
ParameterTypeDefaultDescription
valuenumberBase value (required)
addnumberValue to add (required)
FieldTypeDescription
successboolWhether the computation succeeded
resultnumberSum of the two values
errorstringError message if failed
// Add two numeric values
var result = compute.sum({ value: 42, add: 8 });
if (result.success) {
console.log(result.result); // 50
}

Concatenate a fixed string value to a field in each pipeline record. The result is emitted per record.

ParameterTypeRequiredDefaultDescription
headerstringYesColumn name containing the string value
valuestringYesString to concatenate
tasks:
- name: add-prefix
sumstr:
header: name
value: "user_"
outputs:
- process

See sum for the full compute namespace documentation.

ParameterTypeDefaultDescription
valuestringBase string (required)
addstringString to concatenate (required)
FieldTypeDescription
successboolWhether the computation succeeded
resultstringConcatenated string
errorstringError message if failed
// Concatenate two strings
var result = compute.concat({ value: "Hello", add: " World" });
if (result.success) {
console.log(result.result); // "Hello World"
}

Write pipeline records to a CSV file. The header row is inferred from the first record’s keys unless pre-defined.

ParameterTypeRequiredDefaultDescription
(direct value)stringYes*Shorthand: file path
pathstringYes*Output CSV file path
overwriteboolNofalseTruncate file before writing (vs append)
headerslistNoPre-defined column headers (inferred from first record if omitted)
entitymap/URLNoEntity definition for record validation

* One of direct value or path is required.

tasks:
- name: write-output
writecsv:
path: /output/results.csv
tasks:
- name: write-fresh
writecsv:
path: /output/results.csv
overwrite: true
headers:
- id
- name
- email

See readcsv for the full csv namespace documentation.

ParameterTypeDefaultDescription
pathstringOutput CSV file path (required)
recordsarrayArray of key-value maps to write (required)
headerslistColumn headers (inferred if omitted)
overwriteboolfalseTruncate file before writing
FieldTypeDescription
successboolWhether the write succeeded
countintNumber of records written
errorstringError message if failed
// Write records to a CSV file
var result = csv.write({
path: "/output/data.csv",
records: [
{ name: "Alice", age: "30" },
{ name: "Bob", age: "25" }
],
overwrite: true
});
if (result.success) {
console.log("Wrote " + result.count + " records");
}

Write pipeline records to a PostgreSQL database by executing a templated SQL query per record. Supports SSL/TLS and vault-based credential retrieval.

ParameterTypeRequiredDefaultDescription
hoststringYesDatabase host. Supports Liquid templates
usernamestringYesDatabase user. Supports Liquid templates
passwordstringYesVault path for password retrieval
querystringYesSQL INSERT/UPDATE template. Supports Liquid templates with record fields
databasestringNousernameDatabase name
portintNo5432Database port
certificatestringNoSSL client certificate
keystringNoSSL client key
issuerstringNoSSL CA certificate
sslmodestringNoverify-fullSSL mode
maxconnectionsstringNo3Max connection pool size
connectionlifetimestringNo1sConnection max lifetime
connectimeoutstringNo1Connect timeout in seconds
entitymap/URLNoEntity definition for record validation
tasks:
- name: write-to-db
writedb:
host: db.example.com
username: writer
password: "{{vault.db_password}}"
database: analytics
query: "INSERT INTO events (id, name, value) VALUES ('{{id}}', '{{name}}', '{{value}}')"

See readdb for the full db namespace documentation.

ParameterTypeDefaultDescription
connectionstringPostgreSQL connection string (required)
querystringSQL statement to execute (required)
FieldTypeDescription
successboolWhether the execution succeeded
affectedintNumber of rows affected
errorstringError message if failed
// Execute an INSERT statement
var result = db.execute({
connection: "postgres://user:pass@host:5432/db?sslmode=disable",
query: "INSERT INTO users (name, email) VALUES ('Alice', '[email protected]')"
});
if (result.success) {
console.log("Affected rows: " + result.affected);
}

Write pipeline records to a datastore entity using a JSON record template. Executes bulk mutations via the Data API entity manager.

ParameterTypeRequiredDefaultDescription
datastorestringYesDatastore name
record-templatestringYesJSON template for record. Supports Liquid templates with record fields
metaurlstringNoMetadata service URL override
tasks:
- name: write-entities
writeentity-in-datastore:
datastore: customer-db
record-template: |
{
"entity": "order",
"data": {
"id": "{{id}}",
"customer": "{{customer}}",
"amount": "{{amount}}"
}
}

See readentity for the full entity namespace documentation.

ParameterTypeDefaultDescription
datastorestringDatastore name (required)
recordmapEntity record data (required)
FieldTypeDescription
successboolWhether the mutation succeeded
errorstringError message (stub always returns error)

Note: Entity operations require a pipeline environment with Data API EntityManager. The entity.mutate function is a stub in Script standalone mode.

// Entity mutations are not available in Script standalone mode.
// Use the YAML pipeline interface (writeentity-in-datastore) instead.
var result = entity.mutate({
datastore: "customer-db",
record: { id: "1" }
});
// result = { success: false, error: "entity operations require pipeline environment" }

Write pipeline records to an Excel spreadsheet. Creates or appends to an Excel file. The sheet name is derived from the input pipeline name.

ParameterTypeRequiredDefaultDescription
(direct value)stringYes*Shorthand: file path
pathstringYes*Output Excel file path
overwriteboolNofalseCreate new file (vs append to existing)
entitymap/URLNoEntity definition for record validation

* One of direct value or path is required.

tasks:
- name: write-excel
writeexcel:
path: /output/report.xlsx
overwrite: true

See readexcel for the full excel namespace documentation.

ParameterTypeDefaultDescription
pathstringOutput Excel file path (required)
sheetstringSheet name
recordsarrayArray of key-value maps to write (required)
overwriteboolfalseCreate new file (vs append)
FieldTypeDescription
successboolWhether the write succeeded
countintNumber of records written
errorstringError message if failed
// Write records to an Excel file
var result = excel.write({
path: "/output/report.xlsx",
sheet: "Results",
records: [
{ name: "Alice", score: "95" },
{ name: "Bob", score: "87" }
],
overwrite: true
});
if (result.success) {
console.log("Wrote " + result.count + " records");
}

Write pipeline records to an Apache Parquet file. Schema is inferred from the first record’s keys. All fields are written as strings.

ParameterTypeRequiredDefaultDescription
(direct value)stringYes*Shorthand: file path
pathstringYes*Output Parquet file path
overwriteboolNofalseTruncate file before writing
entitymap/URLNoEntity definition for record validation

* One of direct value or path is required.

tasks:
- name: write-parquet
writeparquet:
path: /output/events.parquet
overwrite: true

See readparquet for the full parquet namespace documentation.

ParameterTypeDefaultDescription
pathstringOutput Parquet file path (required)
recordsarrayArray of key-value maps to write (required)
FieldTypeDescription
successboolWhether the write succeeded
countintNumber of records written
errorstringError message if failed
// Write records to a Parquet file
var result = parquet.write({
path: "/output/data.parquet",
records: [
{ id: "1", name: "Alice" },
{ id: "2", name: "Bob" }
]
});
if (result.success) {
console.log("Wrote " + result.count + " records");
}

Write each pipeline record to a REST API endpoint by making an HTTP request per record. Requests are executed asynchronously in goroutines.

ParameterTypeRequiredDefaultDescription
urlstringYesREST endpoint URL. Supports Liquid templates with record fields
verbstringNopostHTTP method. Supports Liquid templates
payloadstringNoRequest body template. Supports Liquid templates with record fields
headersmapNoHTTP request headers. Supports Liquid templates
waitdurationstringNo10sDelay between requests
connectiontimeoutstringNo10sConnection timeout
entitymap/URLNoEntity definition for record validation
tasks:
- name: post-records
writerest:
url: "https://api.example.com/records"
verb: post
payload: '{"id": "{{id}}", "name": "{{name}}"}'
headers:
Content-Type: application/json
Authorization: "Bearer {{token}}"
waitduration: 100ms

See readrest for the full rest namespace documentation. The rest.request() function is used for both reading and writing via REST endpoints.

// POST JSON data to a REST endpoint
var result = rest.request({
verb: "POST",
url: "https://api.example.com/users",
body: { name: "Alice", email: "[email protected]" },
headers: { "Content-Type": "application/json" }
});
if (result.success) {
console.log("Status: " + result.status);
console.log("Response: " + JSON.stringify(result.result));
}