temporalio / temporalio/cli

[Bug] Fetching workflow update outcome yields incorrect JSON output in result and error cases

Open
#952 3 comments 0 reactions 1 assignee View on GitHub

@dandavison is already working on this.

Since Jun 11, 2026.

bug good first issue
Dominant language
Go
Stars
379
Forks
103
Avg merge
2d 11h
Merged PRs (30d)
23

Description

Describe the bug

Fetching workflow update result via temporal workflow update execute or temporal workflow update result with -o json yields output that is incorrect in two ways:

  • If there is the update failed with an error, no error JSON is produced.
  • If the update succeeds, the JSON does not include full result payload details when using the --no-json-shorthand-payloads option (it is effectively silently ignored).
Minimal Reproduction
Failed update

Start this workflow

@workflow.defn
class WorkflowWithUpdate:
    @workflow.run
    async def run(self) -> None:
        await asyncio.Future()

    @workflow.update
    async def update(self) -> str:
        raise ApplicationError("error in update")
temporal workflow start --type WorkflowWithUpdate --task-queue demo

Now try to fetch an update result. The CLI outputs an error message but no JSON error info. It should output detailed structured error chain info including stack traces:

$ temporal workflow -o json update execute --workflow-id 195d41da-784e-406e-a376-53f18a99b1f4 --name update
Error: unable to update workflow: error in update
Successful update

Start this workflow

@workflow.defn
class WorkflowWithResult:
    @workflow.run
    async def run(self) -> str:
        return "workflow-result"

Then fetch the update result. The CLI outputs a JSON document describing the result, but --no-json-shorthand-payloads does not yield full payload details:

$ temporal workflow -o json update execute --workflow-id e97a2ee6-e2c8-49b4-849b-603a084e9cfb --name update
{
  "name": "update",
  "updateId": "71d71116-338a-4688-b502-a3fa678819e0",
  "result": "update-result"
}
$ temporal --no-json-shorthand-payloads workflow -o json update execute --workflow-id e97a2ee6-e2c8-49b4-849b-603a084e9cfb --name update
{
  "name": "update",
  "updateId": "e8a22eb1-4422-426c-a1e5-025504d6ff97",
  "result": "update-result"
}

This is inconsistent with the behavior for a standalone activity (or workflow, etc) result:

standalone activity

$ temporal activity execute -o json -a activity-1 --start-to-close-timeout 1s --type greet --task-queue demo --input '"World"'
{
  "activityId": "activity-1",
  "runId": "019c95ab-fcaa-7ce1-bbf3-f847a8ee4080",
  "status": "COMPLETED",
  "result": "Hello, World!"
}
$ temporal activity execute --no-json-shorthand-payloads -o json -a activity-1 --start-to-close-timeout 1s --type greet --task-queue demo --input '"World"'
{
  "activityId": "activity-1",
  "runId": "019c95ac-2bd9-79fd-be40-65e42be13717",
  "status": "COMPLETED",
  "result": {
    "payloads": [
      {
        "metadata": {
          "encoding": "anNvbi9wbGFpbg=="
        },
        "data": "IkhlbGxvLCBXb3JsZCEi"
      }
    ]
  }
}

workflow

$ temporal workflow result -o json --workflow-id 2ba765c4-3e1b-4854-b31d-ddcfd37b2598
{
  "workflowId": "2ba765c4-3e1b-4854-b31d-ddcfd37b2598",
  "runId": "019c959e-0ca9-77c7-8e66-d843ced91424",
  "namespace": "dan-sa-demo.a2dd6",
  "status": "COMPLETED",
  "closeEvent": {
    "eventId": "5",
    "eventTime": "2026-02-25T16:24:49.131790142Z",
    "eventType": "EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED",
    "version": "100265",
    "taskId": "266083684",
    "workflowExecutionCompletedEventAttributes": {
      "result": [
        "workflow-result"
      ],
      "workflowTaskCompletedEventId": "4"
    }
  },
  "result": "workflow-result"
}
$ temporal workflow result --no-json-shorthand-payloads -o json --workflow-id 2ba765c4-3e1b-4854-b31d-ddcfd37b2598
{
  "workflowId": "2ba765c4-3e1b-4854-b31d-ddcfd37b2598",
  "runId": "019c959e-0ca9-77c7-8e66-d843ced91424",
  "namespace": "dan-sa-demo.a2dd6",
  "status": "COMPLETED",
  "closeEvent": {
    "eventId": "5",
    "eventTime": "2026-02-25T16:24:49.131790142Z",
    "eventType": "EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED",
    "version": "100265",
    "taskId": "266083684",
    "workflowExecutionCompletedEventAttributes": {
      "result": {
        "payloads": [
          {
            "metadata": {
              "encoding": "anNvbi9wbGFpbg=="
            },
            "data": "IndvcmtmbG93LXJlc3VsdCI="
          }
        ]
      },
      "workflowTaskCompletedEventId": "4"
    }
  },
  "result": {
    "metadata": {
      "encoding": "anNvbi9wbGFpbg=="
    },
    "data": "IndvcmtmbG93LXJlc3VsdCI="
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.