When to use it
- To transform response data from one step before passing it to the next.
- To perform complex assertions that aren’t possible with standard validators.
- To simulate custom delays or conditional logic within a flow.
Example Code Snippet
When defining a JavaScript endpoint, you can provide a script like this:Context Object
Thecontext object is provided to your script and includes:
getPreviousResponse(): Returns the result of the previous execution step.setVariable(name, value): Sets an environment variable for the duration of the flow.getVariable(name): Retrieves a variable.stopFlow(): Aborts the current flow execution.