AI Agent - Aug 8, 2026

n8n AgentCore Memory: Actor and Session ID Guide

Quick answer

In an n8n AgentCore workflow, use actorId as the stable boundary for a user or tenant and runtimeSessionId as the boundary for one conversation. A returning actor may have many sessions. Reuse a session ID only when the next workflow execution should continue that same conversation; use a new ID when the task should start cleanly.

Managed AgentCore Memory is enabled by default. It can retain short-term conversation events and configured long-term strategies, but identity mapping, retention, retrieval, and context truncation still need explicit application decisions.

The actor/session hierarchy

Think of memory as a two-level key:

actor: customer-482
  session: support-2026-08-08-a
  session: renewal-2026-08-08-b
actor: customer-917
  session: support-2026-08-08-a

Even if two actors happen to use the same session string, the actor boundary keeps their memory separate. Do not depend on that fact as a reason to generate weak IDs; use high-entropy session IDs and test cross-user isolation.

Map actorId from a stable, authenticated identifier. Avoid email addresses, display names, mutable profile fields, or raw secrets. If the workflow is multi-tenant, decide whether the actor represents an individual user, an account, or a composite tenant-user identity and keep that choice consistent.

New session or continued conversation?

Workflow eventSession choice
User opens a new chatGenerate a new session ID
Same user sends the next message in the chatReuse that chat’s session ID
Scheduled job starts an independent taskGenerate a new session ID
n8n retries the same failed invocationReuse only with idempotency and side-effect review
Human reopens a historical caseReuse only if prior context is desired and permitted

AWS’s n8n walkthrough says a blank Session ID creates a new session. That is useful for stateless tasks but unsuitable when a later workflow execution must continue a conversation. Persist the mapping in a durable store that n8n can read; do not assume an execution-local variable will exist on the next trigger.

Managed memory, BYO memory, or disabled

Choose among three modes:

  • Managed memory: the default, with a harness-managed AgentCore Memory resource.
  • Bring your own: attach an existing AgentCore Memory instance when you need custom namespace templates, KMS configuration, or sharing across harnesses.
  • Disabled: turn memory off for tasks that should not retain conversational state.

AgentCore documents long-term strategies including semantic facts, summaries, user preferences, and episodic events. Enable only strategies that have a defined product purpose and retention policy. A preference remembered for convenience may be inappropriate for a regulated or high-risk workflow.

Retrieval and truncation are separate

When long-term strategies are active, Harness can retrieve relevant memory before reasoning. AWS documents default retrieval parameters for managed and BYO memory unless a BYO retrieval configuration overrides them.

This does not eliminate context limits. For growing conversation history, Harness supports:

  • sliding_window, the default, which retains the most recent messages;
  • summarization, which compresses older content;
  • none, only when the application manages context size itself.

Test the actual failure mode. Sliding windows may forget an early constraint; summaries may omit exact wording; no truncation can exceed the model window.

n8n implementation checklist

  1. Derive actor ID only after authentication or trusted workflow input validation.
  2. Store the actor-to-session mapping outside one n8n execution.
  3. Decide whether retries may repeat tool side effects.
  4. Pass the same actor and session to every turn in one conversation.
  5. Test two actors with the same session string and one actor with two sessions.
  6. Document memory retention, deletion, and subject-access procedures.
  7. Bound context with a tested truncation strategy and token limit.
  8. Inspect traces for retrieval behavior without exposing sensitive payloads broadly.

Use the n8n AgentCore harness planner to capture the selected identity and memory pattern.

Frequently asked questions

What is the difference between actor ID and session ID?

Actor ID scopes memory to a user or tenant. Session ID identifies a conversation within that actor. Use both deliberately so users and conversations remain isolated.

What happens when the n8n Session ID is blank?

The AWS n8n guide says leaving Session ID blank starts a new session. Persist a generated ID only when later workflow executions should continue the same conversation.

Is memory enabled by default?

AgentCore Harness provides managed memory by default. You can attach an existing AgentCore Memory instance for advanced configuration or disable memory entirely.

Does long-term memory remove context-window limits?

No. Retrieval can inject relevant stored memories, while conversation history still needs a truncation strategy such as sliding window or summarization.

Continue by decision

Official sources

Source check: August 8, 2026. Verify current memory APIs, defaults, strategies, encryption, quotas, and retention controls before production use.