Camunda 8 - OpenAI Connectors

Hello everyone,

I’m currently in the process of learning how to use connectors. I’ve been attempting to interact with ChatGPT, and I’m receiving responses from ChatGPT as well. However, I’m facing an issue where I want to store the exact responses from ChatGPT in variables, but I’m currently getting results like the following. Could you please assist me with this?


Hi @Nagarajan_Rajendran, welcome to the forums! That result is a pretty standard ChatGPT response object. The question is really what do you want to do with the response?

Camunda 8 uses FEEL to parse data. For instance, if you want to get the content value from the response object, you would set the “Result Expression” to something like:

={
  "answer": response.body.choices[1].message.content
}

You can read more about how result variables and expressions work here: Using Connectors | Camunda Platform 8 Docs

1 Like

Hello Nathan,

I appreciate your response. I’m wondering if it’s feasible to modify the reply from an object to a boolean. My aim is to receive a true or false value from the ChatGPT response. This way, I can pass the variable through the gateway to the next task.

@Nagarajan_Rajendran - depending on the question being asked, that could get difficult, because ChatGPT typically doesn’t reply in a true/false way. One option might be to engineer the prompt in such a way that it gets you a boolean response. I haven’t tested this, but the first thing I would try is something like:

="Answer with TRUE or FALSE. Can you answer this question? " + questionFromUser

Hopefully that would get ChatGPT to respond with a boolean value, but it wouldn’t contain the answer itself. For instance, from the screenshots you shared, you wouldn’t get the answer of 10.

What I’m driving at is that manipulating the response from ChatGPT isn’t a problem solved by Camunda, but rather something you’d need to do some prompt engineering (and possibly more) to fix. This is due to the way ChatGPT and the OpenAI API works. Hopefully that makes sense!

1 Like

Thank you Nathan

It’s true that getting ChatGPT to respond with a simple true/false answer can be challenging, as it typically generates more context-rich responses.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.