• /
  • EnglishEspañolFrançais日本語한국어Português
  • ログイン今すぐ開始

LaunchDarkly actions

|View as Markdown (English)

The LaunchDarkly actions let you manage feature flags directly from your workflows. You can list projects and environments, create and modify flags, toggle flags on or off, manage percentage rollouts, and control which contexts receive a given flag variation.

All actions authenticate with a LaunchDarkly personal or service access token sent as the raw Authorization header — no Bearer prefix. Each action accepts an optional baseUrl input so you can target the EU (https://app.eu.launchdarkly.com) or federal (https://app.launchdarkly.us) instance instead of the default US instance.

ヒント

Selector expressions for LaunchDarkly actions must parse responseBody as JSON. Start every selector expression with .responseBody | fromjson, for example .responseBody | fromjson.key.

Prerequisites

Action reference

ActionWhat it doesKey required inputs
launchDarkly.project.listList all projects in the accounttoken
launchDarkly.environment.listList environments in a projecttoken, projectKey
launchDarkly.flag.createCreate a flag — returns variation IDs needed by targeting actionstoken, projectKey, name, key
launchDarkly.flag.getGet flag configurationtoken, projectKey, featureFlagName
launchDarkly.flag.listList flags in a projecttoken, projectKey
launchDarkly.flag.toggleTurn a flag on or off in one environmenttoken, projectKey, env, featureFlagName, enabled
launchDarkly.flag.archiveSoft-delete a flag (reversible)token, projectKey, featureFlagName
launchDarkly.flag.copyCopy flag settings between environments (Enterprise plan only)token, projectKey, featureFlagName, sourceEnvironmentKey, targetEnvironmentKey
launchDarkly.flagStatus.getGet flag lifecycle status in one environmenttoken, projectKey, env, featureFlagName
launchDarkly.flagStatus.listList statuses for all flags in an environmenttoken, projectKey, env
launchDarkly.rollout.getGet current rollout percentagestoken, projectKey, env, featureFlagName
launchDarkly.rollout.updateSet rollout percentagestoken, projectKey, env, featureFlagName, rolloutWeights
launchDarkly.contextTarget.addPin specific contexts to a variationtoken, projectKey, env, featureFlagName, variationId, contextKeys
launchDarkly.contextTarget.removeRemove contexts from individual targetingtoken, projectKey, env, featureFlagName, variationId, contextKeys
launchDarkly.contextTargetExpiry.addSchedule a context to be removed from targeting at a given timetoken, projectKey, env, featureFlagName, contextKey, variationId, expirationDate
launchDarkly.contextTargetExpiry.updateChange the time at which a scheduled expiry firestoken, projectKey, env, featureFlagName, contextKey, variationId, expirationDate
launchDarkly.contextTargetExpiry.removeCancel a scheduled expirytoken, projectKey, env, featureFlagName, contextKey, variationId

Common patterns

Disable a flag during an incident

Use launchDarkly.flag.toggle with enabled: false. This is a single-step operation — no other actions are needed.

Gradually roll out a flag and promote to 100%

  1. Create the flag with launchDarkly.flag.create — capture variation IDs from the response.
  2. Set an initial low rollout with launchDarkly.rollout.update using the captured variation IDs.
  3. Monitor with launchDarkly.flagStatus.get until the flag reaches active status.
  4. Promote to 100% with another launchDarkly.rollout.update.
  5. Archive with launchDarkly.flag.archive when the rollout is complete.

Beta-test with named users and auto-expire access

  1. Add specific users with launchDarkly.contextTarget.add — this action accepts a list of context keys.
  2. Schedule automatic removal for each user with launchDarkly.contextTargetExpiry.add — this action accepts a single contextKey, so you need one step per user.
  3. To extend access, use launchDarkly.contextTargetExpiry.update.
  4. To cancel the scheduled removal entirely, use launchDarkly.contextTargetExpiry.remove.

List projects

Action identifier: launchDarkly.project.list

Lists the projects in the LaunchDarkly account.

Input

Type

Description

token

String

Required. LaunchDarkly access token sent as the Authorization header. Must be passed as a secret. For example, ${{ :secrets:launchDarklyApiToken }}.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com. Use https://app.eu.launchdarkly.com for the EU instance or https://app.launchdarkly.us for the federal instance. No trailing slash or path.

limit

Integer

Optional. Maximum number of projects to return. For example, 20.

offset

Integer

Optional. Number of items to skip for pagination. For example, 0.

filter

String

Optional. LaunchDarkly filter expression to narrow results. For example, query:checkout.

sort

String

Optional. Field to sort by. Prefix with - for descending order. For example, name.

selectors

List

Optional. JQ selectors to extract fields from the response. responseBody is a JSON string — start each expression with .responseBody | fromjson. For example, [{"name": "projectKeys", "expression": "[.responseBody | fromjson.items[].key]"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String, the raw JSON from LaunchDarkly). The body includes items (array of projects) and totalCount (Int). For more information, see the Get projects API.

errorMessage

String

Error detail if the call failed.

name: listLaunchDarklyProjects
description: List all projects in the LaunchDarkly account
steps:
- name: listProjects
type: action
action: launchDarkly.project.list
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
selectors:
- name: projectKeys
expression: "[.responseBody | fromjson.items[].key]"
- name: totalCount
expression: ".responseBody | fromjson.totalCount"
next: end

List environments

Action identifier: launchDarkly.environment.list

Lists the environments in a LaunchDarkly project.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

limit

Integer

Optional. Maximum number of environments to return.

offset

Integer

Optional. Number of items to skip for pagination.

filter

String

Optional. LaunchDarkly filter expression. For example, query:checkout.

sort

String

Optional. Field to sort by. Prefix with - for descending order.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "environmentKeys", "expression": "[.responseBody | fromjson.items[].key]"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body includes items (array of environments) and totalCount (Int). For more information, see the Get environments API.

errorMessage

String

Error detail if the call failed.

name: listLaunchDarklyEnvironments
description: List all environments in a LaunchDarkly project
steps:
- name: listEnvironments
type: action
action: launchDarkly.environment.list
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
selectors:
- name: environmentKeys
expression: "[.responseBody | fromjson.items[].key]"
next: end

Create a flag

Action identifier: launchDarkly.flag.create

Creates a feature flag in a LaunchDarkly project. Defaults to a boolean flag when no variations are provided. Use the variation IDs from the response in subsequent steps that target specific variations.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

name

String

Required. Human-readable flag name. For example, New checkout flow.

key

String

Required. Unique flag key used to reference the flag in code and in other actions. For example, new-checkout.

description

String

Optional. Flag description. For example, Gates the new checkout flow.

tags

List

Optional. Tags to attach. For example, ["checkout", "release"].

temporary

Boolean

Optional. Whether the flag is temporary. LaunchDarkly defaults to true; pass false to create a permanent flag.

variations

List

Optional. Flag variations, each with a value and optional name and description. Omit to create a boolean flag. For example, [{"value": true, "name": "Enabled"}, {"value": false, "name": "Disabled"}].

defaults

Map

Optional. Indexes of the default on and off variations. Both onVariation and offVariation are required if this map is provided. For example, {"onVariation": 0, "offVariation": 1}.

clientSideAvailability

Map

Optional. Whether to expose the flag to client-side SDKs. Both usingEnvironmentId and usingMobileKey are required if this map is provided. For example, {"usingEnvironmentId": true, "usingMobileKey": false}.

maintainerId

String

Optional. Member ID of the flag maintainer.

customProperties

Map

Optional. Custom properties to attach to the flag. For example, {"jira": {"name": "Jira", "value": ["NR-1234"]}}.

clone

String

Optional. Key of an existing flag to clone from, including its targeting in every environment.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "flagKey", "expression": ".responseBody | fromjson.key"}, {"name": "variationIds", "expression": "[.responseBody | fromjson.variations[]._id]"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body includes the full flag representation, including key (String), name (String), variations (Array — each variation has an _id you can pass to targeting actions), and per-environment settings under environments. For more information, see the Create feature flag API.

errorMessage

String

Error detail if the call failed.

name: createFeatureFlag
description: Create a permanent boolean feature flag and capture its variation IDs
steps:
- name: createFlag
type: action
action: launchDarkly.flag.create
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
name: New checkout flow
key: new-checkout
temporary: false
selectors:
- name: flagKey
expression: ".responseBody | fromjson.key"
- name: trueVariationId
expression: ".responseBody | fromjson.variations[0]._id"
- name: falseVariationId
expression: ".responseBody | fromjson.variations[1]._id"
next: end

重要

flag.create returns a variation ID for each variation in responseBody.variations[]._id. Capture these IDs with selectors — you need them in every subsequent step that targets a specific variation: flag.toggle, rollout.update, contextTarget.add, contextTarget.remove, and all three contextTargetExpiry actions.

Get a flag

Action identifier: launchDarkly.flag.get

Gets the configuration of a feature flag, optionally scoped to one environment.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

featureFlagName

String

Required. The feature flag key. For example, new-checkout.

env

String

Optional. Limit the response to this environment. Omit to include all environments. For example, production.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "flagName", "expression": ".responseBody | fromjson.name"}, {"name": "on", "expression": ".responseBody | fromjson.environments.production.on"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body includes the full flag representation. For more information, see the Get feature flag API.

errorMessage

String

Error detail if the call failed.

name: getFeatureFlag
description: Get the configuration of a feature flag for one environment
steps:
- name: getFlag
type: action
action: launchDarkly.flag.get
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
featureFlagName: new-checkout
env: production
selectors:
- name: flagName
expression: ".responseBody | fromjson.name"
- name: on
expression: ".responseBody | fromjson.environments.production.on"
next: end

List flags

Action identifier: launchDarkly.flag.list

Lists the feature flags in a LaunchDarkly project.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

limit

Integer

Optional. Maximum number of flags to return.

offset

Integer

Optional. Number of items to skip for pagination.

filter

String

Optional. LaunchDarkly filter expression. For example, query:checkout.

sort

String

Optional. Field to sort by. Prefix with - for descending order.

env

String

Optional. Include flag settings for this environment in the response.

tag

String

Optional. Return only flags with this tag. For example, release.

archived

Boolean

Optional. Return archived flags instead of active ones. Defaults to false.

summary

Boolean

Optional. Return a summary of each flag without full per-environment configuration. For example, true.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "flagKeys", "expression": "[.responseBody | fromjson.items[].key]"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body includes items (array of flags) and totalCount (Int). For more information, see the Get feature flags API.

errorMessage

String

Error detail if the call failed.

name: listFeatureFlags
description: List all flags with a given tag
steps:
- name: listFlags
type: action
action: launchDarkly.flag.list
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
tag: release
selectors:
- name: flagKeys
expression: "[.responseBody | fromjson.items[].key]"
- name: totalCount
expression: ".responseBody | fromjson.totalCount"
next: end

Toggle a flag

Action identifier: launchDarkly.flag.toggle

Turns a feature flag on or off in one environment.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

env

String

Required. The environment key. For example, production.

featureFlagName

String

Required. The feature flag key. For example, new-checkout.

enabled

Boolean

Required. true turns the flag on; false turns it off.

comment

String

Optional. Comment recorded in the flag audit log. For example, Enabled by incident workflow.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "on", "expression": ".responseBody | fromjson.environments.production.on"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body includes the updated flag representation. For more information, see the Update feature flag API.

errorMessage

String

Error detail if the call failed.

name: enableFeatureFlag
description: Turn a feature flag on in production
steps:
- name: toggleFlag
type: action
action: launchDarkly.flag.toggle
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
env: production
featureFlagName: new-checkout
enabled: true
comment: Enabled by incident workflow
next: end

Archive a flag

Action identifier: launchDarkly.flag.archive

Archives a feature flag in a LaunchDarkly project. Archiving is a reversible soft-disable: the flag is hidden from the flag list and can be restored in LaunchDarkly. The flag key stays reserved until the flag is restored, so a workflow cannot recreate a flag under the same key while it is archived.

重要

There is no delete action for LaunchDarkly flags. Permanent deletion cannot be rolled back if a workflow runs by mistake. Use launchDarkly.flag.archive instead — it can be undone in LaunchDarkly.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

featureFlagName

String

Required. The feature flag key. For example, new-checkout.

comment

String

Optional. Comment recorded in the flag audit log. For example, Archived by cleanup workflow.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "archived", "expression": ".responseBody | fromjson.archived"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body is the updated flag with archived set to true. For more information, see the Update feature flag API.

errorMessage

String

Error detail if the call failed.

name: archiveFeatureFlag
description: Archive a feature flag after a successful rollout
steps:
- name: archiveFlag
type: action
action: launchDarkly.flag.archive
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
featureFlagName: new-checkout
comment: Archived by cleanup workflow
selectors:
- name: archived
expression: ".responseBody | fromjson.archived"
next: end

Copy flag settings

Action identifier: launchDarkly.flag.copy

Copies a feature flag's settings from one environment to another within the same project.

重要

Copying flag settings is a LaunchDarkly Enterprise plan feature. On any other plan, LaunchDarkly rejects the request and the action fails.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

featureFlagName

String

Required. The feature flag key. For example, new-checkout.

sourceEnvironmentKey

String

Required. Environment to copy settings from. For example, staging.

targetEnvironmentKey

String

Required. Environment to copy settings to. For example, production.

sourceCurrentVersion

Integer

Optional. Expected version of the source environment flag. The copy fails if the source has changed since. For example, 12.

targetCurrentVersion

Integer

Optional. Expected version of the target environment flag. The copy fails if the target has changed since. For example, 7.

includedActions

List

Optional. Copy only these parts of the flag (for example, updateOn, updateRules, updateFallthrough, updateOffVariation, updatePrerequisites, updateTargets). Cannot be combined with excludedActions.

excludedActions

List

Optional. Copy everything except these parts. Cannot be combined with includedActions.

comment

String

Optional. Comment recorded in the flag audit log.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "flagKey", "expression": ".responseBody | fromjson.key"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body is the updated flag representation. For more information, see the Copy feature flag API.

errorMessage

String

Error detail if the call failed.

name: copyFlagToProduction
description: Copy flag settings from staging to production
steps:
- name: copyFlag
type: action
action: launchDarkly.flag.copy
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
featureFlagName: new-checkout
sourceEnvironmentKey: staging
targetEnvironmentKey: production
comment: Promoted by release workflow
next: end

Get flag status

Action identifier: launchDarkly.flagStatus.get

Gets the status of a feature flag in one environment. Possible statuses are new, active, inactive, and launched.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

env

String

Required. The environment key. For example, production.

featureFlagName

String

Required. The feature flag key. For example, new-checkout.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "status", "expression": ".responseBody | fromjson.name"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body includes name (String: new, active, inactive, or launched) and lastRequested (String or null). For more information, see the Get feature flag status API.

errorMessage

String

Error detail if the call failed.

name: checkFlagStatus
description: Get the status of a feature flag in production
steps:
- name: getFlagStatus
type: action
action: launchDarkly.flagStatus.get
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
env: production
featureFlagName: new-checkout
selectors:
- name: status
expression: ".responseBody | fromjson.name"
next: end

List flag statuses

Action identifier: launchDarkly.flagStatus.list

Lists the status of every feature flag in one environment.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

env

String

Required. The environment key. For example, production.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "statuses", "expression": ".responseBody | fromjson.items"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body includes items (array, each with name and lastRequested). For more information, see the Get feature flag statuses API.

errorMessage

String

Error detail if the call failed.

name: listFlagStatuses
description: List the status of every flag in an environment
steps:
- name: listStatuses
type: action
action: launchDarkly.flagStatus.list
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
env: production
selectors:
- name: statuses
expression: ".responseBody | fromjson.items"
next: end

Get rollout

Action identifier: launchDarkly.rollout.get

Gets a feature flag's default (fallthrough) rule for one environment, including its percentage rollout. The rollout is in environments.<env>.fallthrough of the response body.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

env

String

Required. The environment key. For example, production.

featureFlagName

String

Required. The feature flag key. For example, new-checkout.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "fallthrough", "expression": ".responseBody | fromjson.environments.production.fallthrough"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The rollout is in environments.<env>.fallthrough.rollout. For more information, see the Get feature flag API.

errorMessage

String

Error detail if the call failed.

name: getRolloutConfig
description: Get the current rollout percentage for a flag
steps:
- name: getRollout
type: action
action: launchDarkly.rollout.get
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
env: production
featureFlagName: new-checkout
selectors:
- name: fallthrough
expression: ".responseBody | fromjson.environments.production.fallthrough"
next: end

Update rollout

Action identifier: launchDarkly.rollout.update

Updates the percentage rollout of a feature flag's fallthrough rule in one environment. Rollout weights are in thousandths of a percent and must sum to 100000.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

env

String

Required. The environment key. For example, production.

featureFlagName

String

Required. The feature flag key. For example, new-checkout.

rolloutWeights

Map

Required. Map of variation ID to weight in thousandths of a percent. Weights must sum to 100000 (representing 100%). Common conversions: 10% = 10000, 25% = 25000, 50% = 50000, 100% = 100000. Use variation IDs from a prior flag.create or flag.get step. For example, {"<trueVariationId>": 10000, "<falseVariationId>": 90000} sets a 10% rollout to the true variation.

rolloutContextKind

String

Optional. Context kind to bucket by. For example, user.

rolloutBucketBy

String

Optional. Context attribute to bucket by. For example, key.

comment

String

Optional. Comment recorded in the flag audit log.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "fallthrough", "expression": ".responseBody | fromjson.environments.production.fallthrough"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body is the updated flag representation. For more information, see the Update feature flag API.

errorMessage

String

Error detail if the call failed.

name: setTenPercentRollout
description: Ramp a flag to 10% in production using variation IDs from a prior step
steps:
- name: updateRollout
type: action
action: launchDarkly.rollout.update
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
env: production
featureFlagName: new-checkout
rolloutWeights: '${{ {(.steps.createFlag.outputs.trueVariationId): 10000, (.steps.createFlag.outputs.falseVariationId): 90000} }}'
comment: 10% rollout from release workflow
next: end

Add context targets

Action identifier: launchDarkly.contextTarget.add

Adds context keys to the individual targets of a feature flag so they always receive a given variation, regardless of rollout percentage.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key. For example, my-project.

env

String

Required. The environment key. For example, production.

featureFlagName

String

Required. The feature flag key. For example, new-checkout.

variationId

String

Required. The variation ID (the _id of an entry in the flag's variations list). For example, d9a1fdf9-94d5-4679-a5cd-6b46ac143ed8.

contextKeys

List

Required. Context keys to add. For example, ["beta-user-1", "beta-user-2"].

contextKind

String

Optional. Context kind the keys belong to. Defaults to user.

comment

String

Optional. Comment recorded in the flag audit log.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "targets", "expression": ".responseBody | fromjson.environments.production.contextTargets"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body is the updated flag representation. For more information, see the Update feature flag API.

errorMessage

String

Error detail if the call failed.

name: addBetaUsersToFlag
description: Add beta users to a feature flag's individual targets
steps:
- name: addContextTargets
type: action
action: launchDarkly.contextTarget.add
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
env: production
featureFlagName: new-checkout
variationId: ${{ .steps.createFlag.outputs.trueVariationId }}
contextKeys:
- beta-user-1
- beta-user-2
next: end

Remove context targets

Action identifier: launchDarkly.contextTarget.remove

Removes context keys from the individual targets of a feature flag.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key.

env

String

Required. The environment key. For example, production.

featureFlagName

String

Required. The feature flag key.

variationId

String

Required. The variation ID. For example, d9a1fdf9-94d5-4679-a5cd-6b46ac143ed8.

contextKeys

List

Required. Context keys to remove. For example, ["beta-user-1", "beta-user-2"].

contextKind

String

Optional. Context kind the keys belong to. Defaults to user.

comment

String

Optional. Comment recorded in the flag audit log.

selectors

List

Optional. JQ selectors to extract fields from the response.

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body is the updated flag representation. For more information, see the Update feature flag API.

errorMessage

String

Error detail if the call failed.

name: removeBetaUsersFromFlag
description: Remove beta users from a feature flag's individual targets
steps:
- name: removeContextTargets
type: action
action: launchDarkly.contextTarget.remove
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
env: production
featureFlagName: new-checkout
variationId: ${{ .steps.createFlag.outputs.trueVariationId }}
contextKeys:
- beta-user-1
- beta-user-2
next: end

Schedule a context target expiry

Action identifier: launchDarkly.contextTargetExpiry.add

Schedules a context target to be automatically removed from a feature flag's individual targeting at a given time.

注意

The response body identifies the context with either a userKey field or a contextKey/contextKind pair depending on your LaunchDarkly instance. Write selectors against the field your instance returns — do not assume one or the other.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key.

env

String

Required. The environment key. For example, production.

featureFlagName

String

Required. The feature flag key.

contextKey

String

Required. The key of the context whose targeting expires. For example, beta-user-1.

contextKind

String

Optional. The kind of context. Defaults to user.

variationId

String

Required. The variation ID. For example, d9a1fdf9-94d5-4679-a5cd-6b46ac143ed8.

expirationDate

Integer

Required. Epoch time in milliseconds at which the target is removed. For example, 1792833814467.

comment

String

Optional. Comment recorded in the flag audit log.

selectors

List

Optional. JQ selectors to extract fields from the response. For example, [{"name": "expiringTargets", "expression": ".responseBody | fromjson.items"}].

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body includes items (array of scheduled expiries), totalInstructions, successfulInstructions, and failedInstructions. Each item includes _id, _version, expirationDate, variationId, and a context identifier field (userKey or contextKey depending on your LaunchDarkly instance). For more information, see the Update expiring context targets API.

errorMessage

String

Error detail if the call failed.

name: scheduleContextTargetExpiry
description: Schedule a beta user to be removed from flag targeting in 24 hours
steps:
- name: addExpiry
type: action
action: launchDarkly.contextTargetExpiry.add
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
env: production
featureFlagName: new-checkout
contextKey: beta-user-1
variationId: ${{ .steps.createFlag.outputs.trueVariationId }}
expirationDate: ${{ ((now * 1000) | floor) + 86400000 }}
selectors:
- name: expiringTargets
expression: ".responseBody | fromjson.items"
next: end

Update a context target expiry

Action identifier: launchDarkly.contextTargetExpiry.update

Changes the time at which a scheduled context target is removed from a feature flag.

注意

The response body identifies the context with either a userKey field or a contextKey/contextKind pair depending on your LaunchDarkly instance. Write selectors against the field your instance returns — do not assume one or the other.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key.

env

String

Required. The environment key. For example, production.

featureFlagName

String

Required. The feature flag key.

contextKey

String

Required. The key of the context whose targeting expires.

contextKind

String

Optional. The kind of context. Defaults to user.

variationId

String

Required. The variation ID.

expirationDate

Integer

Required. New epoch time in milliseconds at which the target is removed.

version

Integer

Optional. Current _version of the expiring target entry. The update fails if the target has changed since this version. For example, 1.

comment

String

Optional. Comment recorded in the flag audit log.

selectors

List

Optional. JQ selectors to extract fields from the response.

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body includes items, totalInstructions, successfulInstructions, and failedInstructions. Each item in items includes _version (the new version after the update). For more information, see the Update expiring context targets API.

errorMessage

String

Error detail if the call failed.

name: extendContextTargetExpiry
description: Extend a scheduled context target expiry to 48 hours from now
steps:
- name: updateExpiry
type: action
action: launchDarkly.contextTargetExpiry.update
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
env: production
featureFlagName: new-checkout
contextKey: beta-user-1
variationId: ${{ .steps.createFlag.outputs.trueVariationId }}
expirationDate: ${{ ((now * 1000) | floor) + 172800000 }}
next: end

Remove a context target expiry

Action identifier: launchDarkly.contextTargetExpiry.remove

Removes the scheduled expiry from a context target so it stays on the feature flag indefinitely.

注意

The response body identifies the context with either a userKey field or a contextKey/contextKind pair depending on your LaunchDarkly instance. Write selectors against the field your instance returns — do not assume one or the other.

Input

Type

Description

token

String

Required. LaunchDarkly access token. Must be passed as a secret.

baseUrl

String

Optional. LaunchDarkly host. Defaults to https://app.launchdarkly.com.

projectKey

String

Required. The project key.

env

String

Required. The environment key.

featureFlagName

String

Required. The feature flag key.

contextKey

String

Required. The key of the context whose expiry to remove.

contextKind

String

Optional. The kind of context. Defaults to user.

variationId

String

Required. The variation ID.

comment

String

Optional. Comment recorded in the flag audit log.

selectors

List

Optional. JQ selectors to extract fields from the response.

Output

Type

Description

success

Boolean

true when LaunchDarkly returns a 2xx status.

response

Object

Present when success is true; null on error. Contains statusCode (Int) and responseBody (String). The body includes items (empty array on successful removal), totalInstructions, successfulInstructions, and failedInstructions. For more information, see the Update expiring context targets API.

errorMessage

String

Error detail if the call failed.

name: cancelContextTargetExpiry
description: Cancel a scheduled context target expiry so the user stays targeted
steps:
- name: removeExpiry
type: action
action: launchDarkly.contextTargetExpiry.remove
version: '1'
inputs:
token: ${{ :secrets:launchDarklyApiToken }}
projectKey: my-project
env: production
featureFlagName: new-checkout
contextKey: beta-user-1
variationId: ${{ .steps.createFlag.outputs.trueVariationId }}
next: end
Copyright © 2026 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.