lam.resolveThenExecute

Learn about the resolveThenExecute keyword

Invocation

Data transformation must output:

{
  "lam.resolveThenExecute": {
    "lam.workflowId": Int,
    "lam.payload": { ... },
    "lam.result": { ... }
  }
}
Key
Description
Type

workflowId

The workflow ID to invoke after the current pending request is resolved.

Integer

payload

The payload to pass the workflow we're invoking.

Object

result

The result we're resolving the pending request with

Object

Functionality

The resolveThenExecute keyword will resolve the pending request that executed the workflow with contents from the lam.result key. This keyword can be used to support the execution of an integration without requiring the workflow executor to wait until the workflow is complete (i.e. receiving a webhook on /workflows/extecute/external and resolving the webhook request immediately before executing workflows).

Examples

.step_2.data as $result |
.input |
.Recipient as $rcp |
.PackagesInfo.Packages as $pkgsInfo |
$pkgsInfo | to_entries | map({
  address_1: $rcp.Address1,
  address_2: $rcp.Address2,
  address_city: $rcp.City,
  address_state_id: $rcp.CountryStateCode,
  address_country_id: $rcp.CountryCode,
  address_zip: $rcp.PostalCode,
  tracking_number: .value.PreAssignTrackingNumber.TrackingNumber
}) as $packages |
{
  "lam.resolveThenExecute": {
    "lam.workflowId": 52,
    "lam.payload": {
        "packages": $packages
    },
    "lam.result": $result
  }
}

In this example we start workflow 52 with our packages array and resolve the pending request with our $result.

Last updated