Create a workflow for a feature flag. You can create a workflow directly, or you can apply a template to create a new workflow.
You can use the create workflow endpoint to create a workflow directly by adding a stages
array to the request body.
For each stage, define the name
, conditions
when the stage should be executed, and action
that describes the stage.
Example request body
You can also create a workflow by applying a workflow template. If you pass a valid workflow template key as the templateKey
query parameter with the request, the API will attempt to create a new workflow with the stages defined in the workflow template with the corresponding key.
Templates are created in the context of a particular flag in a particular environment in a particular project. However, because workflows created from a template can be applied to any project, environment, and flag, some steps of the workflow may need to be updated in order to be applicable for the target resource.
You can pass a dryRun
query parameter to tell the API to return a report of which steps of the workflow template are applicable in the target project/environment/flag, and which will need to be updated. When the dryRun
query parameter is present the response body includes a meta
property that holds a list of parameters that could potentially be inapplicable for the target resource. Each of these parameters will include a valid
field. You will need to update any invalid parameters in order to create the new workflow. You can do this using the parameters
property, which overrides the workflow template parameters.
You can use the parameters
property in the request body to tell the API to override the specified workflow template parameters with new values that are specific to your target project/environment/flag.
Example request body
If there are any steps in the template that are not applicable to the target resource, the workflow will not be created, and the meta
property will be included in the response body detailing which parameters need to be updated.
The project key
The feature flag key
The environment key
The template key to apply as a starting point for the new workflow
Whether to call the endpoint in dry-run mode
The workflow name
The ID of the workflow maintainer. Defaults to the workflow creator.
The workflow description
A list of the workflow stages
The template key
Workflow response
The ID of the workflow
The version of the workflow
Any conflicts that are present in the workflow stages
Timestamp of when the workflow was created
The member ID of the maintainer of the workflow. Defaults to the workflow creator.
The location and content type of related resources
The name of the workflow
The current execution status of the workflow
A brief description of the workflow
The kind of workflow
The stages that make up the workflow. Each stage contains conditions and actions.
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
For workflows being created from a workflow template, this value is the template’s key