Skip to content

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

Description

@Rajkumar2002-Rk

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions