Parse Integration Gateway Request

For this example, let’s parse a request sent to the Integration Gateway

parse gateway payload
Figure 1. The screenshot outlines the workflow that can be used to process the request.

The source code for the workflow example.

Workflow step details:
  1. (1) System; onManual:

    • resource: System

    • event: onManual

    • enabled: checked

  2. (2) Parse request payload:

    • type: Process arbitrary data in jsenv

    • arguments:

      • scope:

        • type: Any

        • value type: expression

        • value: payload

      • source: refer below

    • results:

      • resultAny: parsedPayload

  3. (3) Debug state

  4. (7) Done

Integration gateway configuration

Table 1. Below are the configuration parameters for the corresponding integration gateway:




Header: Token == "SOME_SECRET_TOKEN"


Workflow processer: On request payload notify user


Default JSON Response

cURL request

Below is an example of the cURL request that invokes the integration gateway and workflow:
curl -X POST "$CORTEZA_BASE/api/gateway/examples/payload" \
  -H "Content-Type: application/json" \
  -d '{"name":"Peter","id":123}';

JSEnv parsing function

Below is the extracted source code which should be used in the JSEnv function step:
var inputData;

try {
    inputData = JSON.parse(input)
} catch (e) {
    throw new Error('could not parse input payload: ' + e);

if (! {
    throw new Error('could not parse input payload, name missing');

return {