Describe the problem/error/question
I am trying to restore backup workflows as I moved cloud solutions. So, my use case is - a) Access Github and get a list of the workflows stored as backup.
b) Use n8n node to create these workflows on the n8n instance hosted on coolify hosted on hostinger.
I tried following options-
a) Github → convert the file to json → n8n node(create workflow action)
b) Github → convert the file to json → code node(to try to reformat string/json) → n8n node(create workflow action)
c) I’ve also tried API testing via n8n docs and i am able to create the dummy workflow via the api successfully. This isolates the issue as not being connectivity but the json parsing.
keep hitting the error - The ‘workflowObject’ property must be valid JSON, but cannot be parsed
I came across issue #16377 (issues on n8n github) which is marked as closed but I dont see feedback, so I tried the listed minimal workflow and i hit the error listed in the mentioned issue with the minimal listed workflow as well.
minimal workflow -
{
“name”: “Minimal Diagnostic Test Workflow”,
“nodes”: [
{
“parameters”: {},
“name”: “Start”,
“type”: “n8n-nodes-base.start”,
“typeVersion”: 1,
“position”: [ 250, 250 ],
“id”: “a1b2c3d4-e5f6-7g8h-9i0j-k1l2m3n4o5p6”
}
],
“connections”: {},
“settings”: {}
}
error - The resource you are requesting could not be found
I was wondering if there was an actual fix implemented?
What is the error message (if any)?
keep hitting the error - The ‘workflowObject’ property must be valid JSON, but cannot be parsed
Please share your workflow
{
"nodes": [
{
"parameters": {
"operation": "create",
"workflowObject": "={{ $node[\"Code in JavaScript\"].json.workflowObject }}\n",
"requestOptions": {}
},
"type": "n8n-nodes-base.n8n",
"typeVersion": 1,
"position": [
2064,
256
],
"id": "ed77bb08-97bd-45da-a200-e856b0438b44",
"name": "Create a workflow",
"credentials": {
"n8nApi": {
"id": "l0nZPWuK5jNTnSYS",
"name": "n8n account"
}
}
},
{
"parameters": {
"jsCode": "// Code node: Clean up workflowObject strictly\n\nconst allItems = $input.all();\n\nif (allItems.length === 0) {\n throw new Error(\"No input items to transform\");\n}\n\nconst raw = allItems[0].json;\nconst w = raw.data ? raw.data : raw;\n\n// Helper to check if an object has any own‑properties\nfunction hasOwnProperties(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n return Object.keys(obj).length > 0;\n}\n\n// Build minimal workflowObject\nconst workflowObject = {\n name: w.name,\n nodes: w.nodes,\n connections: w.connections,\n settings: w.settings && hasOwnProperties(w.settings) ? w.settings : {},\n};\n\n// Optionally include extras only if valid\nif (Array.isArray(w.tags) && w.tags.length > 0) {\n workflowObject.tags = w.tags;\n}\n\nif (w.versionId && typeof w.versionId === 'string' && w.versionId.trim() !== '') {\n workflowObject.versionId = w.versionId;\n}\n\nif (w.shared && Array.isArray(w.shared) && w.shared.length > 0) {\n workflowObject.shared = w.shared;\n}\n\nif (w.meta && typeof w.meta === 'object' && hasOwnProperties(w.meta)) {\n workflowObject.meta = w.meta;\n}\n\nif (typeof w.active === 'boolean') {\n workflowObject.active = w.active;\n}\n\nif (w.createdAt && typeof w.createdAt === 'string' && w.createdAt.trim() !== '') {\n workflowObject.createdAt = w.createdAt;\n}\n\nif (w.updatedAt && typeof w.updatedAt === 'string' && w.updatedAt.trim() !== '') {\n workflowObject.updatedAt = w.updatedAt;\n}\n\nif (w.pinData && typeof w.pinData === 'object' && hasOwnProperties(w.pinData)) {\n workflowObject.pinData = w.pinData;\n}\n\n// Also clean nodes: remove internal metadata that might break schema\nworkflowObject.nodes = workflowObject.nodes.map(node => {\n const cleaned = { ...node };\n\n // Remove fields starting with \"__rl\" or internal metadata\n if (cleaned.parameters) {\n // deep clean parameters if required\n // But for simplicity, remove any \"__rl\" keys in node\n delete cleaned.parameters.__rl;\n // possibly also delete cached URLs etc\n }\n\n return cleaned;\n});\n\n// Return\nreturn [\n {\n json: {\n workflowObject\n }\n }\n];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1776,
352
],
"id": "efe51dca-481c-4d0f-a315-353f7a81099a",
"name": "Code in JavaScript"
}
],
"connections": {
"Create a workflow": {
"main": [
[]
]
},
"Code in JavaScript": {
"main": [
[
{
"node": "Create a workflow",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateId": "3096",
"templateCredsSetupCompleted": true,
"instanceId": "e8c092e78bd9874dd52a3b93b95046584d8b8f605b7c62825016c2239589947d"
}
}(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.)
Share the output returned by the last node
input expression in n8n node - {{ $node["Code in JavaScript"].json.workflowObject }}. output is error due to [object Object] returnedInformation on your n8n setup
-
n8n version: 1.110.1
-
Database (default: SQLite): NA
-
n8n EXECUTIONS_PROCESS setting (default: own, main): trigger node
-
Running n8n via (Docker, npm, n8n cloud, desktop app): running workflow on n8n hosted on coolify hosted on hostinger.
-
Operating system: coolify
-
Debug info
core
- n8nVersion: 1.110.1
- platform: docker (self-hosted)
- nodeJsVersion: 22.19.0
- database: sqlite
- executionMode: regular
- concurrency: -1
- license: enterprise (production)
-
storage
- success: all
- error: all
- progress: false
- manual: true
- binaryMode: memory
pruning
- enabled: true
- maxAge: 336 hours
- maxCount: 10000 executions
client
- userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/139.0.0.0 safari/537.36
- isTouchDevice: false
security
- secureCookie: false
Generated at: 2025-09-15T02:45:01.961Z