Simple file based key value store (WriteKey)
Needs changesWhat this workflow does
This workflow has 10 nodes and runs manually, when you click “Execute workflow”. It uses only n8n's built-in nodes.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- SplitInBatches (Loop Over Items (Split in Batches)): loops over the items in batches
- Config (Function Item): runs custom JavaScript per item (legacy Function Item node)
- Read Binary Files: uses Read Binary Files
- BinaryToJSON (Convert to/from binary data): uses Convert to/from binary data
- SetKeyValue (Function Item): runs custom JavaScript per item (legacy Function Item node)
- JSONToBinary (Convert to/from binary data): uses Convert to/from binary data
- Write Binary File: uses Write Binary File
- Repeat (If): checks a condition and branches into true / false
- Done (Function Item): runs custom JavaScript per item (legacy Function Item node)
Before you upgrade to n8n 3.0
4 things in this workflow are removed in n8n 3.0. Fix them before you upgrade:
- Write Binary File: replace with Read/Write Files from Disk.
- Function Item (legacy) in Config, SetKeyValue, Done: replace with Code node, mode 'Run Once for Each Item'.
- Read Binary Files: replace with Read/Write Files from Disk.
- Convert to/from binary data in BinaryToJSON, JSONToBinary: replace with Convert to File or Extract from File.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| Write Binary File Write Binary File | Read/Write Files from Disk |
| Function Item (legacy) Config, SetKeyValue, Done | Code node, mode 'Run Once for Each Item' |
| Read Binary Files Read Binary Files | Read/Write Files from Disk |
| Convert to/from binary data BinaryToJSON, JSONToBinary | Convert to File or Extract from File |
Nodes used (7)
- Manual Trigger
n8n-nodes-base.manualTrigger - Write Binary File
n8n-nodes-base.writeBinaryFile - Function Item
n8n-nodes-base.functionItem - Read Binary Files
n8n-nodes-base.readBinaryFiles - Convert to/from binary data
n8n-nodes-base.moveBinaryData - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - If
n8n-nodes-base.if
From the author
Store a key with a value in a local json file. Multiple keys could be saved in a single file. Related workflow: GetKey Create a subfolder in your n8n homedir: /home/node/.n8n/local-files. In docker look at the data path and create a subfolder local-files. Set…