[DEPRECATED] lam.result

Learn more about the result keyword

This keyword has been deprecated and will not be supported in future versions of Laminar. Please use the execute keyword instead.

Invocation

Data transformation for a flow must output:

{ 
 "lam.result": [
  {
    "lam.workflowId": Integer,
    "lam.payload": { ... }
  }
 ]
}
KeyDescriptionType

result

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 result keyword will execute each specified workflow in thelam.result 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 asynchronously and will not block the current running workflow's execution.

Examples

.input |
.ShipmentDetails.PackagesInfo.Packages as $pkgsInfo |
$pkgsInfo | to_entries | map(
    {
    "lam.workflowId": 53,
    "lam.payload": .value
    }
)

Explanation

Note: if we output an array of JSON objects from a data transformation, the Lam compiler will automatically group each outputted element in a lam.result array in order to store one JSON output.

In this example, we're making use of this functionality by outputting several JSON objects in the form:

{
    "lam.workflowId": 53,
    "lam.payload": {...}
}

That will then be collected under the lam.result key:

{
  "lam.result": [
    {
      "lam.workflowId": 53,
      "lam.payload": {...}
    }
    ...
  ]
}

Which is how we're invoking this keyword.

Last updated