getPayload
A Workflow Engine function that creates a workflowContext
payload from the triggering object from a predefined payload map. For use in subsequent actions, for example exportViaRest or exportViaKafka.
This function relates directly to the payload maps from your Payloads integration.
This function is available as a feature of the Add-ons v1.3 download and later.
This function is available for event, alert, and Situation workflows.
This function does not modify the in-scope object.
The workflow sweep up filter applies to this function. Swept up objects have an entry under the workflowContext.payloads
object corresponding to their associated ID.
Back to Workflow Engine Functions Reference.
Arguments
Workflow Engine function getPayload
takes the following arguments:
Name | Required | Type | Description |
---|---|---|---|
| Yes | String | Name of the map from the Payloads integration. |
Example
The following example demonstrates typical use of Workflow Engine function getPayload
.
To create a payload for a map called "AlertExport", set the following:
mapName
: AlertExport
The UI translates your settings to the following JSON:
{ “mapName”:”AlertExport”}
The function returns true
when it finds a map and creates the payload. It stores the payload in the workflowContext
payloads key. The function also assigns the payload an identifier for the in-scope object.
For example, a payload for an alert with the ID #1234 stores in workflowContext
as follows:
"workflowConext" : { "payloads" : { "1234" : { ... } } }
Note
All functions must use the same structure for payloads. For alerts and Situations, use the object ID. For events, use the signature value.