I’m experiencing an issue where a Python script that runs perfectly in the n8n Community Edition’s Code node fails in the n8n Cloud Edition. Specifically, in the Cloud version, the node (labeled as “Code in Python (Native)”) throws a “60 seconds runner error” (something like “Task request timed out after 60 seconds”). This seems to happen regardless of the input data size, and the workflow doesn’t execute the code at all.
For context, the code is designed to flatten an array of product variants from an input JSON structure, creating one output item per variant while preserving the parent product data. It worked without issues in my self-hosted Community Edition setup, but after migrating to Cloud, it consistently times out on the runner assignment.
Steps to Reproduce:
-
Create a new workflow in n8n Cloud Edition.
-
Add a “Code in Python (Native)” node.
-
Paste the following Python code into the node:
text
# Flatten the items array - create one row per variant with all product data output = [] for item in items: product_data = item.get('json', {}) variants = product_data.get('items', []) # Create a copy of product data without the items array product_fields = {k: v for k, v in product_data.items() if k != 'items'} # Loop through each variant in the items array for variant in variants: # Combine product fields with variant fields row_data = product_fields.copy() row_data.update({ 'item_id': variant.get('item_id'), 'item_sku': variant.get('item_sku'), 'item_size': variant.get('item_size'), 'item_size_value': variant.get('item_size_value'), 'item_size_system': variant.get('item_size_system'), 'item_stock': variant.get('item_stock') }) output.append({ 'json': row_data }) return output