Skip to main content

setEnrichmentBulk

A Workflow Engine function that updates multiple records in the enrichment datastore with an array of data from an alert. Returns true if the request is successful.

This function relates directly to the API details from your Enrichment API integration.

This function is available as a feature of the Add-ons v1.4 download and later.

This function is available for event, alert, and enrichment workflows.

This function does not modify the in-scope object when it updates enrichment data.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function setEnrichmentBulk takes the following arguments:

Name

Required

Type

Description

data

Yes

String

Name of the field or workflowContext key which holds the data to store against source key. To specify a workflowContext key, prefix with "workflowContext". For example, "workflowContext.datakey".

Must contain a vaild array of JSON objects which contain the attribute, value, and enrichment values to use.

Example

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

You want to send an update to your Enrichment API endpoint using data stored in the workflowContext key “data” as the enrichment data to store. Set the following:

  • data: workflowContext.datakey

The UI translates your settings to the following JSON:

{"data":"workflowContext.datakey"}

The data must contain an array of JSON objects which contain the attribute, value and enrichment to store. For example:

[
  {
    "attribute": "source", 
    "value": "node_1", 
    "enrichment": { "service": "service_1"} 
  },
  {
    "attribute": "source", 
    "value": "node_2", 
    "enrichment": { "service": "service_2"} 
  }
]

This results in two update requests to the Enrichment API: one request to store the { ”service”: ”service_1” } enrichment data against the attribute “source” and value “node_1”, and a second request to store the { ”service”: ”service_2” } enrichment data against the attribute “source” and value “node_2”. If these requests are successful, the function returns true and applies the updates.