AutomatorsDocs
Scenarios

Scenario API and environment

Use the injected SDK credentials and workspace paths in Python.

A scenario runs ordinary Python with the DataMaker SDK available. The runner injects credentials and context for the run:

VariablePurpose
DATAMAKER_API_KEYShort-lived scenario-run credential used by the SDK; send as X-API-Key for raw HTTP.
DATAMAKER_API_URLAPI base URL for this execution.
DATAMAKER_PROJECT_ID, DATAMAKER_TEAM_ID, DATAMAKER_SCENARIO_IDRun scope.
DATAMAKER_WORKSPACE_UPLOADSInput directory synchronized before execution.
DATAMAKER_WORKSPACE_OUTPUTSOutput directory persisted by the runner.

The credential has project READ_WRITE privileges outside its run-bound scenario, log and workspace operations. Do not print it, persist it in output or send it to a third-party service. It cannot start another scenario run.

Generate

from datamaker import DataMaker

dm = DataMaker()
result = dm.generate_from_template_id("<template-id>", quantity=10)

result is an object containing live_data columns and dependencies. Follow Python SDK → Convert columns to rows before iterating records or exporting them.

Parameters and files

Read your scenario's configured variables with os.environ. There is no dm.params object. Read input files and write deliverables using the injected paths; see Workspace files.

Use the installed SDK's actual methods for templates, connections, endpoints and files. Method payloads differ; avoid copying placeholder calls such as export_data without constructing the body required by the API.

Raw HTTP

For an operation your SDK version does not wrap, use the configured API URL and X-API-Key. Check the HTTP status and use a timeout. The REST reference describes common routes; permissions and run-credential restrictions still apply.

For multi-step orchestration across scenarios, use an external service with a separately scoped key and the documented /scenarios/execute route.

On this page