How to sort a file list from a read binary files node
What is the error message (if any)?
When using the sort node with code some times I get the error “ERROR: Sort code doesn’t return. Please add a ‘return’ statement to your code”.
I say some times because I’m pretty sure it works some times.
The default code in the sort Node does not work with read binary files output so I changed it.
Also I can’t find the correct syntax to use the “normal” sort operation. Can’t input the correct fieldname.
Please share your workflow
Share the output returned by the last node
ERROR: Sort code doesn't return. Please add a 'return' statement to your code
NodeOperationError: Sort code doesn't return. Please add a 'return' statement to your code
at Object.sortByCode (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Transform/Sort/utils.js:17:15)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Transform/Sort/Sort.node.js:251:45)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:698:42)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:68
at processTicksAndRejections (node:internal/process/task_queues:95:5)
Information on your n8n setup
- n8n version: 1.24.1
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker
- Operating system: ubuntu 22.04