Get custom workflow
For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Get a specific workflow by ID.
curl --request GET \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId} \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_id": "12ab3c4d5ef1a2345bcde67f",
"_version": 1,
"_conflicts": [
{
"stageId": "12ab3c4d5ef1a2345bcde67f",
"message": "<string>"
}
],
"_creationDate": "1654104600000",
"_maintainerId": "12ab3c45de678910abc12345",
"_links": {},
"name": "Progressive rollout starting in two days",
"_execution": "{\"status\": \"completed\"}",
"description": "Turn flag on for 10% of customers each day",
"kind": "custom",
"stages": [
{
"_id": "12ab3c45de678910abc12345",
"conditions": [
{
"_execution": {
"status": "completed"
},
"id": "12ab3c45de678910abc12345",
"kind": "schedule",
"scheduleKind": "relative",
"waitDuration": 2,
"waitDurationUnit": "calendarDay"
}
],
"action": "{ \"kind\": \"patch\", \"instructions\": [{ \"kind\": \"turnFlagOn\"}] }",
"_execution": "{ \"status\": \"completed\" }",
"name": "10% rollout on day 1"
}
],
"meta": {
"parameters": [
{
"_id": "<string>",
"path": "<string>",
"default": {
"value": "<unknown>",
"booleanVariationValue": true,
"ruleClause": {
"attribute": "<string>",
"op": "in",
"negate": true
}
},
"valid": true
}
]
},
"templateKey": "example-workflow-template"
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}Authorizations
Path Parameters
The project key
The feature flag key
The environment key
The workflow ID
Response
Workflow response
The ID of the workflow
"12ab3c4d5ef1a2345bcde67f"
The version of the workflow
1
Any conflicts that are present in the workflow stages
Show child attributes
Show child attributes
Timestamp of when the workflow was created
"1654104600000"
The member ID of the maintainer of the workflow. Defaults to the workflow creator.
"12ab3c45de678910abc12345"
The location and content type of related resources
Show child attributes
Show child attributes
The name of the workflow
"Progressive rollout starting in two days"
The current execution status of the workflow
Show child attributes
Show child attributes
"{\"status\": \"completed\"}"
A brief description of the workflow
"Turn flag on for 10% of customers each day"
The kind of workflow
"custom"
The stages that make up the workflow. Each stage contains conditions and actions.
Show child attributes
Show child attributes
For workflows being created from a workflow template, this value holds any parameters that could potentially be incompatible with the current project, environment, or flag
Show child attributes
Show child attributes
For workflows being created from a workflow template, this value is the template's key
"example-workflow-template"
curl --request GET \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId} \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_id": "12ab3c4d5ef1a2345bcde67f",
"_version": 1,
"_conflicts": [
{
"stageId": "12ab3c4d5ef1a2345bcde67f",
"message": "<string>"
}
],
"_creationDate": "1654104600000",
"_maintainerId": "12ab3c45de678910abc12345",
"_links": {},
"name": "Progressive rollout starting in two days",
"_execution": "{\"status\": \"completed\"}",
"description": "Turn flag on for 10% of customers each day",
"kind": "custom",
"stages": [
{
"_id": "12ab3c45de678910abc12345",
"conditions": [
{
"_execution": {
"status": "completed"
},
"id": "12ab3c45de678910abc12345",
"kind": "schedule",
"scheduleKind": "relative",
"waitDuration": 2,
"waitDurationUnit": "calendarDay"
}
],
"action": "{ \"kind\": \"patch\", \"instructions\": [{ \"kind\": \"turnFlagOn\"}] }",
"_execution": "{ \"status\": \"completed\" }",
"name": "10% rollout on day 1"
}
],
"meta": {
"parameters": [
{
"_id": "<string>",
"path": "<string>",
"default": {
"value": "<unknown>",
"booleanVariationValue": true,
"ruleClause": {
"attribute": "<string>",
"op": "in",
"negate": true
}
},
"valid": true
}
]
},
"templateKey": "example-workflow-template"
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}