`raise` and `listen` timeout set the error `instance` to the workflow ID instead of a JSON Pointer to the task · Issue #629 · zigflow/zigflow · GitHub
Skip to content

raise and listen timeout set the error instance to the workflow ID instead of a JSON Pointer to the task #629

Closed

Description

@ShlomitSibony

Summary

raise and the listen timeout set the error's instance to the Temporal workflow ID. The docs for raise (docs/docs/dsl/tasks/raise.md), following the Open Workflow Specification, say instance is a JSON Pointer to the component the error originates from, and that runtimes MUST set it when raising an error. raise also discards an instance the user writes.

Reproduce

document:
  dsl: 1.0.0
  taskQueue: inst-uncaught
  workflowType: workflow
  version: 0.0.1
do:
  - failing:
      raise:
        error:
          type: https://example.com/errors/custom
          status: 400
          title: Custom
          instance: /my/own/pointer

Run it with zigflow run --file <file>, start it with temporal workflow start --task-queue inst-uncaught --type workflow --workflow-id Q-3, then read the workflow's error from a Go client.

Actual: the error is [400] Custom: (https://example.com/errors/custom). Origin: 'Q-3'. Origin is the workflow ID, not the instance the workflow defines.

Expected: Origin: '/my/own/pointer'. When the user sets no instance, a JSON Pointer to the task, for example /do/0/failing.

The listen timeout does the same. With the try from #624, a catch sees it as $data.<as>.instance.

Cause

  • pkg/zigflow/tasks/task_builder_raise.go: instanceID := info.WorkflowExecution.ID is passed to the standard error constructors, and the custom-type branch sets raiseErr.Instance to instanceID, which overwrites definition.Instance.
  • pkg/zigflow/tasks/task_builder_listen.go: the timeout builds models.NewErrTimeout(...) with the workflow ID as the instance.

Suggested fix

Keep an instance the user supplies. Otherwise derive a JSON Pointer to the task. The builders already track a task path, but it holds task names rather than the index based pointer the spec describes, so that needs a decision. Add tests for both builders.

Affected versions

Reproduced on the #624 branch (34d1a09ee). Neither file is changed by #624, so main (7f0dd16) behaves the same. YJ-928 raised this while reviewing #624.

Activity

  1. YJ-928 commented on Oct 16, 2026

    @YJ-928
    Member

    Thanks for filing this, @ShlomitSibony. Would you like to take it? If not, I'm happy to. Since the spec has instance as a JSON Pointer to the task, changing it changes what a catch sees, so it would be good to get it into the same breaking release as #624.

  2. added
    bugSomething isn't working
    v1Required to put Zigflow into GA
    and removed
    v1Required to put Zigflow into GA
    on Oct 16, 2026
  3. ShlomitSibony commented on Oct 16, 2026

    @ShlomitSibony
    ContributorAuthor

    You can take it @YJ-928 , agreed

  4. self-assigned this
    on Oct 20, 2026
  5. added a commit that references this issue on Oct 23, 2026
    9f30f16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnever-stalev1Required to put Zigflow into GA

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions