js/

The js/ notation introduces special characters that empower you to seamlessly integrate and utilize JavaScript code. It will execute anything after the / symbol as a Javascript code.

It is used inside the Node's Configuration, similar to the ${}.

The js/ notation have access to the entire context(ctx) properties.

How to use it

This special characters are allowed to be used while setting up a node's configuration. For example:

workflow.json
"nodes": {
    "api-call-config": {
        "inputs": {
            "properties": {
                "url": "js/ctx.vars.request.url",
                "method": "POST",
                "headers": {
                    "Content-Type": "application/json"
                },
                "body": {
                    "property": "js/ctx.request.body.prop"
                }
            }
        }
    }
}

In this example, the utilization of special notation js/ is evident in the context of accessing data from the ctx (context) through the body.property. This syntax allows for dynamic retrieval of values from the context, enhancing the flexibility and adaptability of the code.

We don't recommend this notation in conjunction with special syntax ${}.

But you will be able to use it in combination with Javascript Template Literals

Last updated