Describe the problem/error/question
I am using a simple workflow with an AI Agent that uses Simple Memory for the AI agent to use at its own discretion etc, however the issue is the workflow seems to error after 2-3 items of using the simple memory with the error code below about a bad request, I cannot seem to understand because at no point is the LLM being submitted with any empty context, Even if I define the key for the simple memory as a number the error still occurs after the memory node is called 3+ times. I have tried simple memory, redis, Postgres, I have used a set / edit item before and set a number or used the execution ID to do so with no luck still. I saw some other posts that state about copying to a new workflow which I have done with no luck.
What is the error message (if any)?
Problem in node ‘AI Agent‘
Bad request - please check your parameters
Error Cause:
{ “status”: 400, “headers”: { “access-control-expose-headers”: “X-Request-ID”, “alt-svc”: “h3=":443"; ma=86400”, “cf-cache-status”: “DYNAMIC”, “cf-ray”: “redacted-LHR”, “connection”: “keep-alive”, “content-length”: “187”, “content-type”: “application/json”, “date”: “Wed, 25 Jun 2025 17:15:50 GMT”, “openai-organization”: “user-redacted”, “openai-processing-ms”: “18”, “openai-version”: “2020-10-01”, “server”: “cloudflare”, “set-cookie”: “__cf_bm=redacted-1750871750-1.0.1.1-redacted.3oNX8.redacted; path=/; expires=Wed, 25-Jun-25 17:45:50 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None, _cfuvid=redacted-redacted-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None”, “strict-transport-security”: “max-age=31536000; includeSubDomains; preload”, “x-content-type-options”: “nosniff”, “x-envoy-upstream-service-time”: “20”, “x-ratelimit-limit-requests”: “500”, “x-ratelimit-limit-tokens”: “30000”, “x-ratelimit-remaining-requests”: “499”, “x-ratelimit-remaining-tokens”: “28365”, “x-ratelimit-reset-requests”: “120ms”, “x-ratelimit-reset-tokens”: “3.268s”, “x-request-id”: “redacted” }, “request_id”: “redacted”, “error”: { “message”: “Invalid value for ‘content’: expected a string, got null.”, “type”: “invalid_request_error”, “param”: “messages.[1].content”, “code”: null }, “code”: null, “param”: “messages.[1].content”, “type”: “invalid_request_error”, “attemptNumber”: 1, “retriesLeft”: 3 }
Please share your workflow
Share the output returned by the last node
Information on your n8n setup
- n8n version: 1.99.1
- **Database (default: SQLite): POSTGre Supabase Database
- n8n EXECUTIONS_PROCESS setting (default: own, main): Default
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Debian LXC