Workflow transformations

Transformation Steps change the current input before later Steps use it. FastHook offers an inline JSON Patch editor and reusable JavaScript DSL transformations.

Choose the transformation type

Use JSON Patch for deterministic JSON edits that can be expressed as a sequence of RFC 6902 operations. Use a JS Transformation for reusable logic, calculated values, or request-aware processing that is easier to maintain as code.

JSON Patch

The builder supports six operations, executed from top to bottom:

Example:

JSON
[
  { "op": "add", "path": "/processed", "value": true },
  { "op": "copy", "from": "/customer/id", "path": "/customer_id" },
  { "op": "remove", "path": "/internal_debug" }
]

Paths use JSON Pointer syntax, not dot notation. Escape ~ as ~0 and / as ~1 inside a field name.

Test JSON Patch in the builder

The workspace shows Original, JSON Patch, and Result panels. Load the available trigger or previous-Step sample, add operations from the JSON tree or manually, and run the Patch before saving.

The preview validates syntax and operation order. A real run can still fail if its JSON shape differs from the sample—for example, when a required source path does not exist.

Reusable JS Transformation

Create reusable code under JS Transformations, then choose that resource in a Workflow Transformation Step. At runtime the selected Step input becomes the transformation body. The runtime also receives request headers, query string, path, method, and ingestion timestamp when available.

The successful transformed body becomes the Step output. A runtime exception produces a transformation error that can be handled through an error route.

Mapping after a transformation

Later Steps read the transformed output under steps.<transformation-step-id>. Use the field picker and verify the output preview in Audit before relying on newly created fields.

Transformation checklist

The existing Transformations reference covers reusable transformations used by direct Connections.