Add Item
Adds an item to the selected 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 ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Input
- Name - Name of the item to add.
- Item - Object to add as the value of the item.
Output
- Item - Newly added item object.
Options
- Category - Choose a category for the item. Possible values are Login, Email Account, Credit Card, API Key/Token, Database, Document, AES Key.
- Vault - Vault in which to add the item.
How It Works
The Add Item node creates new credential items in Robomotion vaults:
-
Vault Selection:
- Retrieves the vault ID from the configuration or message
- Validates that the vault ID is a valid GUID format
- Ensures vault is not empty or placeholder value
-
Input Validation:
- Validates item name is provided and not empty
- Validates category is selected (cannot be empty or placeholder)
- Validates item data is provided
-
Item Creation:
- Marshals the item object to JSON format
- Calls the vault API to add the item with name, category, and data
- Creates a new vault item entry in the selected vault
-
Output Generation:
- Returns the newly created item with metadata
- Includes item name, category, item ID, and vault ID
- Provides the complete item object for reference
Requirements
- Vault ID: Must be a valid GUID representing an existing vault
- Item Name: Must be non-empty string
- Category: Must be selected from available categories
- Item Data: Object containing the credential data (structure depends on category)
- Vault Access: User must have write permissions to the specified vault
Error Handling
| Error Code | Description | Solution |
|---|---|---|
Core.Vault.AddItem.ErrOnCreate | Configuration parsing failed during node creation | Check node configuration in the flow |
Core.Vault.AddItem.ErrOnMessage | Message parsing error | Verify message format is valid JSON |
Core.Vault.AddItem.ErrCredentials | Invalid credentials or vault not selected | Verify vault ID is valid and selected |
Core.Vault.AddItem.ErrEmpty | Vault ID is empty | Provide a valid vault ID |
Core.Vault.AddItem.ErrInvalid | Vault ID is not a valid GUID | Use a properly formatted vault GUID |
Core.Vault.AddItem.ErrName | Item name is empty or invalid | Provide a non-empty item name |
Core.Vault.AddItem.ErrCategory | Category not selected | Select a valid category |
Core.Vault.AddItem.ErrItem | Item data retrieval failed | Verify item data is properly formatted |
Core.Vault.AddItem.ErrMarshalItem | Failed to serialize item data | Check item object structure |
Core.Vault.AddItem.ErrAddItem | Failed to add item to vault | Check vault permissions and API connectivity |
Core.Vault.AddItem.ErrOutputMarshal | Failed to serialize output | Check output variable configuration |
Usage Examples
Example 1: Add Login Credentials
// Add a new login item to vault
msg.itemName = "Production Database Login";
msg.loginData = {
username: "admin",
password: "secretpass123",
url: "https://db.example.com"
};
// Category: Login (selected in node options)
// Vault: Select vault from dropdown
// After node execution:
// msg.newItem.meta contains {name, category, itemId, vaultId}
Example 2: Add API Token
// Store an API key securely
msg.name = "GitHub API Token";
msg.item = {
token: "ghp_xxxxxxxxxxxx",
description: "Personal access token for CI/CD",
expiresAt: "2024-12-31"
};
// Category: API Key/Token (selected in node options)
// After node execution:
// msg.createdItem contains the new vault item with metadata
Example 3: Add Database Credentials
// Add database connection details
msg.itemName = "MySQL Production";
msg.dbCredentials = {
host: "mysql.example.com",
port: 3306,
database: "production_db",
username: "app_user",
password: "db_password_123"
};
// Category: Database (selected in node options)
// After node execution:
// New database item is added to the vault
Usage Notes
- Category Types: Category determines the structure expected for the item data
- GUID Format: Vault ID must be in standard GUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
- Unique Names: Item names don't have to be unique within a vault
- Item Structure: Each category expects specific fields in the item object
- Permissions: User must have write access to the vault
- Item ID: Generated automatically and returned in the output metadata
- Immutable Metadata: Item metadata (name, category) can be updated via Set Item node
- Dynamic Vault: Vault can be specified from message instead of dropdown
Tips
- Use descriptive names for vault items to make them easy to identify
- Store all sensitive data in vaults instead of hardcoding in flows
- Use appropriate categories for better organization and filtering
- Document the structure of custom item types for team members
- Validate item data before adding to ensure required fields are present
- Use Try-Catch to handle cases where vault might not be accessible
- Store the returned item ID for future reference and updates
- Avoid storing sensitive data in item names (names may be logged)
- Use Set Item node to update existing items instead of adding duplicates
- Consider vault naming conventions for multi-environment setups
Related Nodes
- Get Item - Retrieve items from vaults
- Set Item - Update existing vault items
- Delete Item - Remove items from vaults
- List Items - List all items in a vault
- List Vaults - Get available vaults