AWS1 input → 2 outputs
DynamoDB Delete
Permanently removes an item by primary key. Used for session revocation, token expiry cleanup, and workflow termination.
Inputs
Outputs
Output 1 — Success Output 2 — ErrorHow to Use
- Select an AWS config node and enter the Table Name.
- Set the Partition Key name and value — and the Sort Key if your table requires one.
- Enable Return deleted item if you need to capture the data before it is removed (e.g. for an audit log).
- Wire Output 2 to an error handler — delete failures (wrong table, auth errors) go there.
Idempotency
Deleting an item that does not exist is not an error — DynamoDB returns success silently,
and msg.payload.deletedItem will be null. This makes it safe to delete
without first checking if the item exists.
Examples
Remove a revoked session when a patient logs out, and capture the deleted record for audit:
// Config: Partition Key Name = id, Sort Key Name = sk
// Return deleted item: ✓ checked
// Runtime override:
msg.payload = {
key: { id: "workflow-123", sk: "session" }
};
// Output 1:
msg.payload = {
success: true,
deletedItem: {
id: "workflow-123",
sk: "session",
patientId: "P001",
startedAt: 1714000000
}
}
Best Practices
- Enable Return deleted item for audit-sensitive operations — once deleted, the data is gone.
- Use conditionExpression with
attribute_exists(id)if you want to distinguish "item existed and was deleted" from "item did not exist". - For bulk deletion, use DynamoDB Batch (BatchWrite with deletes array) — it is faster and uses fewer API calls.
- Wire Output 2 even if you do not expect errors — accidental deletes of wrong items (misconfigured key) will surface there.