Control Flow
Control flow in Laminar
Control flow basics
Adding if this then that
logic in Laminar can be done by using Lam's in-built if statement syntax:
In the example above, we receive some JSON payload and decide whether we invoke a new workflow based on whether we have the correct initial conditions.
This control flow runs inside a workflow that was created to specifically handle the logic of whether or not to continue execution based on initial conditions.
Workflows can be created to specifically handle control flow and passing data to other workflows.
Laminar Keywords
In this example, we're either calling resolveThenExecute
and invoking Workflow 60 to execute with an initial payload of .
(this represents the entire value of the .input
key) and resolving the request with a { "status": "OK" }
or exiting our workflow entirely by using the exit
keyword.
Keywords allow for workflows to be executed conditionally from within flows, making it easier to support extremely complex control flow logic within custom integrations.
Last updated