Authoring to Publish
Goal. Take a new workflow from nothing to a published, immutable version.
When to use. Onboarding a new automation, migrating a one-off script into the managed lifecycle, or shipping the first release of a workflow.
1. Write the script
Save this as invoice_parser.scriptum. It reads an invoice with the managed
LLM, gates on a confidence threshold, and emits structured fields. The syntax —
do … with … -> binding, check … on pass/on fail, emit, indentation-based
blocks — is covered in Scriptum Language.
script "Invoice Parser"
Extract structured fields from a raw invoice.
version "0.1.0"
input
invoice_text : text -- raw invoice body
output
invoice_id : text
total : number
confidence : number
do "Extract fields" with llm
prompt = "Extract invoice_id, total, and a 0-1 confidence from:\n\n{invoice_text}"
system = "You are a precise invoice parser. Return only the requested fields."
-> parsed
check "Confident enough?" parsed.confidence >= 0.6
on pass: continue
on fail: fail "Low-confidence extraction; needs review"
emit "Result"
invoice_id = parsed.invoice_id
total = parsed.total
confidence = parsed.confidenceValidate it locally before touching the server — no connection needed:
dodil scriptum draft validate ./invoice_parser.scriptum
dodil scriptum draft fmt ./invoice_parser.scriptum2. Create the script container
dodil scriptum script create invoice-parser \
--description "Invoice extraction workflow" \
--tags "invoice,etl"3. Save, compile, test
# Upload the draft source
dodil scriptum draft save invoice-parser -f ./invoice_parser.scriptum
# Type-check against tool schemas; fix any diagnostics
dodil scriptum draft compile invoice-parser
# Run the draft with a sample input and the merged environment
dodil scriptum draft test invoice-parser \
--input @./samples/invoice_42.json \
--envcompile reports diagnostics with line and column, and lists the tools the
script requires. draft test runs the draft as a thread without publishing.
4. Publish and confirm
dodil scriptum draft publish invoice-parser
dodil scriptum version list invoice-parserPublishing snapshots the compiled draft as a new immutable, numbered version and makes it active.
Verification checklist
draft compilereturns success with no diagnostics.- The
draft testthread reaches a terminal completed status. - The published version appears in
version listas active. - The tools reported by
compileare present indodil scriptum tool list.
See also
- Run, Observe & Retrieve — run what you just published.
- CLI Guide — Scripts & Drafts — every flag.
- File Structure & Declarations — the script contract.