Skip to content

Steps using op.#HTTPDo, #HTTPGet, #HTTPPost, #HTTPPut or #HTTPDelete fail before sending a request #344

Backlog

Description

@briankane

Describe the bug

Every workflow step that calls one of the legacy vela/op HTTP functions (op.#HTTPDo, #HTTPGet, #HTTPPost, #HTTPPut, #HTTPDelete) fails before any request goes out, with:

function call error for req: cue: marshal error: req.response.body: cannot convert incomplete value "string" to JSON

The CUE for these functions declares the result under response (response: {body: string, statusCode: int, ...}), but the Go provider returns body, header and statusCode at the top of the call and fills them back at the root. Worse, the provider marshals the whole call node to JSON as its input, and response.body and response.statusCode are required fields with no value yet, so the marshal fails and the call never runs. A template doesn't have to read response at all to hit it.

This includes the chat-gpt step shipped in the vela-workflow chart, which calls op.#HTTPDo and reads http.response.body. Steps built on the newer vela/http package (http.#HTTPDo) are fine. The docs still teach op.#HTTPDo, #HTTPGet and #HTTPPost, so anyone following them lands here.

KubeVela carries no copy of this code; it registers workflow's legacy package as vela/op, so the fix is in workflow and reaches KubeVela through a workflow bump.

To Reproduce

  1. Apply a step definition using op.#HTTPGet:
apiVersion: core.oam.dev/v1beta1
kind: WorkflowStepDefinition
metadata:
  name: op-http-get
  namespace: vela-system
spec:
  schematic:
    cue:
      template: |
        import "vela/op"
        parameter: url: string
        req: op.#HTTPGet & {url: parameter.url}
        body: req.response.body
  1. Run it from an Application:
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: op-http-demo
  namespace: default
spec:
  components: []
  workflow:
    steps:
      - name: get
        type: op-http-get
        properties:
          url: https://example.com
  1. vela status op-http-demo: the step fails with the marshal error above. The shipped chat-gpt step fails the same way (http.response.body).

Expected behavior

The request is sent and its result is readable under response, as the template declares and as the docs show (docs/platform-engineers/workflow/cue-actions.md in kubevela.github.io).

Screenshots

N/A.

KubeVela Version

Reproduced as a Go test through workflow's task runner (pkg/tasks/custom, providers.DefaultCompiler, each template run as a step) at workflow main 593f538; not run on a cluster.

Affected: workflow v0.6.2 onward (v0.6.x, v0.7.x, v0.8.0-alpha.x), so KubeVela v1.10.0 onward (1.10.x, 1.11.x, v1.12.0-alpha.1 and alpha.2). KubeVela 1.9.x is not affected.

Cluster information

N/A (reproduced in-process).

Additional context

Where it appears in the code (workflow 593f538):

  • pkg/providers/legacy/http/http.cue:33-44: the required response {body, statusCode, ...} block; the function aliases at 48-54.
  • pkg/providers/legacy/http/http.go:89-94: ResponseVars with body/header/statusCode at the top; returned at 213-218; registered as LegacyGenericProviderFn at 257.
  • pkg/providers/types/types.go:127-144: LegacyGenericProviderFn.Call marshals the whole value (129), which is where the error comes from, and fills the result at the root (143), not under response.
  • charts/vela-workflow/definitions/chat-gpt.yaml:43,98-100: op.#HTTPDo, reading http.response.body and http.response.statusCode.

The provider used to fill its result under response; the move to the generic fill at the root kept the CUE as it was. Two ways to fix it: fill the result under response again in the Go side, or make the CUE match (result at the top, response dropped), which would break the shipped chat-gpt step and anything else reading response. The first keeps every existing template working.

The other way out is to deprecate op.#HTTPDo and its aliases properly in favour of vela/http (http.#HTTPDo), which works today: move chat-gpt across, and update the docs, whose "Deprecated Operations" section currently tells people to use op.#HTTPPost. Nothing marks vela/op as legacy to a user at the moment.

Open PR #340 edits the same legacy/http/http.cue (more methods, #HTTPPatch/#HTTPHead/#HTTPOptions) and keeps the response shape; its test calls Do() directly, so it doesn't see this.

kubevela's docs/examples/workflow/Li-Auto-Inc/workflow-step-definitions.yaml:96 (op.#HTTPPost) is broken the same way.

Activity

  1. added
    type/bug
    priority/important-soon
    on Nov 26, 2026
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

    area/providerpriority/important-soontype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions