Skip to main content

Add a field to an upstream result

Use FN.merge to combine an upstream result with new fields. Later objects in the list win on key conflicts:

Join a list of IDs to table rows

Look up one row per ID with for_each:
for_each returns one result per item, in input order. Build an ID-to-row mapping with FN.zip_map:
If you do not already have the IDs, project them off the rows with [*], then read an entry by key:

Dates and time windows

Current time as an ISO string. Pass "seconds" to drop microseconds:
A search window starting N days ago:
Midnight N days ago as a Python script:
Format, parse, and convert timezones. format_datetime takes a strftime pattern, to_datetime accepts ISO strings and epoch seconds, and set_timezone takes an IANA name:

Filter a list and count matches

A JSONPath filter returns the matching items as a list. When nothing matches it returns an empty list, never None:
Count matches with FN.length, and take a single value with FN.at:
FN.at indexes into a filter result; appending [0] to the path indexes into each matched value instead. See Common mistakes.

Rejoin mutually exclusive branches

When run_if sends a workflow down one of two branches, rejoin them with join_strategy: any on the downstream action. With the default all, a join with one skipped branch and one that ran is unreachable and the run fails:
Referencing only the skipped branch’s result silently yields null; || reads whichever branch ran.

Insert rows without duplicates

Give the table a unique index, then insert with upsert: true:
See Tables for creating the index and the constraints on it.

Apply a function to every item

Every FN function has a .map variant that applies it to each item in a list:
Scalar arguments broadcast across the list, so ${{ FN.prefix.map(TRIGGER.tags, "tag-") }} prefixes every tag. Two lists of unequal length silently truncate to the shorter one: ${{ FN.add.map([1, 2, 3], [10, 20]) }} returns [11, 22]. core.transform.map applies a python_lambda to each item:
  • See Common mistakes for the expression errors these recipes avoid.
  • See JSONPath for the full filter syntax used in the list recipes.
  • See Functions for the complete FN function reference.
  • See Python script for the core.script.run_python contract, dependencies, and SDK access.
  • See Tables for table schemas, column types, and search behavior behind the deduplication recipe.