Workflow steps

memory

type: "memory"

Reads, writes or deletes one of the account's long-term notes — so a chain can remember something between runs.

free3 actionsread by default
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

actionstringread

read · write · delete.

namestring

Required for write and delete.

contentstring

Required for write.

descriptionstring

One line, shown in the index.

// Remember where the last run got to
{ id: "mark", type: "memory", config: {
    action: "write", name: "last-digest",
    description: "The date of the last digest sent",
    content: "{{input.week}}" } }

// Read it at the start of the next run
{ id: "since", type: "memory", config: { action: "read", name: "last-digest" } }
# Remember where the last run got to
{"id": "mark", "type": "memory", "config": {
    "action": "write", "name": "last-digest",
    "description": "The date of the last digest sent",
    "content": "{{input.week}}"}}

# Read it at the start of the next run
{"id": "since", "type": "memory", "config": {"action": "read", "name": "last-digest"}}

Output

actionoutput
read with a namethe note
read without onememories — the index
writethe note, and whether it was created
deletethe name, and whether it was deleted

This is how a chain keeps state

A run starts with nothing

Each one is independent. A scheduled chain that must not repeat itself — a digest since the last digest — writes a note at the end and reads it at the start. There is no other state between runs.

The notes are the account's

The same ones an agent reads and writes, and the same ones api.memory manages. A workflow writing one changes what every agent of that account knows — which is useful, and worth being deliberate about.