The value in text not set for file convert

Describe the problem/error/question

I am trying convert the output of the ai agent into a file. yet it says its not set

What is the error message (if any)?

{
“errorMessage”: “The value in "Hello again! How can I help you?" is not set”,
“errorDetails”: {},
“n8nDetails”: {
“nodeName”: “Convert to File”,
“nodeType”: “n8n-nodes-base.convertToFile”,
“nodeVersion”: 1.1,
“operation”: “toText”,
“itemIndex”: 0,
“time”: “5/12/2025, 12:22:58 PM”,
“n8nVersion”: “1.91.2 (Cloud)”,
“binaryDataMode”: “filesystem”,
“stackTrace”: [
“NodeOperationError: The value in "Hello again! How can I help you?" is not set”,
" at ExecuteContext.createBinaryFromJson (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/utils/binary.js:83:11)“,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Files/ConvertToFile/actions/toText.operation.js:110:67)”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Files/ConvertToFile/ConvertToFile.node.js:146:41)“,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:687:50)”,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:921:62",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1257:20"
]
}
}

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

{
“nodes”: [
{
“parameters”: {
“fileName”: “=test.docx”,
“parentId”: “01C7YEKCGDVOO5ESQ2XFB3JKNDZRMNGYSJ”,
“binaryData”: true,
“binaryPropertyName”: “={{ $json.binary }}”
},
“type”: “n8n-nodes-base.microsoftOneDrive”,
“typeVersion”: 1,
“position”: [
1520,
220
],
“id”: “a7557635-e1c5-4af8-8937-04db0f70499b”,
“name”: “Microsoft OneDrive2”,
“credentials”: {
“microsoftOneDriveOAuth2Api”: {
“id”: “YKrv9ZdRbB2Ep1Us”,
“name”: “Microsoft Drive account”
}
}
},
{
“parameters”: {
“options”: {
“systemMessage”: “Based on the chat input please output a file name according to the text. always have the extension as pdf”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.9,
“position”: [
900,
220
],
“id”: “3f840869-034e-4440-9e7b-4cce2045e131”,
“name”: “AI Agent1”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“mode”: “list”,
“value”: “gpt-4o-mini”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
780,
400
],
“id”: “eff6a60e-cd79-458c-9a0d-ff4c8cff5150”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “JOpHgYldTT1RHOaE”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“sessionIdType”: “customKey”,
“sessionKey”: “35”
},
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“typeVersion”: 1.3,
“position”: [
980,
440
],
“id”: “cc433695-c6d0-4a31-92b1-8da4fa516b76”,
“name”: “Simple Memory”
},
{
“parameters”: {
“operation”: “toText”,
“sourceProperty”: “={{ $json.output }}”,
“binaryPropertyName”: "=data ",
“options”: {}
},
“type”: “n8n-nodes-base.convertToFile”,
“typeVersion”: 1.1,
“position”: [
1280,
220
],
“id”: “ff7f6835-c0fe-4bae-9be5-8c9b30ec6481”,
“name”: “Convert to File”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.1,
“position”: [
700,
220
],
“id”: “414b4054-bc2b-4ab1-b6fd-3e9cf1868663”,
“name”: “When chat message received”,
“webhookId”: “6cfa2d3b-a3b0-4493-a5e0-502c520d9e0a”
}
],
“connections”: {
“AI Agent1”: {
“main”: [
[
{
“node”: “Convert to File”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent1”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Simple Memory”: {
“ai_memory”: [
[
{
“node”: “AI Agent1”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“Convert to File”: {
“main”: [
[
{
“node”: “Microsoft OneDrive2”,
“type”: “main”,
“index”: 0
}
]
]
},
“When chat message received”: {
“main”: [
[
{
“node”: “AI Agent1”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “274690a662ddcf878f1a5082b9b826fa420de465650222dc51b254869704139c”
}
}

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:**1.91.2
  • Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: macOS

Text Input Field is the name of the parameter.
This is used sometimes for values that probably have a greater size.

In your case: replace {{ $json.output }} with output

3 Likes

I think you’re supposed to only provide the field’s actual name and not the value or content of the field. Set the property to “Fixed” and the name of the variable, which is “output”

1 Like

Yes, did this work?

Thank you so much for your help. Do you think you can help me with one more part of this problem? after I convert it to binary data file its not allowing me to upload it to OneDrive

Thanks for your help!

Can you share your workflow in a code block? From the screenshot it should work. I did however notice that you’re trying to upload a text file as a docx. Ideally you want to pull the filename out of the binary properties and use that instead for consistency.

1 Like

I Solved it thanks for your help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.