Results and Streaming API
Last validated: 2026-05-14
This page explains how to retrieve thread outputs, step details, and large payloads safely.
1) Results RPC Matrix
| RPC | HTTP annotation | Status | Primary use case |
|---|---|---|---|
GetThreadResult | GET /v1/scriptum/threads/{thread_id}/result | Partial | One-shot result fetch (metadata + output + step summaries) |
StreamThreadResult | GET /v1/scriptum/threads/{thread_id}/result/stream | Implemented | Stream large final output in chunks |
StreamStepResult | GET /v1/scriptum/threads/{thread_id}/steps/stream | Partial | Stream step details and chunked step payloads |
ListArtifacts | GET /v1/scriptum/threads/{thread_id}/artifacts | Unimplemented | Enumerate generated artifacts |
2) GetThreadResult (Unary)
Request fields:
thread_id(required)step_path(optional): exact hierarchical step path like1.0.2output_only(optional): skip step summaries/detailsmetadata_only(optional): return metadata without output payload
Response fields to monitor:
output_data(bytes)output_total_bytesoutput_truncatedsteps[]summariesstep_details[]whenstep_pathis providedyielded_values[],total_yielded,yields_truncated
Current runtime notes:
- Unary practical cap is around 4 MB for output payloads.
step_pathfiltering is exact-match.- Inline yielded values are capped.
Use cases:
- Fast polling for compact outputs.
- Summary dashboards with
metadata_only=true. - Single-step diagnosis with
step_path.
3) StreamThreadResult (Output Chunks)
Request fields:
thread_id(required)max_chunk_bytes(optional): default 2 MB, clamped to 64 KB..16 MB
Stream shape:
- First chunk is metadata (
ThreadOutputMeta) - Subsequent chunks are output bytes (
OutputChunk) chunk_indexandis_finalidentify ordering/completion
Use cases:
- Download very large result payloads reliably.
- Avoid unary response size limits.
4) StreamStepResult (Step Data Chunks)
Request fields:
thread_id(required)step_path(optional): stream one step or all stepsmax_chunk_bytes(optional)
Stream shape:
- meta (
StepResultMeta) with step summaries - per-step records (
StepDetail) - extra chunk records (
StepDataChunk) for large step input/output fields
Current runtime note:
- Chunked
StepDataChunk.fieldcurrently emits output path in practice.
Use cases:
- Deep incident debugging with large step payloads.
- Offline export of step-level telemetry.
5) Example Calls
gRPC unary, then stream fallback
# Unary first
grpcurl \
-H "authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-id: $SCRIPTUM_ORG_ID" \
-d '{"thread_id":"thr_abc123"}' \
rpc.dev.dodil.io:443 dodil.scriptum.v1.ScriptumService/GetThreadResult
# Stream output if truncated
grpcurl \
-H "authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-id: $SCRIPTUM_ORG_ID" \
-d '{"thread_id":"thr_abc123","max_chunk_bytes":1048576}' \
rpc.dev.dodil.io:443 dodil.scriptum.v1.ScriptumService/StreamThreadResultgRPC single-step details
grpcurl \
-H "authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-id: $SCRIPTUM_ORG_ID" \
-d '{"thread_id":"thr_abc123","step_path":"1.2.0"}' \
rpc.dev.dodil.io:443 dodil.scriptum.v1.ScriptumService/StreamStepResultHTTP contract example (gateway deployment)
curl -sS "https://api.dev.dodil.io:443/v1/scriptum/threads/thr_abc123/result" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-id: $SCRIPTUM_ORG_ID"6) Retrieval Strategy (Recommended)
- Call
GetThreadResultafter terminal status. - If
output_truncated=true, switch toStreamThreadResult. - If step output is truncated, switch to
StreamStepResult. - Persist output and step payloads as files for reproducible incident analysis.
7) Known Gaps and Safe Workarounds
ListArtifactscurrently returnsUNIMPLEMENTED: store and manage output artifacts in your own sink when needed.- Contract comments mention
StreamYieldedValues, but no such RPC exists in the service. - For high-volume outputs, prefer chunk sizes that match your client memory and network constraints.