Files
mem0/integrations/zapier-mem0/creates/delete_memory.js
T
Himanshu-Sangshetti cf861ebf5a fix(integrations): address review feedback on Zapier and n8n
Zapier:
- Bound the poll budget under Zapier's step timeout and default Wait for
  Completion off; timeout message notes the add likely still succeeded
- Add offline unit tests (mocked z.request) and run them in CI
- Expose a Page input on Get Memories
- Encode memory_id in the delete path
- Update E2E to test the default no-wait path (add then search-retry)

n8n:
- Clarify the Infer description (controls extraction, not waiting)
- Add an App ID field and require at least one entity id before add
- Pass itemIndex into pollEvent errors
- Unwrap event results so wait-path output matches search and get many
2026-07-20 11:55:29 +05:30

27 lines
724 B
JavaScript

'use strict';
const perform = async (z, bundle) => {
// Trailing slash required (Django APPEND_SLASH); id encoded so a stray slash can't mistarget the path.
const response = await z.request({
url: `/v1/memories/${encodeURIComponent(bundle.inputData.memory_id)}/`,
method: 'DELETE',
});
return response.data || { message: 'Deleted', memory_id: bundle.inputData.memory_id };
};
module.exports = {
key: 'delete_memory',
noun: 'Memory',
display: {
label: 'Delete Memory',
description: 'Delete a single memory by its ID.',
},
operation: {
perform,
inputFields: [
{ key: 'memory_id', label: 'Memory ID', type: 'string', required: true },
],
sample: { message: 'Memory deleted successfully' },
},
};