conductor icon indicating copy to clipboard operation
conductor copied to clipboard

HTTP Task of type POST doesn't get body from request

Open LiranBri opened this issue 8 years ago • 3 comments

Hi, I created a simple HTTP Task of type POST which passes the workflow's input as the body param. When I trigger the workflow, Conductor does call the endpoint, but it doesn't pass the body.

I suspect that this is a bug, but if not I would appreciate your help understanding what am I missing.

In the conductor UI, I can see that the Task input looks good:

{
  "http_request": {
    "uri": "http://localhost:4800/date-to-year",
    "method": "POST",
    "contentType": "application/json",
    "body": {
      "date": "1800-01-01"
    }
  }
}

workflow definition:

{
  "name": "liran-date-to-year-rest-post",
  "description": "Gets date and returns year from it",
  "tasks": [
	{
      "name": "liran-task",
      "taskReferenceName": "liran-task",
      "inputParameters": {
		  "http_request": {
		    "uri": "http://localhost:4800/date-to-year",
		    "method": "POST",
    		"contentType": "application/json",
    		"body": "${workflow.input}"
		  }
      },
      "type": "HTTP"
	}
  ],
  "outputParameters": {
    "finalYear": "${liran-task.output.response.body.year}"
  },
  "schemaVersion": 2
}

execution example: curl -X POST
http://localhost:8080/api/workflow/liran-date-to-year-rest-post
-H 'Content-Type: application/json'
-d '{"date": "1800-01-01"}'

I also tried to define the workflow with constant body

"inputParameters": {
  "http_request": {
    "uri": "http://localhost:4800/date-to-year",
    "method": "POST",
	"contentType": "application/json",
	"body": {"date": "2000-01-01"}
  }

just for the test to see if my endpoint gets the body.. but still it didn't thank you!

LiranBri avatar Jul 23 '18 07:07 LiranBri

Can you let me know where did you configure your workflow definition, so that the conductor server will instantiate?

dileepkeely avatar Aug 04 '18 17:08 dileepkeely

Sorry, I didn't understand your question.. What do you mean by "where"?

On Sat, Aug 4, 2018, 20:01 dileepkeely [email protected] wrote:

Can you let me know where did you configure your workflow definition, so that the conductor server will instantiate?

— You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub https://github.com/Netflix/conductor/issues/673#issuecomment-410463174, or mute the thread https://github.com/notifications/unsubscribe-auth/ACx0Kg8kGBBJ5T-3ca-D9KvqeSa7WzN8ks5uNdOCgaJpZM4Vaesj .

--

Sent from my phone

LiranBri avatar Aug 04 '18 17:08 LiranBri

I am facing same issue in v2.25.9, any suggestion would be great.

SanjayaKumarSahoo avatar Apr 19 '20 05:04 SanjayaKumarSahoo