Configurations

Learn how to use configurations in Laminar

A common pattern in building integrations is validating them across different settings, environments or even customer profiles. For example, you may want to validate an integration using test credentials. In Laminar, this is handled by configuration stores.

With configuration stores, users can create different configurations and choose a specific configuration to execute a workflow.

1. Creating a configuration

The first step is to create key-value configuration pairs

Creating configurations

2. Use configuration in workflow steps

When you need to use configuration variables within your workflow steps definition, use the following format:

{{config.<configuration_key>}}

Example:

(data) => {
  let transformed_data = data.step_1.response
  
  return {
    "lam.httpRequest": {
      "method": "POST",
      "url": "{{config.WAREHOUSE_API_URL}}/warehouse/orders",
      "headers": {
        "Content-Type": "application/json"
      },
      "body": transformed_data
    }
  };
}

3. Execute workflow with specific configuration

In order to execute a workflow with a specific configuration, you need to add the configuration id to the workflow execution url. Refer to the example below:

# Execute workflow for Customer A
# workflow_execution_url: https://api.laminar.run/workflow/execute/external/<workflow_id>?api_key=<api_key>

curl -X POST '<workflow_execution_url>&configuration_id=<configuration_id>' \
  -H 'Content-Type: application/json' \
  -d '{
    "data": "your workflow input"
  }'

Last updated

Was this helpful?