Transform Studio
Transform Studio shows what a transformation turns a payload into, and what an endpoint would receive. Running it sends nothing, so it is safe on a production transformation.
In the dashboard it is Develop → Transform Studio. In the API it is POST /api/v1/projects/{projectId}/transform-preview and POST /api/v1/projects/{projectId}/transform-preview/delivery-dry-run; see the API reference.
Two modes
Section titled “Two modes”| Mode | What it answers | What it needs |
|---|---|---|
| Preview | What the transformation produces from this payload. | An input payload, and a saved transformation, a template or a script. |
| Dry run | What the HTTP request to a given endpoint would look like: body, headers and signature. | The same, plus an endpoint. |
Preview needs only read access. A dry run returns a valid signature made with the endpoint’s real signing secret, enough to forge a body that endpoint accepts, so it requires write access and a READ_WRITE API key. See Authentication.
Preview a template
Section titled “Preview a template”-
Put a payload in. Paste one, or press Load Event and pick a real event from the project. A real payload finds mistakes a hand-written sample does not.
-
Choose what to run. Pick a saved transformation, or write into the expression box:
- A box that starts with
{or[is a JSON template, the same${$.path}template a transformation carries. See Transformations. - Anything else is a single extraction, such as
$.data, the form a destination’spayloadTransformtakes. - Empty is pass-through: the payload comes back formatted and unchanged.
- A box that starts with
-
Run it. The output panel shows the result, whether it differs from the input, and any errors. An extraction that matched nothing returns
nulland says so: in a template that is not an error, so this is where you notice it.
Run a JavaScript transformation
Section titled “Run a JavaScript transformation”The Language switch chooses Template or JavaScript. In JavaScript mode the box becomes a code editor, and the studio runs the worker’s engine with the same sandbox and TRANSFORM_SCRIPT_* limits, so a script that works here works on a delivery. The JavaScript contract says what handler(webhook) gets and must return.
- ⌘/Ctrl+Enter runs, ⌘/Ctrl+S saves.
- Four tabs: Input, Output, Diff and Console. A successful run opens Output; a failed one opens Console.
console.log,info,warn,erroranddebuggo to the Console tab, including what a script logged before it threw.- A failure names its reason and highlights the line in your script.
- A script that returns
{ cancel: true }is reported as a cancellation, not an error. On a real delivery nothing would be sent, retried or put in Failed Messages.
Dry-run a delivery
Section titled “Dry-run a delivery”Switch the mode to Dry run and pick a target endpoint. The result is the request it would receive:
- the transformed body,
- the headers, including your custom headers,
- the
X-Signatureover that body, made with the endpoint’s current signing secret, - the endpoint’s URL, and the name and version of the applied transformation.
Nothing is sent. A disabled endpoint can be dry-run too, with a warning.
Save it back
Section titled “Save it back”Running changes nothing; saving is a separate press.
- Save script writes the editor back into the selected transformation. That publishes a new version, as saving through the API does; see version history.
- Save as transformation creates a new one in this project under a name you give. Subscriptions and destinations can then use it.
- With no transformation selected, what you type is a scratch draft and is lost with the page.
What it cannot do
Section titled “What it cannot do”- It does not pick the transformation a real delivery would use. It applies the one you name. Subscription settings and rules are not consulted, so a rule that overrides the transformation is invisible here.
- A dry run is not byte-for-byte. A real delivery also carries
X-Event-Id,X-Delivery-Id,X-Sequence-NumberandIdempotency-Key, which exist only once there is a delivery. Use it to check the body and signing secret. - The signature is always the
t=…,v1=…form. An endpoint on the Standard Webhooks scheme is signed withwebhook-id,webhook-timestampandwebhook-signature, which the dry run does not produce. See Signatures. - Nothing is sent, so nothing is confirmed. It cannot tell you whether the endpoint accepts the body. For a real request, use the test console or send a test event.
- The endpoint has to be in this project. An endpoint from a sibling project is reported as not found, the same answer another organization’s endpoint gets, so the dry run cannot be used to discover which ids exist.