lam.execute

Learn more about the execute keyword

Invocation

Data transformation for a flow must output:

{ 
 "lam.execute": [
  {
    "lam.workflowId": Integer,
    "lam.payload": { ... }
  }
 ]
}
Key
Description
Type

execute

The workflows to execute with a payload.

Array { lam.workflowId, lam.payload }

workflowId

The workflow ID to invoke.

Integer

payload

The payload to pass the workflow we're invoking.

Object

Functionality

The execute keyword will execute each specified workflow in thelam.execute array with its corresponding payload. This keyword allows for iterative operations (i.e. running a POST request for various objects in a list) that should be run synchronously and will block the current running workflow's execution.

Examples

.input |
.Recipient as $rcp |
.PackagesInfo.Packages as $pkgsInfo |
{
  "lam.execute": $pkgsInfo | to_entries | map({
    address_1: $rcp.Address1,
    address_2: $rcp.Address2,
    EXT_FIELD_first_name: $rcp.Firstname,
    EXT_FIELD_last_name: $rcp.Name,
    EXT_FIELD_email: $rcp.Email,
    EXT_FIELD_phone: $rcp.Tel,
    EXT_FIELD_weight: .value.Weight.Value,
    custom_user_fields: [
      {
        order_custom_field_id: 1852,
      }
    ],
    address_city: $rcp.City,
    address_state_id: $rcp.CountryStateCode,
    address_country_id: $rcp.CountryCode,
    address_zip: $rcp.PostalCode,
    tracking_number: .value.PreAssignTrackingNumber.TrackingNumber
  }) | map({
    "lam.workflowId": 39,
    "lam.payload": .
  })
}

In this example we map an array of packages to the execute keyword. Laminar will then invoke workflow 39 with each individual payload in sequence.

Last updated