Inputs
Output
Type:Any
Returns whatever the last line of the code evaluates to. Can be any type (str, int, list, dict, etc). If files are created, returns dict with ‘result’ and ‘files’ keys.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Executes arbitrary Python code and returns the result
| App | Code |
| Operation ID | code_python |
| Type | Action |
| Connection | None |
| Credits per run | 2 |
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
variables | object | No | - | Top-level variables injected into the execution context before your code runs. • Keys must be valid Python identifiers (e.g., account_ids, keywords). • Values can be literals or placeholders like {{nodeId.data}}; placeholders are resolved and type-cast to the correct Python types automatically. Example: {“keywords”: “{{googleAdsNodeId.data}}”, “accounts”: “{{accountNode.data}}”} You can reference these directly in code (no imports or parsing needed), e.g.: result = {“count”: len(accounts), “first_kw”: keywords[0]} |
packages | array of string | No | - | Additional Python packages to install in the sandbox (max 5 packages). • Provide a list of package names • Common packages like pandas, numpy, requests are already available. Don’t try to reinstall them. • Packages will be installed using pip before code execution Example: [‘countryinfo==0.1.2’] |
code | string | Yes | - | The Python code to be executed supports all standard and data analysis libraries. Examples include: pandas, numpy, requests, seaborn, urllib, nltk, beautifulsoup4. Follow the instructions below when writing your code: - Your code must return a result — place it as the last line so it is captured as the output. - To return multiple values, combine them into a single dict, e.g.: {“key1”: value1, “key2”: value2} - The final value must be one of these JSON-safe types: dict, list, str, int, float, bool, or None. - Do not print the result; only return it as the last expression. - Do not return complex objects such as DataFrames, NumPy arrays, sets, custom classes, or functions. Convert them to plain lists or dicts first. Important: Do not define or assign dynamic variables here. They are provided automatically and will already exist as direct variables in the execution context (e.g., if you defined ‘payload’ in variables, just use ‘payload’ directly in your code). |
Any
Returns whatever the last line of the code evaluates to. Can be any type (str, int, list, dict, etc). If files are created, returns dict with ‘result’ and ‘files’ keys.