Payloads
The Payload Maps integration tile enables users to create a JSON object that contains key-value pairs from event, alert, or Situation (CEvent) objects. Payload maps can be used with WorkflowEngine actions to dynamically generate content from a CEvent object as it passes through an action. For example, the createMacroPayload action uses a referenced payload map to generate content from a CEvent object for use by export actions such as exportViaRest and exportViaKafka.
You can use this integration to define mappings between an Alert or Situation and the keys in a JSON payload, enabling the creation of payloads that send Alert or Situation data to external systems.
Payload map configuration follows a pattern similar to LAM mappings. Each configuration consists of name:rule pairs, where the rule supports macros that can transform or modify Alert or Situation values. A payload map can contain multiple rules, and the resulting JSON payload contains key:value pairs generated from those rules.
In Add-Ons 2.7.0 and later, a payload map can also contain a freeform JSON definition. You can use a freeform JSON definition alongside standard name:rule pairs, or use it exclusively to define the entire payload.
Before You Begin
Before you start to set up your integration, ensure you know the following about your payload map:
A Map Name for your payload map. For example, "My REST Mapping".
The keys for your resulting payload. Use these as the rule name.
The values for your resulting payload. These serve as rules and allow you to use a predefined set of macros.
Any default value, if any, you want for a key.
Whether you want to define the payload using standard
name:rulemappings, a freeform JSON blob, or a freeform JSON blob as the root payload object.
Configure the Payloads Integration
You can configure multiple payload maps from the Payloads integration. To configure the integration:
Navigate to the Integrations tab.
Click Payloads in the Reporting and Dashboards section.
Provide a unique integration name. You can use the default name or customize the name according to your needs.
Enter the details for each payload map you want to configure.
Note
To define a rule using a JSON blob, select
Freeform JSONand enter the JSON definition in the displayed text area. To make the JSON blob the entire payload, selectRoot Object. If you do not selectRoot Object, specify aname:rule; the JSON blob is added as the value of that named key.
See Configure Payload Mapping Rules and Macros Reference for more information on mapping rules and macros.
After you complete the configuration, you can use payload maps in your workflows. For example, you can use the getPayload action to generate a payload from an alert or Situation. Use the map name from your configuration when the workflow action requires the map name.