Use the result of a Service task as payload of another Service task

I have two service tasks, that they call rest APIs, I want the result of the first service task “log_path” be sent to the next service task? How can I define it’s payload? I set the Headers’ Content-Type as application/json and the payload as a text {“log_path”: ${log_url}} . log_url is the result of previous service task. There is no error in Camunda Server, but the data will not be sent to the rest API.
Could you please help me?

Thanks in advance.

Hey @Zahra,

Is there a reason why you use connectors? In general variable handling is easier if using External Tasks or Java Delegates. It is a cleaner solution for the code and also performance wise something to consider.

If you use connectors and you want hand back variables from a response. You need to parse the response body using the Spin library. Here is an example repo that addresses different ways of making REST calls from Camunda.

I hope that helps

1 Like