Skip to Content
BuildAction StepsCode editor

Code editor

Run Python 3.13 inside your automation and pass whatever your script prints to downstream Steps.

At a glanceVerified in app · Oct 29, 2026
Use it to
Run calculations, data reshaping, or signature checks in Python 3.13
Find it
Tools → Data → Dev tools → Code editor (t then c)
Cost
1 Step credit per execution
Limits
Python 3.13 (stdlib, numpy, pandas) · Isolated sandbox (no network)
Output
{{ N.result.output }} (last line), {{ N.result.executionOutput }}, {{ N.result.stderr }}
Instead
Inline pipes ({{ 1.email | trim | lower }}) or Change Fields

Runs Python 3.13 with the standard library, numpy, and pandas. The editor checks syntax as you type and flags unclosed brackets, indentation errors, and bare return statements.

Setting it up

Add the step

Press t then c, or open Tools → Data → Dev tools → Code editor.

Write your Python

Reference earlier steps with unquoted {{ }} placeholders on their own.

Print your result with json.dumps(). The step ignores return values.

Run the automation to see the result

Open the step’s Executions tab to inspect the parsed output.

Reading data from earlier steps

Each {{ }} reference arrives as a typed Python value: JSON objects become dict, arrays become list, and true / false / null become True / False / None. Apostrophes (such as O'Brien) need no escaping.

Valid syntaxStandalone Value Assignment
  • Place {{ }} unquoted on the right side of an assignment.
  • Use {{ 3.$full_result }} to read a whole Step output as one dict.
  • Applies to Step tokens, {{ $var.KEY }}, and {{ $secret.KEY }}.
Rejected syntaxInline Inside Quotes or F-Strings
  • Never place {{ }} inside quotes: print("Hello {{ 2.name }}") fails.
  • Assign the token to a Python variable first, then format it.
  • Standard Python doubled braces in f-strings work normally.
main.py
customer_name = {{ 2.customer_name }} order_total = {{ 2.total }} products = {{ 3.$full_result }} # Rejected: print("Hello {{ 2.customer_name }}") print(f"Hello {customer_name}")

See Variable Reference Syntax.

Available libraries

The sandbox includes Python 3.13’s standard library plus pinned numpy and pandas. Ask support before relying on unlisted packages.

LibraryVersionBest For
numpy2.5.1Numeric arrays and vector math
pandas2.3.3Tables, grouping, joins, and aggregation
main.py
import numpy as np import pandas as pd

What it passes on

A return inside a function does not publish output, and a top-level return is a syntax error. Print your final dictionary on the last line of stdout with json.dumps():

main.py
import json print(json.dumps({ "final_total": final_total, "discount_applied": discount, }))

Print valid JSON, not Python objects. print(my_dict) outputs single quotes, True, and None. Always serialize with json.dumps().

ReferenceReturnsNotes
{{ 4.result.output.final_total }}Parsed JSON from last linePreferred path. Aliases {{ 4.final_total }} and {{ 4.output.final_total }} also resolve here.
{{ 4.result.executionOutput }}Raw stdout and stderrIncludes debug print() lines up to stream limits.
{{ 4.result.stderr }}Standard error textLast 20,000 characters of stderr, kept separate from stdout and never parsed as JSON (omitted when empty).
{{ 4.$full_result }}Full execution wrapperReturns the result wrapper object.
{{ 4.item.final_total }} / {{ 4.results.0.final_total }}Looping Code Step outputRead the aligned item (item) or index (results.0) (loop syntax).

Limits

LimitValue & Behavior
Run time150 seconds default. Exceeding the timeout stops the script and fails the Step.
Output keptUp to 100,000 characters of stdout and 20,000 of stderr (256 KiB per-stream cap). Truncating the final stdout line fails with CODE_OUTPUT_TOO_LARGE; non-JSON final lines omit result.output with a warning.
MemoryBounded by sandbox capacity. Process large datasets in batches.
NetworkNone. Opening sockets (AF_INET / AF_INET6) fails with PermissionError.
ConcurrencyIsolated workers. Queued bursts wait at 0 Step credits for up to 15 minutes.

Examples to copy

main.py
import json order_total = {{ 2.total }} discount = order_total * 0.1 if order_total > 100 else 0 final_total = order_total - discount print(json.dumps({ "final_total": round(final_total, 2), "discount_applied": round(discount, 2), }))

Each example prints JSON on the final line, so downstream Steps read {{ 4.result.output }} directly without Parse JSON.

Verify it works
Run
Open Test & Debug on the Code editor Step and click Run step
You should see
The Output tab shows result.success: true and your printed JSON object parsed under result.output.

What’s Next?

Last updated on

Search documentation

Start with a guide, or search by Step, task or error.