Live SSE
Running container jobs expose GET /workflows/{workflow_id}/jobs/{job_id}/events. Events arrive as text/event-stream; production Nginx disables buffering for the /api/.../events route.
Retained listing
GET .../logs reads ClickHouse in descending sequence order. It is available only when the workflow supports retained logs. After a job
settles, select Refresh logs to reread the current retained or filtered
results as log replay and indexing finish. Deleting a workflow clears its
dashboard views, closes its log streams and cancels pending exports in the
tab that performed the deletion.
Search and filtering
GET .../logs/search accepts:
stream=stdout|stderrq=<text>cursor=<opaque cursor>
When q is absent, the route performs retained stream filtering. When present,
Meilisearch matches all of the first ten terms it identifies and allows typos.
Terms after the tenth are ignored. Search supplies highlight ranges, and results
follow sequence order across pages. Meilisearch-backed pages return at most
999 rows. Continue while a cursor is present. A page may end early to stay
within the 3 MiB budget for encoded log records. If adding highlights would
make one log exceed that budget, the response returns that log's original text.
When a Meilisearch response exceeds the 8 MiB decoded body limit, the server
retries without highlights and reduces page size if needed.
Shareable line selections
The dashboard tracks each log's position within the current descending result set without displaying line numbers. Click a log to store its position in the URL as #L6, or Shift-click another log to create a range such as #L6-L19. The first selected log exposes actions to copy the selected log text or its permalink. Search and stream filters remain part of a shared URL, so positions resolve against the same filtered or unfiltered result set. Changing either filter clears the current selection because it changes the positioned result set. If a successful refresh moves or replaces a selected log entry in the same results, the viewer clears the selection and its URL fragment and cancels any queued scroll to that line. A read pauses queued scrolling until the viewer verifies that the selection still applies. The viewer checks whether the retained read itself moved the entries, even when a live row arrives at the same time. While logs are streaming, new rows move the selection and its Shift-click anchor as long as the selected entries stay together. If a delayed entry lands between selected entries, the viewer clears the selection and its URL fragment so the new entry cannot be copied as part of the original range. Once the viewer has scrolled to a selection, live arrivals let you keep browsing older output without jumping back to it. When a running job finishes, the viewer reloads retained or filtered results and fetches any older pages needed to check the selection. It clears the selection if the retained results confirm that a selected entry has moved or is missing.
Opening a line link, including when returning with Back or Forward, resolves its positions against that URL’s filters. The link remains pending until the first successful log read, including while the job is queued. It also stays pending while a required read is in progress, paused offline, or has failed. After a failure, select Refresh logs to retry. If the selected entries are still in place, the viewer scrolls back to the selection. The dashboard keeps the link positional until the entire range is confirmed or the cursor runs out. It keeps loading older pages while requested entries remain unconfirmed, even if live arrivals fill the displayed range. The viewer scrolls only after the full range is bound to log events. Reopening a link scrolls again if it resolves to a different entry. If the cursor runs out first, the viewer highlights the confirmed lines and reports the unresolved positions as unavailable. A job-status change requires a new retained read before that warning can be shown again. During live streaming, a line link highlights and copies only entries it has bound to event IDs. A later successful read can confirm positions filled by new live rows. Running jobs support line selection, but the dashboard enables copying a share link only after the job reaches COMPLETED, FAILED, or CANCELED and the current log read succeeds.
Raw downloads
Authenticated GET and supported HEAD requests receive Cache-Control: no-store,
including gateway-generated errors.
GET .../logs/raw streams typed application/x-ndjson in ascending sequence
order. It accepts stream and text filters, uses the same ten-term limit,
and omits search highlights. A successful export ends with exactly one newline-terminated complete record
and clean EOF. An empty export still has a completion record. A later failure
may send an error record. Reject errors, trailing records, and truncation.
Completion certifies this traversal; late logs or index updates can affect a
later export.
The dashboard assembles TXT, JSON, or JSONL after verifying completion, with a
limit of 8 MiB each for the received stream and the saved file. Use the filters
to narrow larger dashboard exports. Direct API clients receive the same NDJSON
regardless of how they save it. To reconstruct TXT after a successful HTTP
transfer to export.ndjson, write each raw message and one newline to a
temporary file. The example replaces logs.txt only after validating the final
completion record and reaching EOF.
import json
from pathlib import Path
from tempfile import TemporaryDirectory
output = Path("logs.txt")
with TemporaryDirectory(dir=output.parent, prefix=".logs-") as workspace:
temporary = Path(workspace) / output.name
complete = False
with open("export.ndjson", "rb") as wire, temporary.open("wb") as text:
for line in wire:
if complete or not line.endswith(b"\n"):
raise ValueError("Invalid export record boundary")
record = json.loads(line.decode("utf-8"))
if record == {"type": "complete"}:
complete = True
elif (isinstance(record, dict) and record.get("type") == "log"
and isinstance(record.get("message_raw"), str)):
text.write(record["message_raw"].encode("utf-8") + b"\n")
else:
raise ValueError("Invalid or failed export")
if not complete:
raise ValueError("Incomplete export")
temporary.replace(output)The temporary file needs enough disk space for the unwrapped text. Conversion holds one NDJSON record at a time.
Safe rendering
Search highlights are handled as structured data rather than trusted HTML. Client rendering must not pass Meilisearch fragments to an unsafe HTML sink.
Error behavior
Retained routes return 412 for unsupported or disabled retention. An already-open SSE response reports equivalent failures through event: error frames.
