Skip to content

Update Secret

The Update Secret task is used to update the value of any secret already stored in Conductor, provided the user has permission to modify it.

The task requires a secretKey and a secretValue. If the user does not have update permission for the specified secretKey, the workflow fails with a 403 error. If the secret does not already exist, the task creates it.

Task parameters

Configure these parameters for the Update Secret task.

Parameter Description Required/ Optional
inputparameters._secrets A nested object within inputParameters containing the secretKey and secretValue fields. Required.
inputparameters._secrets.secretKey The name of the secret key to be updated. It can be passed as a dynamic variable. Required.
inputparameters._secrets.secretValue The new value for the secret key. It can be passed as a dynamic variable. Required.

The following are generic configuration parameters that can be applied to the task and are not specific to the Update Secret task.

Other generic parameters

Here are other parameters for configuring the task behavior.

Parameter Description Required/ Optional
optional Whether the task is optional.

If set totrue, any task failure is ignored, and the workflow continues with the task status updated to COMPLETED_WITH_ERRORS. However, the task must reach a terminal state. If the task remains incomplete, the workflow waits until it reaches a terminal state before proceeding.
Optional.

Task configuration

This is the task configuration for an Update Secret task.

{
     "name": "update_secret",
     "taskReferenceName": "update_secret_ref",
     "inputParameters": {
       "_secrets": {
         "secretKey": "my_token",
         "secretValue": "input secret value here"
       }
     },
     "type": "UPDATE_SECRET"
}

Task output

This task will not return any output parameters. During execution, the secret is replaced with whatever value is passed. If the secret does not exist, it will be created with the provided secret value.

Examples

Here are some examples for using the Update Secret task.

Using Update Secret task in a workflow

To demonstrate the Update Secret task, consider the following secret already saved in Conductor.

Saved secret in Orkes Conductor

The following workflow updates the value of the my_token secret to abcd.

To create a workflow:

  1. Go to Definitions > Workflow, from the left navigation menu on your Conductor cluster.
  2. Select + Define workflow.
  3. In the Code tab, paste the following workflow definition:
{
 "name": "UpdateSecretDemo",
 "description": "Sample workflow",
 "version": 1,
 "tasks": [
   {
     "name": "update_secret_task",
     "taskReferenceName": "update_secret_task_ref",
     "inputParameters": {
       "_secrets": {
         "secretKey": "my_token",
         "secretValue": "abcd"
       }
     },
     "type": "UPDATE_SECRET"
   }
 ],
 "schemaVersion": 2
}
  1. Save the workflow.
  2. Select Execute to run the workflow.

Once the execution is successful, navigate to the Definitions > Secrets, search for the secret name, and select the eye icon to verify the updated secret value.

Updated secret in Orkes Conductor using update secret task