Delete Artifact
Deletes an artifact from the session's artifact storage.
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.
Inputs
- Session ID - (string) Unique identifier for the session where the artifact is stored.
- Artifact Filename - (string) Name of the artifact to delete. Use "user:" prefix for user-scoped artifacts (e.g., "user:profile.jpg").
Outputs
This node does not have outputs.
How It Works
The Delete Artifact node removes files from the session's artifact service:
- Input Validation - Verifies that Session ID and Filename are provided
- Service Connection - Connects to the session's artifact service
- Deletion - Removes the specified artifact from storage
- Completion - Returns successfully after deletion
Common Use Cases
- Cleanup Operations - Remove temporary or obsolete files
- Storage Management - Free up storage space by deleting unused artifacts
- Privacy Compliance - Delete user data when no longer needed
- Workflow Completion - Clean up intermediate files after processing
- Error Recovery - Remove corrupted or invalid artifacts
- Version Management - Delete old versions of artifacts
Error Handling
The node will return errors in the following cases:
- Missing required fields - "Session ID and Filename are required"
- Artifact not found - Attempting to delete a non-existent artifact
- Artifact service error - Storage service is unavailable or has issues
- Permission errors - Insufficient permissions to delete the artifact
- Deletion failure - The artifact service fails to delete the file
Usage Notes
- Permanent Deletion - Deleted artifacts cannot be recovered. Ensure you have the correct filename before deletion.
- All Versions Deleted - Deleting an artifact removes all versions of that file, not just the latest.
- User-Scoped Artifacts - To delete user-scoped artifacts, include the "user:" prefix in the filename.
- Session-Scoped Artifacts - Regular filenames (without "user:" prefix) delete session-specific artifacts.
- Non-Existent Files - Attempting to delete a non-existent artifact will result in an error unless Continue On Error is enabled.
- No Undo - There is no built-in undo mechanism. Consider backing up important artifacts before deletion.
- Cascading Effects - Ensure no other parts of your workflow depend on the artifact before deleting it.
Best Practices
- Verify Before Deletion - Use List Artifacts to confirm the artifact exists before attempting deletion
- Backup Important Files - Use Load Artifact to save a local copy before deletion if you might need it later
- Error Handling - Enable Continue On Error if deletion failures should not stop the workflow
- Logging - Log deletion operations for audit trails
- Conditional Deletion - Use conditional logic to delete artifacts only when appropriate
Example Usage
Deleting a session artifact:
- Session ID:
"session-123" - Artifact Filename:
"temp_report.pdf"
Deleting a user artifact:
- Session ID:
"session-123" - Artifact Filename:
"user:old_profile.jpg"
Cleanup workflow:
- Use List Artifacts to get all artifacts
- Filter for temporary or old files
- Use Delete Artifact in a loop to remove them
Safety Considerations
- Irreversible Operation - Deletions are permanent
- Data Loss Risk - Deleting the wrong artifact can cause data loss
- Session Impact - Deleting artifacts may affect agents or workflows that reference them
- User Data - Exercise caution when deleting user-scoped artifacts as they may be shared across sessions