Skip to content

runs_get: ValidationError on encrypted bytes in WorkflowRun.input (no decryption path in SDK) #115

Description

@kalyanaramansanthanam

SDK version: vercel==0.5.8

runs_get raises ValidationError because the workflow service returns what appears to be encrypted bytes (b'encr\x9aN\xf2…') for WorkflowRun.input (specifically the pending discriminator branch). The schema in world.py:124 types this field as list[bytes] | str | None, with no admission for an encrypted envelope.

The Python SDK has no decryption code — worlds/vercel.py:33 _cbor_tag_hook only unwraps CBOR tag 64, and _internal/workflow/ contains no symmetric-decryption path. This suggests the workflow service applies an encryption envelope that the JS SDK strips transparently, but the Python SDK does not.

Log trace

[info] HTTP Request: GET https://vercel-workflow.com/api/v2/runs/wrun_…?remoteRefBehavior=resolve "HTTP/1.1 200 OK"
[error] Traceback (most recent call last):
[error] File "/var/task/_vendor/vercel/_internal/workflow/worlds/vercel.py", line 227, in async_handler
    result = await handler(
             ^^^^^^^^^^^^^^
[error] File "/var/task/_vendor/vercel/_internal/workflow/runtime.py", line 270, in workflow_handler
    workflow_run = await world.runs_get(run_id)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] File "/var/task/_vendor/vercel/_internal/workflow/worlds/vercel.py", line 268, in runs_get
    return await self._cbor_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
[error] File "/var/task/_vendor/vercel/_internal/workflow/worlds/vercel.py", line 134, in _cbor_request
    return schema.validate_python(result)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] File "/var/task/_vendor/pydantic/type_adapter.py", line 441, in validate_python
    return self.validator.validate_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] pydantic_core._pydantic_core.ValidationError: 2 validation errors for tagged-union[NonFinalWorkflowRun,NonFinalWorkflowRun,CancelledWorkflowRun,CompletedWorkflowRun,FailedWorkflowRun]
pending.input.list[bytes]
  Input should be a valid list [type=list_type, input_value=b'encr\x9aN\xf2i\xd6\x8e\…x1c\x12j\xbfo\x9d\xf3* ', input_type=bytes]
    For further information visit https://errors.pydantic.dev/2.12/v/list_type
pending.input.str
  Input should be a valid string, unable to parse raw data as a unicode string [type=string_unicode, input_value=b'encr\x9aN\xf2i\xd6\x8e\…x1c\x12j\xbfo\x9d\xf3* ', input_type=bytes]
    For further information visit https://errors.pydantic.dev/2.12/v/string_unicode

The b'encr…' magic prefix suggests this is an explicit encryption envelope (possibly the same encr prefix used elsewhere in the workflow service for symmetric AEAD).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions