TemplatedDirectRest

Use this node to call a specified server-relative URI as a simulated HTTP request and save the result into the app context. The payload (POST, PUT, PATCH) can use template features (rules, EL expression resolution, etc.) and is not restricted in size.

Asset Type Name for Rules 

Not supported

Example Definition in chain.json 

1{
2  "name": "create_account",
3  "label": "Creates an Account",
4  "dominoVariant": "sfdc_internal__UnifiedAnalyticsDominoVariant",
5  "parameters": {},
6  "definition": {
7    "nodes": {
8      "create_account": {
9        "graphNodeType": {
10          "name": "TemplatedDirectRest"
11        },
12        "parameters": {
13          "name": "create_account",
14          "file": "directrest/create_account.json",
15          "uri": "/sobjects/Account",
16          "method": "POST",
17          "apiVersion": 67.0,
18          "phases": ["validate", "execute"],
19          "expectedStatusCodes": [201, 204]
20        },
21        "sources": [],
22        "runAs": "CurrentUser"
23      }
24    }
25  }
26}

Parameters 

ParameterDefinition
name(Required) The developer name for this direct REST task.
file(Required) The path to the JSON file containing the request payload. This file supports template features (rules, EL expressions).
uri(Required) The server-relative URI to call (e.g. /sobjects/Account).
method(Required) The HTTP method to use. Supported values include GET, POST, PUT, PATCH, and DELETE.
apiVersion(Optional) The API version to use for the request, such as67.0.
phases(Optional) An array of phases during which this task should execute. Supported values include validate and execute.
expectedStatusCodes(Optional) An array of HTTP status codes considered successful, such as [201, 204].
condition(Optional) An EL expression, evaluated at runtime, that determines whether to execute this request or not.

Set runAs to CurrentUser so that this node runs with the permissions of the user installing the app. If you omit runAs, the node runs as AutoProc, a system user.

Note

App Context Values 

The response is stored in the app context under the node name.

On Failure 

If this task fails, it returns a FAIL_TERMINAL status. The chain stops and no downstream nodes run.

See Also