Memory has a subject, a namespace, and an expiry
Every memory fact lives under a key, a subject and a namespace, and it always expires: 90 days by default, one year at most. Here is how writes, reads and sharing work.
- Memory

A memory node looks simple: write a fact now, read it on a later run. The details are what decide whether a fact lands in the right place, stays isolated or shared on purpose, and goes away when it should. This post lays out those details as the host enforces them.
Four things name a fact
A memory fact is addressed by four things. Get them right and reads and writes find each other.
| Part | What it is | Rule |
|---|---|---|
| Key | The name of the fact, such as `plan` | Required. A node without a key fails. |
| Subject | Who the fact is about | The verified end user of the run, or an id read from the node's input with `subjectPath` |
| Namespace | The group the fact belongs to | Defaults to the workflow, so facts are isolated per workflow |
| Environment | Where the run happens | Required. Memory is scoped to the environment as well as the workspace |
The subject deserves a closer look. When a verified end user started the run, memory is keyed by that user's record and subjectPath is not needed. For runs your own system starts, subjectPath names where in the node's input to find an id. The value there can be a string, a number, or a boolean. If nothing is found at that path, the node fails with a message naming the path.
Writing a fact
A write node saves a value under the key, for the subject, in the namespace:
JSON
{
"id": "remember-plan",
"type": "memory",
"config": {
"operation": "write",
"subjectPath": "customer.id",
"namespace": "billing",
"key": "plan",
"valuePath": "customer.plan",
"ttlSeconds": 2592000
}
}valuePath picks which part of the input to store. Leave it out and the whole input is stored. If you name a path and nothing is there, the node fails instead of quietly storing nothing.
On success the node returns the key and the time the fact will expire, so a later step can show or log it.
Reading a fact
A read node takes the same subject, namespace and key, and returns two things: whether a fact was found, and the value.
JSON
{
"operation": "read",
"subjectPath": "customer.id",
"namespace": "billing",
"key": "plan"
}A missing fact is not an error. The node returns found: false with a null value, and the graph decides what to do next. That makes the common pattern easy: read the fact, branch on found, and fall back to asking the customer.
Sharing or isolating
The namespace is the switch. Leave it empty and it resolves to the workflow's own id, so a fact written by one workflow is invisible to every other. Set the same namespace on several workflows and they share the fact. Two workflows that both use billing read and write the same plan.
Nothing crosses subjects, though. A fact about one customer is never returned for another, because the subject is part of the address.
Every fact expires
Expiry is not optional in the way it first looks. If you leave ttlSeconds out, the fact still expires: the default is 90 days. If you set it, the value must be between one second and one year. Anything outside that range fails the node with a message that states the allowed range.
So the real choice is not whether a fact expires but when. Set a short life for a fact that goes stale, such as a pending order, and a long one for something durable. The year cap means no fact is kept forever by accident.
Replay does not change what later runs recall
One rule protects your history. When a run is a replay or a regression run, memory writes do not happen. The node fails with a non-retryable error that explains why: a write would change what later runs recall.
That is the right trade. A replay exists to test a step against the original input. If it could also rewrite memory, testing a fix would quietly alter the facts the next real run reads. Reads still work in a replay, so the step sees the same facts it saw the first time.
A short checklist
- Name the key, the subject and the namespace on every memory node.
- Leave the namespace empty to keep a fact inside one workflow, and set it to share.
- Pick
ttlSecondson purpose. The default is 90 days, and the ceiling is one year. - Branch on
foundafter a read, and do not assume the fact is there.

