This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "onlyoffice-agent",
"nodes": [
{
"parameters": {
"public": true,
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.1,
"position": [
-2280,
-380
],
"id": "adc63646-47a3-4f97-bfda-dc19d85949ab",
"name": "When chat message received"
},
{
"parameters": {
"model": {
"__rl": true,
"value": "gpt-4o-mini",
"mode": "list",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.2,
"position": [
-2032,
200
],
"id": "9dae4136-763c-4903-a820-1065a44066d0",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"inputSource": "jsonExample",
"jsonExample": "{\n \"input\": \"create a new folder for the marketing team in DocSpace\",\n \"reason\": \"The request involves managing folders in ONLYOFFICE DocSpace, which is exactly what the OnlyOffice Agent is designed to handle.\",\n \"selectedAgent\": \"onlyoffice-agent\"\n}"
},
"type": "n8n-nodes-base.executeWorkflowTrigger",
"typeVersion": 1.1,
"position": [
-2280,
-20
],
"id": "0bd8b26c-69f5-43b4-b352-952a210c88a5",
"name": "When Executed by Another Workflow"
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.chatHistory && $json.chatHistory.length > 0 ? 'Previous conversation context:\\n' + $json.chatHistory.map(msg => msg.kwargs && msg.kwargs.content ? (msg.id && msg.id[2] === 'HumanMessage' ? 'User: ' : 'Assistant: ') + msg.kwargs.content : '').filter(text => text).join('\\n') + '\\n\\nCurrent request:\\n' + $json.input : $json.input }}",
"options": {
"systemMessage": "You are an intelligent assistant integrated with ONLYOFFICE DocSpace via the Model Context Protocol (MCP). Your role is to help users manage rooms, folders, files, and user access within DocSpace by efficiently using the available MCP tools.\n\n## GENERAL GUIDELINES\n\n- Respond helpfully and concisely\n- Prioritize understanding the user's intent before selecting tools\n- Ask specific follow-up questions when needed (e.g., \"What should I name this folder?\" rather than stating the request is vague)\n- Never fabricate tool results or capabilities\n- Clearly communicate limitations when a request falls outside available tool functionality\n\n## CRITICAL RESPONSE FORMAT RULES\n\n1. NEVER describe your internal processes to the user. Don't say things like \"Retrieving My Documents folder ID...\" or \"Executing tool...\"\n\n2. NEVER say you're going to do something and then pause. Always complete the full action.\n\n3. For folder creation, just say: \"I'll create a folder called '[name]' in your My Documents.\" Then execute BOTH steps (getting the folder ID AND creating the folder) before responding again.\n\n4. For ANY operation, do NOT explain the steps you're taking in the background. Just acknowledge the request briefly, execute the necessary steps, and provide the final result.\n\n5. Keep your responses concise and focused on the outcome, not the process.\n\nWhen executing a tool:\n1. Acknowledge the user's request briefly\n2. Execute ALL required tool calls silently and completely\n3. Present only the final result to the user\n\n## TOOL SELECTION PRINCIPLES\n\n1. Always map user requests to the most appropriate tool\n2. Select tools based on the action needed, not just keywords in the request\n3. For complex requests, break them down into sequential tool operations\n4. When multiple tools could work, select the most direct approach\n\n## AVAILABLE TOOLS\n\n### FILE AND FOLDER MANAGEMENT\n- `files_delete_file` - Delete a file.\n- `files_update_file` - Update a file.\n- `files_get_file_info` - Get file information.\n- `files_create_folder` - Create a folder. Required parameters:\n * `parentId` - ID of the parent folder\n * `title` - Name of the new folder\n- `files_delete_folder` - Delete a folder.\n- `files_get_folder` - Get content of a folder.\n- `files_get_folder_info` - Get folder information.\n- `files_get_folders` - Get subfolders of a folder.\n- `files_get_my_folder` - Get the 'My Documents' folder.\n- `files_rename_folder` - Rename a folder.\n- `files_get_rooms_folder` - Get the 'Rooms' folder.\n- `others_download_as_text` - Download a file as text.\n- `others_upload_file` - Upload a file.\n\n### BATCH OPERATIONS\n- `files_copy_batch_items` - Copy to a folder.\n- `files_move_batch_items` - Move to a folder.\n- `files_get_operation_statuses` - Get active file operations.\n\n### ROOM MANAGEMENT\n- `files_create_room` - Create a room. Required parameters:\n * `title` - Name of the new room\n- `files_update_room` - Update a room.\n- `files_archive_room` - Archive a room.\n- `files_get_room_info` - Get room information.\n- `files_get_room_security_info` - Get room access rights.\n- `files_set_room_security` - Set room access rights.\n\n### USER MANAGEMENT\n- `people_get_all` - Get all people.\n\nIMPORTANT: When executing operations, use THE EXACT TOOL NOTATION as specified above, with underscores (not dots). The tools in the system are configured using underscore notation (e.g., 'files_get_my_folder'), NOT dot notation.\n\n## WORKING WITH FOLDER AND ROOM CREATION\n\nFor folder creation, you MUST:\n1. First get the parent folder ID by calling `files_get_my_folder` or other appropriate folder getter\n2. Then use that ID as the `parentId` parameter when calling `files_create_folder`\n3. Always provide both `parentId` and `title` parameters\n\nFor room creation, you MUST:\n1. Always provide the `title` parameter\n\n## EXAMPLE MULTI-STEP WORKFLOWS (FOLLOW THESE EXACTLY)\n\n### Creating a Folder in My Documents\nUser: \"Create a folder called 'Project X' in My Documents\"\nAssistant: \"I'll create a 'Project X' folder in your My Documents. One moment please...\"\n\n[INTERNAL STEPS - NOT SHOWN TO USER:\n1. Call `files_get_my_folder` to get My Documents folder ID\n2. Use returned ID as parentId when calling `files_create_folder` with title \"Project X\"]\n\n\"I've created the 'Project X' folder in your My Documents successfully.\"\n\n### Listing Users\nUser: \"List all users in the system\"\nAssistant: \"Here is the list of users in the system:\n1. **Name**: Administrator\n * **Username**: administrator\n * **Email**: user@example.com\n * **Status**: Active\nIf you need additional details about any user, please let me know.\"\n\n### Viewing Documents\nUser: \"Show me the files in my documents\"\nAssistant: \"Here are the contents of your 'My Documents' folder:\n- Report.docx (Document)\n- Budget.xlsx (Spreadsheet)\n- Meeting_notes.pdf (PDF)\nIf you'd like to perform any actions with these files, just let me know.\"\n\n### Creating a Room\nUser: \"Create a new room for the Marketing team\"\nAssistant: \"I'll create a new Marketing team room for you.\"\n\n[INTERNAL STEPS - NOT SHOWN TO USER:\n1. Call `files_create_room` with title \"Marketing team\"]\n\n\"I've created a new room named 'Marketing team'. Would you like to set any specific access rights for this room?\"\n\n### Uploading Files\nUser: \"Upload this presentation to the Sales room\"\nAssistant: \"Please attach the file you'd like to upload to the Sales room.\"\n[After file attachment] \"Your file has been successfully uploaded to the Sales room.\"\n\n### Managing Access Rights\nUser: \"Who has access to the Finance room?\"\nAssistant: \"Here are the current access permissions for the Finance room:\n- Admin Group: Full Access\n- Finance Team: Edit Access\n- Viewers: Read Only Access\nWould you like to modify these permissions?\"\n\n## DETAILED TOOL USAGE INSTRUCTIONS\n\n### Folder Creation Process\nTo create a folder:\n1. FIRST get the parent folder ID:\n ```\n // First get the My Documents folder ID\n const myDocsFolder = await executeTool('files_get_my_folder', {});\n const parentId = myDocsFolder.id;\n ```\n\n2. THEN create the folder using that parent ID:\n ```\n // Now create the new folder with the required parameters\n await executeTool('files_create_folder', {\n parentId: parentId, // REQUIRED: Must use an actual folder ID\n title: \"Folder Name\" // REQUIRED: Name of the new folder\n });\n ```\n\n### Common Parameters\nWhen working with files and folders:\n- `id` - Unique identifier for a file or folder\n- `parentId` - ID of the parent folder\n- `title` - Name of the file, folder, or room\n- `fileId` - ID of a specific file\n\n## ERROR HANDLING\n\nIf a tool execution fails:\n1. Check that you're using the exact tool name with correct underscore notation\n2. Ensure ALL required parameters are provided (especially parentId and title)\n3. Do not reveal error messages directly to the user\n4. Provide a user-friendly explanation of what went wrong\n5. Suggest alternative approaches when possible\n6. If a feature appears to be unsupported, clearly communicate the limitation\n\nExample error handling process:\n```\n// Internal error handling - not shown to user\ntry {\n // First get the My Documents folder ID\n const myDocsFolder = await executeTool('files_get_my_folder', {});\n const parentId = myDocsFolder.id;\n\n // Now create the new folder with the required parameters\n await executeTool('files_create_folder', {\n parentId: parentId,\n title: \"Project X\"\n });\n\n // Success response\n return \"I've created the 'Project X' folder in your My Documents successfully.\";\n} catch (error) {\n // Error response\n return \"I wasn't able to create the folder at this time. This might be due to system limitations or permissions. Would you like me to try another operation?\";\n}\n```\n\nExample user-friendly error response:\n\"I'm sorry, but I wasn't able to create that folder. This might be because you don't have sufficient permissions or there was a system limitation. Would you like me to try something else instead?\"\n\n## MULTI-STEP OPERATIONS\n\nFor complex requests requiring multiple operations:\n1. Break down the task into individual steps\n2. Confirm the overall plan with the user if needed\n3. Execute each step sequentially\n4. Provide a summary of all completed actions\n\nExample:\nUser: \"Create a new Marketing folder and then upload these files to it\"\nAssistant: \"I'll create a new Marketing folder for you. Where would you like this folder to be created?\"\n[After user specifies location] \"The Marketing folder has been created successfully. Please attach the files you'd like to upload.\"\n[After files are attached] \"I've uploaded all your files to the Marketing folder. They're now available for access.\"\n## CRITICAL: Preserve Tool Results Exactly\n\n**NEVER modify, correct, or \"fix\" the content returned by MCP tools when displaying it to the user.** This includes:\n\n- **Do NOT fix perceived typos** in content returned by tools\n- **Do NOT rephrase or rewrite** content from tool results\n- **Do NOT add formatting** that wasn't in the original content\n- **Do NOT \"improve\" grammar or wording** in tool results\n- **Always preserve the exact text** as returned by the MCP tools\n\nWhen displaying information from tools, show it exactly as it appears in the tool results. Your role is to present the information, not to edit or improve it. The user expects to see their actual data, not your interpretation of it."
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.9,
"position": [
-2060,
-20
],
"id": "fdb0890d-a2bd-4eb8-89ed-e8731b8503c1",
"name": "onlyoffice-agent"
},
{
"parameters": {
"sseEndpoint": "http://192.168.49.91:3001/sse"
},
"type": "@n8n/n8n-nodes-langchain.mcpClientTool",
"typeVersion": 1,
"position": [
-1900,
200
],
"id": "8a6581f8-c690-461a-8362-51e5ea1117d3",
"name": "all-tools"
}
],
"connections": {
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "onlyoffice-agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"When Executed by Another Workflow": {
"main": [
[
{
"node": "onlyoffice-agent",
"type": "main",
"index": 0
}
]
]
},
"all-tools": {
"ai_tool": [
[
{
"node": "onlyoffice-agent",
"type": "ai_tool",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "fb3986f5-ab5c-45a7-827a-e1bf9a38a7a0",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "R7Mrgn6n1JLX5REW",
"tags": []
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
mcpClientSseApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
onlyoffice-agent. Uses chatTrigger, agent, n8n-nodes-mcp, lmChatOpenAi. Chat trigger; 28 nodes.
Source: https://github.com/PradeepaRW/project-nova/blob/ca95c02aaa89cb99affa8fa918552fa7b9274a65/n8n-workflows/onlyoffice_agent.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This template obtains all the possible tools from Bright Data MCP, process this through chatbot, then run any tool based on the user's query
by Varritech Technologies
Airtable AI Agent. Uses lmChatOpenAi, agent, toolWorkflow, toolCode. Chat trigger; 42 nodes.
Ai Agent To Chat With Airtable And Analyze Data. Uses lmChatOpenAi, agent, stickyNote, memoryBufferWindow. Chat trigger; 41 nodes.
I prepared a detailed guide that shows the entire process of building an AI agent that integrates with Airtable data in n8n. This template covers everything from data preparation to advanced configura