createPayload

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 Payload Maps integration.

This function is available as a feature of the Workflow Engine v1.2 and later. If you are using a newer version of the Workflow Engine, use getPayload instead.

This function is available for event, alert, enrichment, 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.Workflow Engine Functions Reference

Arguments

Workflow Engine function createPayload takes the following arguments:

Name

Required

Type

Description

mapName

Yes

String

Name of the map from the Payload Maps integration.

Example

The following example demonstrates typical use of Workflow Engine function createPayload.

If you wanted 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 created 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.