Skip to main content

Set Item

Sets an item in a vault.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed even if a Catch node is used.

Input

  • Item - Item to set in the vault.

Output

  • Item Metadata - Metadata of the new item that was set in the vault.

Options

  • Credentials - The Vault and the Item to retrieve should be selected from here.

Item Metadata is automatically created and sent with the Set Item node.

How It Works

The Set Item node updates existing credential items in Robomotion vaults:

  1. Credential Retrieval:

    • Retrieves vault and item IDs from configuration or message
    • Decodes the credentials structure
    • Validates both IDs are provided and valid
  2. Item Data Preparation:

    • Retrieves the new item data from the input
    • Marshals the item object to JSON format
    • Prepares data for vault API call
  3. Update Operation:

    • Calls the vault API to update the item
    • Replaces existing item data with new data
    • Encrypts the data using vault secret key
  4. Output:

    • Returns the credential metadata (vault ID and item ID)
    • Confirms the update was successful
    • Provides reference for subsequent operations

Requirements

  • Vault ID: Must be a valid GUID representing an existing vault
  • Item ID: Must be a valid GUID representing an existing item
  • Item Data: Object containing the updated credential data
  • Vault Access: User must have write permissions on the vault
  • Item Existence: Item must already exist in the vault

Error Handling

Error CodeDescriptionSolution
Core.Vault.SetItem.ErrOnCreateConfiguration parsing failedCheck node configuration in the flow
Core.Vault.SetItem.ErrOnMessageMessage parsing errorVerify message format is valid JSON
Core.Vault.SetItem.ErrCredentialsInvalid credentials, vault not selected, or item not selectedVerify vault ID and item ID are valid
Core.Vault.SetItem.ErrItemFailed to retrieve item dataVerify item data is provided in message
Core.Vault.SetItem.ErrMarshalItemFailed to serialize item dataCheck item object structure
Core.Vault.SetItem.ErrSetItemFailed to update item in vaultCheck vault permissions and item existence
Core.Vault.SetItem.ErrOutputMarshalFailed to serialize outputCheck output variable configuration

Usage Examples

Example 1: Update Login Password

// Update password for existing login item
msg.updatedLogin = {
username: "admin",
password: "newSecurePassword123",
url: "https://app.example.com"
};
// Credentials: Select vault and item from dropdown
// After execution: Password is updated in vault

Example 2: Update API Token

// Replace expired API token
msg.tokenUpdate = {
token: "new_api_token_xyz789",
expiresAt: "2025-12-31",
scopes: ["read", "write", "admin"]
};
// After execution: API token is updated with new value

Example 3: Update Database Credentials

// Update database connection details
msg.dbUpdate = {
host: "new-mysql.example.com",
port: 3306,
database: "production_db",
username: "new_app_user",
password: "new_db_password_456"
};
// After execution: Database credentials are updated

Usage Notes

  • Complete Replacement: Set Item replaces all data - include all fields
  • Item Must Exist: Cannot create new items - use Add Item instead
  • Encryption: Data is automatically encrypted before storage
  • Metadata Preserved: Item name and category are not changed
  • No Partial Updates: Must provide complete item structure
  • Immediate Effect: Changes take effect immediately for all users
  • Dynamic Selection: Can specify vault/item via dropdown or message

Tips

  • Get the existing item first to preserve fields you don't want to change
  • Merge new data with existing data before calling Set Item
  • Validate all required fields are present before updating
  • Use Try-Catch to handle cases where item might not exist
  • Test updates on a non-production vault first
  • Log update operations for audit trails
  • Consider using item versioning externally for rollback capability
  • Avoid frequent updates to reduce vault API load
  • Use Set Item for rotation of credentials and tokens
  • Coordinate updates across teams to avoid conflicts
  • Get Item - Retrieve current item before updating
  • Add Item - Create new items instead of updating
  • Delete Item - Remove items that are no longer needed
  • List Items - Find items to update
  • Object Merge - Merge partial updates with existing data