Accessing variables
Inside the Code node you can read and write flow variables using predefined global objects.Context ($context)
Variables that persist only during the current flow execution:Memory ($memory)
Variables that persist across workflows, tools, and nodes. They support time-to-live (TTL):Reading
Deletion
Limits by data type
| Type | Maximum size | TTL | Maximum TTL |
|---|---|---|---|
| String | 255 characters | Optional | — |
| Number | 15 digits | Optional | — |
| Boolean | — | Optional | — |
| JSON | 15 KB | Required | 86,400s (1 day) |
| File | 10 MB | Required | 604,800s (1 week) |
Migration from legacy nodes
- Create a new Code (Memory V2) node.
- Copy and paste the script from the legacy node.
- Use the new available methods (
$memory.setJson,$memory.setFile, etc.) if needed.