Skip to content

[Fix #1829] Support HTTP Call output property - #1839

Open
fjtirado wants to merge 2 commits into
open-workflow-specification:mainfrom
fjtirado:Fix_#1829
Open

fjtirado wants to merge 2 commits into
open-workflow-specification:mainfrom
fjtirado:Fix_#1829

Conversation

@fjtirado

Copy link
Copy Markdown
Collaborator

Fix #1829

Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Raw output can contain malformed HTTP status lines and body framing, misidentify the protocol version, and fail for custom model factories because it bypasses the byte-array conversion.

4 open issues
What changed in this PR

This PR addresses #1829 by adding HTTP call output selection, allowing workflows to access response headers and status alongside the body.

Changes:

  • Routes content, response, and raw output modes through the HTTP executor.
  • Extends response adapters and model factories to support full responses and binary output.
  • Adds a workflow sample and integration test for response headers.
File Description
impl/​test/​src/​test/​resources/​workflows-samples/​call-http-get-headers.yaml Adds a workflow using output: response.
impl/​test/​src/​test/​java/​org/​openworkflow/​sdk/​impl/​test/​HTTPWorkflowDefinitionTest.java Tests response headers and body content.
impl/​model/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​model/​jackson/​JacksonModelFactory.java Adds byte-array model conversion.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​http/​JakartaHttpResponse.java Exposes headers, content, and raw response output.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​WorkflowModelFactory.java Adds default Base64 conversion for byte arrays.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​WorkflowHttpResponse.java Expands the response interface for output modes.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​WorkflowHttpRequestHelper.java Implements output handlers and response serialization.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​DefaultHttpResponse.java Adapts the default client response to the expanded interface.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​http/​HttpExecutor.java Passes the selected output handler to request execution.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​http/​CallableTaskHttpExecutorBuilder.java Selects the handler from the HTTP output setting.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​DigestAuthProvider.java Removes a cast after header access becomes string-typed.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Raw HTTP output bypasses supported byte-array conversion, preserves chunked headers without chunk framing, and can misidentify HTTP/1.1 responses as HTTP/2.

4 open issues
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The response and raw output modes bypass HTTP status validation, while raw serialization retains chunked-transfer headers without chunk framing, breaking error handling and producing invalid HTTP messages.

5 open issues
2 resolved since last review

Review effort: Balanced

@fjtirado
fjtirado requested a review from mathecruz November 13, 2026 16:39
@fjtirado
fjtirado marked this pull request as draft November 13, 2026 17:57
@fjtirado
fjtirado force-pushed the Fix_#1829 branch 2 times, most recently from e135133 to 0a29160 Compare November 13, 2026 19:19
It also support http request & response additional content types

Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>
@fjtirado
fjtirado force-pushed the Fix_#1829 branch 2 times, most recently from 970dab5 to f54e8c0 Compare November 13, 2026 19:23
…er name

Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>
@fjtirado
fjtirado marked this pull request as ready for review November 13, 2026 19:54
Copilot AI balanced review requested due to automatic review settings November 13, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +102 to +103
return HttpRequest.BodyPublishers.ofString(
body.asText()
}

private WorkflowModel textContent() {
return application.modelFactory().from(new String(response.body()));
Comment on lines +28 to +29
} else {
return String.class;
return inferContentType();
}
})
.orElse(inferContentType());
}
}
return null;
candidate = candidate.trim().toLowerCase();
Comment on lines +117 to +120
return Entity.text(
model
.asText()
.orElse("Workflow model should support asText for content type " + contentType));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle HttpCall output property

3 participants