Container actions
A container action runs a short Python or Node.js script, or an image of your own, in a temporary, locked-down container. It hands the container a JSON input and takes the JSON the container prints as the action's value.
The instance does not hold a thread while the script runs. It parks on the action, the API sends the run to the separate container runner, and the instance continues when the run ends: with the value, or with a failure that goes through the action's onError like any other.
Off by default
A host runs container actions only when ProcessFlow:Containers:Enabled is true and the runner is up. A definition with a container action still publishes on a host where they are off; the action then fails at once with container.disabled and nothing waits.
A company's policy data also decides which runtimes, images, networks and container secrets its definitions may use. A runtime outside the company's list is refused at publish.
A script in one action
{
"id": "calculate-risk",
"type": "container",
"assignTo": "risk",
"timeoutMs": 120000,
"idempotencyKey": { "$expr": "'risk-' + vars.orderId" },
"onError": { "policy": "retry", "maxAttempts": 2 },
"config": {
"mode": "script",
"runtime": "python-3.13",
"script": "import json,sys\nx=json.load(sys.stdin)\nprint(json.dumps({'risk':'high' if x['amount']>10000 else 'low'}))",
"input": { "amount": { "$expr": "vars.amount" } },
"resultPath": "risk",
"cpuMillicores": 500,
"memoryMb": 256,
"network": "none"
}
}The shipped runner has the runtimes python-3.13 and node-24. The script reads its input on stdin and prints exactly one JSON value on stdout; everything else belongs on stderr.
The two modes
| Mode | What runs | Notes |
|---|---|---|
script | Your script, in the runner's Python or Node.js runtime | Up to 64 KiB of script text |
image | An image the company allows, pinned by digest | command and args can replace the image's entrypoint and command |
Inside the container
The runner starts every run in the same hardened shape: a non-root user, no capabilities, a read-only root file system, a small writable /tmp, and limits on CPU, memory, processes and time. The shipped runner accepts 50 to 2,000 millicores and 32 to 1,024 MiB of memory.
- Files.
inputFileshands up to 16 process files to the container, read-only.outputFilestakes the files it writes back as ordinary instance files. - Environment.
envsets plain variables, visible to anyone who can read the definition.secretsmaps variable names to container secrets, which Duna never stores and scrubs from what it records. - Network. None by default: the container has only loopback. With
network: "allowlist"it reaches only the hosts its company allows, over HTTP and HTTPS, through a proxy the runner starts for that one run.
Where it may stand
A container action can run only where the instance can wait for it: as a top-level action of a state's onEntry, of a transition, or of onExit, in the main flow, in a fork branch or in an async child process. Publishing refuses it inside a forEach or parallel action, in a transaction group, in a boundary timer, or with an undo step of its own.
Try it before publishing
The editor's Test action runs one container action for real, with sample variables and sample files and no instance. Every run of a real instance is listed on the instance page's Runs tab, with its status, limits and the end of its log.
See Actions & expressions for the envelope every action shares, and Operations & security for running the runner.