Integration with Control Flow Example
Connecting two API endpoints together
Last updated
Connecting two API endpoints together
Last updated
In this video, we show you how to extend the simple integration example. We'll be adding query params, dynamic headers, and control flow to the our multi-step workflow execution. We'll use a Laminar Keyword to run a workflow depending on if a condition is met.
To send data individually for each user by making a POST request to a destination, dynamically adding query parameters and headers, and incorporating control flow in the workflow execution.
Create a new flow in Laminar named "Determine if should send user" with no source to execute control flow logic using a Laminar Keyword.
Use jq to extract data from the first step by accessing the key: .step_1.data.users
.
Pass the users array to a new key in an object using .users
from step1.data.users
.
Add query parameters and headers dynamically using lam.queryParams
and lam.headers
.
Include a body using lam.body
with the desired object data.
Create a new workflow called "Recursively Send Data" to send requests for each user in the user array.
Use the lam.result
syntax to execute a workflow by ID for each user.
Implement conditions using an if statement to filter data based on specific attributes like total spent.
Ensure proper syntax and structure while adding query parameters, headers, and body data.
Verify workflow IDs and payload data for accurate execution.
Double-check conditions and statements to filter data correctly.
Use lam.workflowId
and lam.payload
to iterate over users and pass data to the specified workflow.
Utilize if statements to apply conditions for filtering data based on specific attributes.
Test the workflow execution to ensure accurate data transmission and control flow implementation.
We transformed our first JSON with control flow using this JQ: