Skip to content

Add query parameters to workflow input#1227

Open
siva-sai-udaygiri wants to merge 1 commit into
conductor-oss:mainfrom
siva-sai-udaygiri:issue-961-query-params
Open

Add query parameters to workflow input#1227
siva-sai-udaygiri wants to merge 1 commit into
conductor-oss:mainfrom
siva-sai-udaygiri:issue-961-query-params

Conversation

@siva-sai-udaygiri

Copy link
Copy Markdown

This PR fixes the start workflow API so query parameters passed in the request URL are added to the workflow input.

Before this change, a request like:

POST /api/workflow?url_param=1234

with body input:

{
  "name": "test_workflow",
  "input": {
    "first": "xyz"
  }
}

would start the workflow with only the body input:

{
  "first": "xyz"
}

Because of that, ${workflow.input.url_param} was not available during workflow execution.

With this change, query parameters are merged into StartWorkflowRequest.input before the workflow is started, so the workflow input becomes:

{
  "first": "xyz",
  "url_param": "1234"
}

The implementation also handles cases where the request input is null by creating an input map before adding query parameters.

Added a unit test to verify that the controller passes the updated StartWorkflowRequest to WorkflowService with both the original body input and query parameter values included.

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.

2 participants