Delete Data

Overview

The Delete Data stage removes data that was previously stored using the Save Data stage. You can delete a specific record, an individual key within a record, or all records in a group.

Use this stage to clean up temporary data, remove outdated information, or delete sensitive data after it is no longer needed.

* Example flow demonstrating how Delete Data removes a stored key and how Fetch Data returns the configured default value when the key is no longer available.

Note: The variable names, values, criteria, and configuration used in this example are for demonstration purposes only.

Configuration

Fields Reference

FieldRequiredDescriptionExample
Group nameYesThe group containing the data to delete. The value must match the group name used when the data was saved.UserSessions 
TempCache
Record nameNoThe specific record to delete. Leave this field empty only when you intend to delete all records in the group.{{sessionId}}
KeyNoThe individual key to remove from the selected record. Use this field when you want to delete one value without removing the entire record.emailAddress

Deletion Scope

Fields ProvidedWhat Gets DeletedExample
Group name onlyAll records in the groupDelete all test records from TestData
Group name + Record nameOne specific record in the groupDelete the record identified by {{sessionId}}
Group name + Record name + KeyOne key from one specific recordDelete emailAddress from a selected customer record
Group name + KeyThe matching key from all records in the groupDelete phoneNumber from every record in the group

Important: Leaving Record name empty can delete all records in the selected group. Confirm the intended deletion scope before enabling the flow.

Exit Points

ExitWhen It Is Used
PassThe deletion completes successfully. The stage may also continue through Pass when no matching data is found.
ErrorThe deletion cannot be completed because of a data-store or connection error.

How It Works

When the stage executes, it:

  1. Reads the configured values for Group name, Record name, and Key.
  2. Determines the deletion scope from the fields that were provided.
  3. Deletes the matching data from storage.
  4. Continues through Pass or Error depending on the result.

Key behavior: Delete Data permanently removes the selected data. The stage does not provide an undo option.

Example: Delete a Temporary Record

This example removes a temporary record after the flow no longer needs it.

StepStageResult
1Save DataStores a temporary record using {{processId}}
2Delete DataRemoves the same record after processing is complete
3Fetch DataNo matching record is returned

Delete Data configuration:

  • Group name: TempProcessing
  • Record name: {{processId}}
  • Key: Leave empty

Common Use Cases

1. Clean Up Temporary Data

Remove temporary processing data after the flow has completed all stages that depend on it.

  • Group name: TempProcessing
  • Record name: {{processId}}

2. Delete a User Session

Remove a stored session after logout or session expiry.

  • Group name: UserSessions
  • Record name: {{sessionId}}

3. Clear Test Data

Remove all records from a test group.

  • Group name: TestData
  • Record name: Leave empty
  • Key: Leave empty

Warning: This configuration deletes every record in the group.

4. Remove One Key from a Record

Delete one stored value without removing the complete record.

  • Group name: CustomerData
  • Record name: {{customerId}}
  • Key: temporaryToken

Key Behaviors

FeatureBehavior
Permanent DeletionDeleted data cannot be restored by the stage.
Safe to RepeatDeleting data that no longer exists does not normally create a deletion error.
Exact Name MatchingGroup, record, and key values must match the stored data names exactly.
No Confirmation PromptThe stage performs the deletion immediately when it executes.
No Output VariableThe stage does not create a variable containing a deletion count or deleted record.

Best Practices

  • ✓ Use a specific Record name whenever possible.
  • ✓ Leave Record name empty only when deleting the entire group is intentional.
  • ✓ Delete data only after every stage that depends on it has completed.
  • ✓ Use Route Flow before Delete Data when deletion depends on a condition.
  • ✓ Test deletion logic with temporary groups before using it with production data.
  • ✓ Document flows that delete data from shared groups.
  • ✓ Connect the Error exit to logging, alerting, or other failure handling.
  • ✓ Use Fetch Data after deletion during testing when you need to verify the result.

Common Mistakes

MistakeSymptomFix
Leaving Record name empty unintentionallyAll records in the selected group are deleted.Provide the specific Record name when deleting one record.
Using a different group, record, or key nameThe stage completes, but the expected data remains.Match the names used by Save Data exactly.
Deleting data too earlyLater stages cannot retrieve or use the data.Move Delete Data after every stage that depends on the stored information.
Expecting a deleted-record countNo result variable shows what was removed.Use Fetch Data during testing to verify that the record or key is no longer available.
Not handling the Error exitA storage or connection problem is not handled by the flow.Connect Error to a Log, Slack alert, or another appropriate error route.

Troubleshooting

IssueCommon CauseFix
Expected data was not deletedThe group, record, or key value does not match the stored data.Compare the Delete Data configuration with the values used in Save Data.
Error exit is triggeredThe data store is unavailable or incorrectly configured.Check the data-store configuration and investigate the connection failure.
More data was deleted than expectedRecord name was left empty.Specify the exact record before running the flow again.
Later stages return no dataDelete Data executed before those stages completed.Move the deletion stage to the end of the relevant processing path.

Advanced: Clear Distributed Cache

If the stored data is also cached, the group name can be prefixed with clearcache:: to request cache clearing across the available engine servers.

Example:

clearcache::UserData

This can remove the stored value and request that cached copies are cleared. Use this option only when the relevant data is known to use distributed caching.

Related Stages

  • Save Data: Store data that can later be removed with Delete Data.
  • Fetch Data: Retrieve stored data or verify during testing that deletion succeeded.
  • Query Data: Find stored records before deciding what should be deleted.
  • Route Flow: Check conditions before allowing a deletion.
  • Run Later: Schedule cleanup logic for a later time.