Comments (13)
Thanks @Joffcom
As per your recommendation i will deploy the n8n in a container and will update.
from n8n.
Hey @rajubish,
Can you share the Python you are trying to run?
from n8n.
Hi @Joffcom
Below python code executing through n8n workflow.
import json
tenant_data = []
for item in _input.all():
tenant_ids = item.json["tenant_ids"]
print(type(tenant_ids))
if tenant_ids:
for tenantid, val in tenant_ids.items():
tenant_data.append({"tenant_id": tenantid})
print(tenant_data)
print(type(tenant_data))
return tenant_data
from n8n.
To avoid duplication of work. This question got also posted to the forum:
https://community.n8n.io/t/workflow-getting-error-on-execution/42705
Please do in the future not post twice! That just causes unnecessary work for us. Thanks.
from n8n.
Understood. Can you get resolution for this error please.
from n8n.
Any update?
from n8n.
Hey @rajubish,
Typically we only work Monday to Friday during Berlin office hours but occassionally we will post on our own time outside of those hours in this case I have only just got to a stage where I am ready to look into this.
Just running the Python has not reproduced the same issue, Can you share the json input data as well.
from n8n.
Hi @Joffcom
Thanks for your response.
Here here the json input data.
[ { "tenant_ids": { "241996091870937089": "1", "243599992579686401": "1", "255284649314484225": "1" } } ]
Below is the workflow json code.
{ "name": "Notification Schedule", "nodes": [ { "parameters": { "rule": { "interval": [ { "field": "minutes", "minutesInterval": 2 } ] } }, "id": "6d89c467-5782-4078-a5a1-59346a48de4c", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.1, "position": [ 260, 460 ] }, { "parameters": { "batchSize": "=1", "options": {} }, "id": "a4afad13-94cf-433b-bc74-e8111d8a416c", "name": "Loop Over Items", "type": "n8n-nodes-base.splitInBatches", "typeVersion": 3, "position": [ 900, 460 ] }, { "parameters": {}, "id": "501c626a-6942-4faf-b07e-985e5e1535eb", "name": "Replace Me", "type": "n8n-nodes-base.noOp", "typeVersion": 1, "position": [ 1160, 460 ] }, { "parameters": { "operation": "get", "propertyName": "tenant_ids", "key": "notification_partners", "keyType": "hash", "options": {} }, "id": "46631f9f-a119-4323-9a80-bc45b5fa11de", "name": "Redis", "type": "n8n-nodes-base.redis", "typeVersion": 1, "position": [ 480, 460 ], "credentials": { "redis": { "id": "UM5oeJgpCEmuArcc", "name": "Redis account" } } }, { "parameters": { "method": "POST", "url": "http://10.51.112.8:5678/webhook/2960855a-ff6d-48cb-b2d9-77faf5c78523", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "X-TENANT-ID", "value": "={{ $('Tenant').item.json[\"tenant_id\"] }}" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={ \"company_ids\": \"{{ $json[\"companies\"] }}\" }", "options": { "timeout": 10000 } }, "id": "f2199032-304f-4e9b-bc20-09c8db0426dc", "name": "HTTP Request", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.1, "position": [ 2020, 460 ] }, { "parameters": { "operation": "get", "propertyName": "company_ids", "key": "=notification_partners_{{ $json[\"tenant_id\"] }}", "keyType": "hash", "options": {} }, "id": "857d98bb-ae0d-49bb-9fd7-31241e367739", "name": "Redis1", "type": "n8n-nodes-base.redis", "typeVersion": 1, "position": [ 1580, 460 ], "credentials": { "redis": { "id": "UM5oeJgpCEmuArcc", "name": "Redis account" } } }, { "parameters": { "language": "python", "pythonCode": "import json\n\ntenant_id = []\nfor item in _input.all():\n print(\" item\", item.json[\"tenant_id\"])\n tenant_id = item.json[\"tenant_id\"]\n\nprint(\" tenant_id \", tenant_id)\nreturn {\"tenant_id\": tenant_id}" }, "id": "bb20f97d-e715-471b-97ca-f86613175350", "name": "Tenant", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1360, 460 ] }, { "parameters": { "language": "python", "pythonCode": "import json\n\ntenant_data = []\nfor item in _input.all():\n tenant_ids = item.json[\"tenant_ids\"]\n if tenant_ids:\n for tenantid, val in tenant_ids.items():\n tenant_data.append({\"tenant_id\": tenantid})\nreturn tenant_data" }, "id": "0acc523e-2ca0-46ce-bb2d-f97a98837fe2", "name": "Tenants", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 680, 460 ] }, { "parameters": { "language": "python", "pythonCode": "import json\nimport pyodide.ffi\n\ncompanies = []\nfor item in _input.all():\n company_ids = item.json[\"company_ids\"]\n if company_ids and isinstance(company_ids, pyodide.ffi.JsProxy):\n company_ids = company_ids.to_py()\n print(type(company_ids))\n if company_ids:\n for companyid, val in company_ids.items():\n companies.append(companyid)\n print(companies)\n print(type(companies))\nif companies:\n return {\"companies\": companies}\nelse:\n return []" }, "id": "c4eccbe2-527e-416a-9bd3-c5be2bed6075", "name": "Tenant_Companies", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1780, 460 ] } ], "pinData": {}, "connections": { "Schedule Trigger": { "main": [ [ { "node": "Redis", "type": "main", "index": 0 } ] ] }, "Loop Over Items": { "main": [ [], [ { "node": "Replace Me", "type": "main", "index": 0 } ] ] }, "Replace Me": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 }, { "node": "Tenant", "type": "main", "index": 0 } ] ] }, "Redis": { "main": [ [ { "node": "Tenants", "type": "main", "index": 0 } ] ] }, "Redis1": { "main": [ [ { "node": "Tenant_Companies", "type": "main", "index": 0 } ] ] }, "Tenant": { "main": [ [ { "node": "Redis1", "type": "main", "index": 0 } ] ] }, "Tenants": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Tenant_Companies": { "main": [ [ { "node": "HTTP Request", "type": "main", "index": 0 } ] ] } }, "active": true, "settings": { "executionOrder": "v1" }, "versionId": "b8b68756-8149-4074-a011-1b586588894a", "meta": { "instanceId": "502c49c4a56b1c43a539c577bb99b2be3ca5acbe45ccd229ff14c53ab891b275" }, "id": "UtMRYFmttChIW7aO", "tags": [] }
from n8n.
Hey @rajubish,
This appears to be working as expected for me.
Running your workflow up to the second redis node is also ok, can you provide a contained workflow that reproduces this issue? Are you also using the docker image, running from npm or doing something else?
from n8n.
Hi @Joffcom
If i run manually then it works find without any issue, but if it's trigger from scheduler then it's failing.
![Screenshot 2024-03-18 at 9 59 39 PM](https://private-user-images.githubusercontent.com/74891056/313761031-b3ffc7fd-7dbb-4c30-bbdd-01f00ca15997.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcyNTgzMzcsIm5iZiI6MTcxNzI1ODAzNywicGF0aCI6Ii83NDg5MTA1Ni8zMTM3NjEwMzEtYjNmZmM3ZmQtN2RiYi00YzMwLWJiZGQtMDFmMDBjYTE1OTk3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjAxVDE2MDcxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY4ZWI2Y2I0OWVjZGI2YTc2YTU5MDU0ZTA2NmZmNTk1MGZjYmI3MWQ2OWVmMGY5MzM4YjlhODNlODRlN2RkM2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bFBBKzYEjt-sjEEaAjjjyaPAeC5k8bCy5MaP87AkXEA)
![Screenshot 2024-03-18 at 10 01 47 PM](https://private-user-images.githubusercontent.com/74891056/313761371-239ab15f-a6c0-476d-97bd-2c5d74753eff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcyNTgzMzcsIm5iZiI6MTcxNzI1ODAzNywicGF0aCI6Ii83NDg5MTA1Ni8zMTM3NjEzNzEtMjM5YWIxNWYtYTZjMC00NzZkLTk3YmQtMmM1ZDc0NzUzZWZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjAxVDE2MDcxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI0ZjQ0ZGMxYzFhYzI4OTE3ZTQwY2NmMDk1NTY4YjM2ZDVmZTFhZjE5OWE0ZjExZjk0MDkxN2I2Y2FhMjljNTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zYC2OQxpBnfJYQ5lR8ukpL3jPUYWzKP7sYE2W0-SBJM)
Thanks
from n8n.
@Joffcom
I am running the n8n using npm in ubuntu machine.
from n8n.
Hey @rajubish,
Running it as a shedule doesn't appear to be causing an issue for me either, Can you try running n8n in a container as recommended and see if that has the same issue?
from n8n.
Moving to closed for now as we are not able to reproduce so I suspect it is a local issue.
from n8n.
Related Issues (20)
- "Convert to HTML Table" Does Not Add the "Row Attributes" Option HOT 2
- workflows.map is not a function HOT 2
- Renaming the node by leaving the name field empty causes unexpected behavior HOT 5
- Can you add options for multi-branch parallel execution and for nodes to continue the workflow execution even if an error occurs? HOT 1
- Error: HTTP status 403 HOT 7
- Node Max Tries / Wait Values Limits Too Low HOT 7
- Ask AI is not present in the Code node on self-hosted Docker ver 1.41.1 HOT 3
- Pagination Does Not Reset When Re-Testing Node HOT 3
- NPM - Esm modules are not supported, dynamic (async) import fails HOT 6
- http node executes "successfully" but error is returned HOT 3
- Webhook only work in test mode... HOT 3
- IF issue. Wrong type ' NNN' is a string but was expecting a number HOT 1
- RabbitMQ Workflow had to be deactivated HOT 10
- Custom Node Not Listed HOT 2
- test issue
- Test Ignore
- Test Ignore
- 1.41.0 - Adding Too Many Parameters Causes Node Window to Shake?! HOT 5
- The Read/Write Files from Disk Node do not working HOT 3
- BASE_PATH not been replaced correctly HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from n8n.