Launch Darkly icon

Launch Darkly

Launch Darkly API

Actions2

Overview

This node allows you to update feature flag settings for a specific user in LaunchDarkly. It is useful when you want to programmatically override the value of a feature flag for an individual user, such as enabling or disabling a feature for beta testing, troubleshooting, or personalized rollouts.

Common scenarios:

  • Granting early access to new features for selected users.
  • Disabling a problematic feature for a specific user.
  • Managing user-specific experiments or A/B tests.

Example:
You have a feature flag "new-dashboard" and want to enable it only for user "user123" in your production environment. This node lets you set that flag's variation for just that user.

Properties

Name Type Meaning
Authentication options The authentication method used to connect to LaunchDarkly (Access Token).
Project Key Name or ID options The key or ID of the LaunchDarkly project containing the flag. Can be chosen from a list or specified via expression.
Environment Key Name or ID options The key or ID of the environment within the project. Can be chosen from a list or specified via expression.
User Key string The unique identifier of the user whose flag setting will be updated.
Feature Flag Key Name or ID options The key or ID of the feature flag to update. Can be chosen from a list or specified via expression.
Setting Name or ID options The variation value to assign to the user for the selected flag. Must match the flag's variation type. Can be chosen from a list or specified via expression.
Comment string Optional comment describing the reason for the change.

Output

The node outputs a JSON object with the following structure on success:

{
  "success": true,
  "projectKey": "<Project Key>",
  "environmentKey": "<Environment Key>",
  "userKey": "<User Key>",
  "featureFlagKey": "<Feature Flag Key>",
  "setting": "<Variation Value>",
  "comment": "<Comment>"
}
  • success: Indicates if the operation was successful.
  • projectKey, environmentKey, userKey, featureFlagKey, setting, comment: Echoes back the input values for traceability.

On error (if "Continue On Fail" is enabled), the output will include:

{
  "error": "<Error message>"
}

Dependencies

  • External Service: Requires access to the LaunchDarkly API.
  • API Key: Needs a valid LaunchDarkly Access Token configured in n8n credentials under "launchDarklyApi".
  • n8n Configuration: No special configuration required beyond credentials.

Troubleshooting

Common Issues:

  • Invalid Credentials: If the access token is incorrect or missing, the node will fail to authenticate.
  • Missing Required Fields: If any required property (e.g., Project Key, Environment Key, User Key, Feature Flag Key, Setting) is not provided, the node will throw an error.
  • Invalid Variation Value: If the "Setting" does not match one of the allowed variations for the flag, the API call will fail.
  • User Not Found: If the specified user does not exist, the operation may fail depending on LaunchDarkly's API behavior.

Common Error Messages:

  • "401 Unauthorized": Check your Access Token and permissions.
  • "404 Not Found": Ensure the project, environment, user, or flag keys are correct.
  • "400 Bad Request": Likely due to an invalid setting value or malformed request body.

How to resolve:

  • Double-check all input fields for typos or missing values.
  • Verify that the Access Token has sufficient permissions.
  • Use the "Test" button in n8n credentials to validate connectivity.

Links and References

Discussion