Python Script fields
Use script output in a field and choose scenarios for larger workflows.
The catalogue type is Python Script. Its options.code contains a Python script; the runner captures script output. It is not a per-row callback with a value(rng, row, dm) signature.
Start with a small JSON-producing script and inspect the preview:
import json
print(json.dumps({"source": "example", "status": "ready"}))Do not use the previously documented dm.counter(), dm.workspace_file() or dm.template() helpers: those are not supported SDK methods. For sequential identifiers within generated data, consider a Derived value containing {{row}}.
Choose the right execution surface
Use a scenario when you need input files, third-party requirements, multi-step logic, multiple rows, exports or detailed run logs. Scenarios expose explicit workspace directories and a fuller execution lifecycle.
Python Script fields depend on the deployment's execution service. Their output is outside the seeded internal-generator guarantee. Do not assume a universal two-second timeout or that a field receives the scenario workspace and credentials in the same way as a saved scenario.
Verify before reuse
Generate a few values and check the actual returned shape, including whether JSON was parsed into the structure you expect. Treat exceptions or error markers as a failed data-quality check. Keep script output free of secrets and real personal data; a field label does not redact arbitrary Python output.