Delete Data
What does it do?
Removes a single document from the customer-scoped data store by collection + key. If the row doesn't exist or is already expired, the node routes to on_failure.
1. Syntax
<node_name>:
type: func
func_type: dataStorage
func_id: delete
params:
collection: "<collection_name>"
key: "<record_key>"
on_complete: <next_node>
on_failure: <fallback_node>
required params
typetype of the nodefunc_typehere it will bedataStoragefunc_idwhat function are we calling (delete)params.collectioncollection name. Must match^[a-zA-Z0-9_-]+$(letters, digits,_,-), max 100 charsparams.keyrecord key within the collection (non-empty, max 200 chars)on_completenext node after the delete succeeds
optional params
on_failurefallback node — used when the row doesn't exist or is already expireddepartmentassigns the chat to a departmentagentassigns the chat to a specific agent (email address or CRM ID as defined in the Texter agents manager)
2. Output
On success, stored at %state:node.<node_name>%:
{ "deleted": true }
3. Examples
Clear SLA row when chat resolves
clear_sla_record:
type: func
func_type: dataStorage
func_id: delete
params:
collection: "sla_chats"
key: "%chat:channelInfo.id%"
on_complete: resolved_message
on_failure: resolved_message
Delete using a key from user input
remove_draft:
type: func
func_type: dataStorage
func_id: delete
params:
collection: "draft_orders"
key: "%state:node.ask_draft_id.text%"
on_complete: confirm_cancelled
on_failure: draft_not_found
tip
Always set on_failure — delete raises an error when the row is missing or expired. If you don't care about that case (e.g. you just want to make sure it's gone), point on_failure at the same node as on_complete.