duvo client. It ships with every Run, so there is nothing to install.
Start here
print() output and anything written to stderr appear in the Run detail while the program works, in order with the tool calls around them.
What a step is given
Each Run hands the program one input. Read it fromduvo:
case_ref,triggerandtrigger_payloadareNonewhen they don’t apply, so the program can tell what started it:case_reffor a Run bound to a Case,triggerfor one an event started.policyis{}andfilesis[]when the step has none.case_refis a reference, not a copy. Read the Case withclaim_case.- Make repeated work safe with
execution.run_id. A retry reuses the same Run, sorun_idstays the same across attempts. Useexecution.attemptfor logging only.
Event triggers
A step started by an event trigger, such as a new Gmail message or a Linear webhook, reads the item fromduvo.trigger_payload:
- Branch on
trigger_type, notsource. One Connection can own several unrelated triggers, each with its own fields. - A payload holds what the trigger already had. Gmail’s payload is the message and thread IDs, not the email itself. Read the rest through the Connection.
- A capped payload says so. When a long body or a wide row is cut, the payload carries
truncated: true. Check it if the step must not act on a partial record. payload_versionchanges when a field is renamed or removed. Check it if the step must not run against a shape it wasn’t written for.
Policy
duvo.policy holds the Policy answers this step reads, resolved when the Run started. Changing an answer takes effect on the next Run, without editing the program. A Run doesn’t start while one of those questions is unanswered.
Files
Files attached in the step’s Files setup are in the sandbox before the program starts. Open one by the name it was attached under:file_path raises an error for a name the step doesn’t have, rather than returning None. Use duvo.files to list them.
Queues
update_case replaces the Case’s data rather than merging into it, so send every field the Case should keep. On a Queue with a Case schema, pass json_data instead of data.
list_cases, list_labels and read_case_file exist on both sides of a Queue, so reach them through the side you mean:
attach_case_file is on the consumer side only, for the Case this Run claimed. To attach a file to a Case you add, list it under that Case’s attachments, as {"file_path": ...}, in add_cases.
To hand a Case to one of several next steps from code, see Let the code decide.
Connections
Every Connection attached to the step is underduvo.connections:
- The step’s Connections row shows the name to type for each Connection.
- Hyphens become underscores:
microsoft-calendarisduvo.connections.microsoft_calendar. - Two Connections of the same kind each get an ID suffix, such as
gmail_<id>, and neither keeps the short name. That way a program never sends from the wrong mailbox by accident.duvo.connections.nameslists the names that work. - Arguments are keywords, passed through unchanged. The tool decides what it takes. A wrong tool name or argument comes back as an error from the Connection.
- A Connection the Run doesn’t have fails the call straight away and names the ones it does have. Nothing is skipped quietly.
Check which account a call reaches
For a call that must reach one specific account, such as a NetSuite sandbox rather than production, name the account’s origin:- Use an HTTPS origin only: no credentials, port, path, query or fragment. A trailing slash is allowed.
- Duvo checks the Connection against the origin before the call and keeps every request and redirect on that origin.
- If the origin doesn’t match, the error says the tool wasn’t sent.
- If the connection drops or no verification comes back, the outcome is unknown. Check the record before you retry a write. Duvo doesn’t retry these calls for you.
One file or several
A new code step is one file,main.py, run with python main.py.
For a larger program, select Add file above the editor. The step becomes a file list: your program stays in main.py, and you can add modules next to it and import them as usual. The step still runs with python main.py; the line under the editor shows the command.
To run a different command, set it with the Duvo CLI or the API.
How a Run ends
When a Run fails, the traceback is in the Run detail.
The sandbox
- Python 3 in a fresh sandbox for each Run, working directory
/workspace/code-step. - A step installs nothing while it runs. It has the sandbox’s own libraries, among them
pandas,numpy,pyarrow,requests,openpyxl,python-docxandpython-pptx. - A Run has 10 minutes by default.
Errors
Every error derives fromduvo.DuvoError and fails the Run unless the program catches it.