Skip to main content

Delete Session

Deletes a session and all its associated data from the session service.

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) A unique identifier for the specific conversation thread to delete.

Outputs

This node does not have outputs.

How It Works

The Delete Session node removes a session and its data:

  1. Input Validation - Verifies that Session ID is provided
  2. Service Connection - Connects to the session service
  3. Session Deletion - Removes the session and all associated data
  4. Completion - Returns successfully after deletion

Common Use Cases

  • Privacy Compliance - Delete user conversations when requested or required by regulations
  • Storage Management - Remove old or obsolete sessions to free up storage
  • User Logout - Clean up session data when a user signs out
  • Data Retention - Implement retention policies by deleting expired sessions
  • Error Recovery - Remove corrupted or invalid sessions
  • Test Cleanup - Delete test sessions after development or QA

Error Handling

The node will return errors in the following cases:

  • Missing required field - "Session ID is required"
  • Session not found - The specified session does not exist
  • Deletion failure - "Failed to delete session" with details
  • Service unavailable - Cannot connect to the session service
  • Permission errors - Insufficient permissions to delete the session

Usage Notes

  • Permanent Deletion - Deleted sessions cannot be recovered. Ensure you have the correct Session ID.
  • Complete Removal - Deletes all session data including:
    • Conversation history
    • Session state
    • Agent interactions
    • Events and metadata
  • Artifacts Not Deleted - Session deletion does not automatically delete associated artifacts. Use Delete Artifact separately if needed.
  • No Confirmation - The node deletes immediately without confirmation prompts.
  • Service Independent - Works with any session service (Memory, Database, or Robomotion).
  • Error Handling - Enable Continue On Error if deletion failures should not stop the workflow.

Best Practices

  • Verify Session ID - Double-check the Session ID before deletion to avoid deleting the wrong session
  • Backup Important Data - Use Load Session or Get State to backup session data before deletion
  • Delete Artifacts - Consider deleting associated artifacts to fully clean up
  • Logging - Log deletion operations for audit trails and compliance
  • Conditional Deletion - Use conditional logic to delete sessions only when appropriate
  • Error Recovery - Enable Continue On Error if the session might already be deleted

Example Usage

Deleting a completed session:

  • Session ID: "session-abc123"

Cleanup workflow:

  1. Use Get State to backup important data
  2. Use List Artifacts to identify session artifacts
  3. Use Delete Artifact to remove each artifact
  4. Use Delete Session to remove the session

Scheduled cleanup:

  1. Query for sessions older than retention period
  2. For each old session:
    • Delete associated artifacts
    • Delete the session

Privacy and Compliance

  • GDPR Right to Erasure - Use this node to implement user data deletion requests
  • Data Retention Policies - Automate session cleanup based on retention rules
  • Audit Logging - Maintain logs of session deletions for compliance
  • User Requests - Provide users with ability to delete their conversation history

Safety Considerations

  • Irreversible Operation - Deletions are permanent and cannot be undone
  • Data Loss Risk - Deleting the wrong session can cause data loss
  • User Impact - Users will lose conversation history and context
  • Artifact Orphaning - Artifacts may remain if not explicitly deleted
  • Session ID Verification - Always verify Session ID before deletion

Error Recovery

If deletion fails:

  • Session Not Found - The session may already be deleted; enable Continue On Error
  • Permission Denied - Verify service credentials and permissions
  • Service Unavailable - Check service connectivity and retry
  • Partial Deletion - Session data may be partially deleted; manual cleanup may be needed