Copy (payload) => {
const { input } = payload;
if ((input.activity_type === "route-destination-status" ||
input.activity_type === "update-destinations") &&
/skipped|failed|completed|loaded/.test(String(input.detailed_event)) &&
input.order_id?.length > 0) {
return {
"lam.resolveThenExecute": {
"lam.workflowId": 60,
"lam.payload": input,
"lam.result": { "status": "OK" }
}
};
} else {
return { "lam.exit": true };
}
}
Copy .input |
if ((.activity_type == "route-destination-status" or
.activity_type == "update-destinations") and
(.detailed_event? | tostring | test("skipped|failed|completed|loaded")) and
(.order_id | length > 0))
then
{
"lam.resolveThenExecute": {
"lam.workflowId": 60,
"lam.payload": .,
"lam.result": { "status": "OK" }
}
}
else
{ "lam.exit": true }
end
Another Control Flow Example
Copy (payload) => {
const results = payload.step_1.response.results;
if (results.length === 0) {
return { "lam.exit": true };
} else if (results.length === 1) {
return {
"order_ids": [Number(results[0].order_id)]
};
} else {
return { "lam.exit": true };
}
}
Copy .step_1.response.results |
if length == 0 then
{ "lam.exit": true }
elif length == 1 then
.[0] | { "order_ids": [(.order_id | tonumber)] }
else
{ "lam.exit": true }
end
Keywords allow workflows to be executed conditionally from within flows, making it easier to support complex control flow logic within custom integrations.