#8354·sim

`GET /api/v2/logs/{runId}` can return an unfinished log right after a sync execute completes

Author: Rajkumar2002-RkCreated Sep 27, 2026Updated Sep 27, 2026

Self-hosted, image built 2026-09-23. I call POST /api/v2/workflows/{id}/execute synchronously, and as soon as it returns status: completed I fetch GET /api/v2/logs/{runId}.

Two things show up:

  1. Straight after execute returns, the log still says status: running with endedAt: null. It's final a couple of milliseconds later.
  2. After the status is completed, cost.total is set but cost.items is still null. This happened in 379 of 1,608 runs in one batch. The matching usage_log rows are written about 17ms after the log's ended_at.

My workaround is to poll until the status is terminal and cost.items isn't null. It would help if the log were complete before the sync execute returns, or if the docs said the log is eventually consistent and which field to wait on. Without that, telemetry built on the logs API quietly misses cost data.