Using ChatGPT to create Conductor Workflows

Riza Farheen
Developer Advocate
February 24, 2023
Reading Time: 5 mins

ChatGPT from OpenAI has been an internet sensation for the past few months. ChatGPT is an AI-based chatbot that can generate human-like outputs based on its trained data.

By now, most of you might have already tried ChatGPT for your personal or business needs or just to get acquainted with the tool. Our team at Orkes, too, gave a hands-on approach to demonstrate how effectively ChatGPT can be utilized for creating Conductor workflows.

Let’s take a look at how our trial progressed!

Conductor Workflows using ChatGPT

We gave an initial shot at creating a Conductor Workflow to calculate the sum of two numbers and return the value. Here’s our first attempt result:

Initially, the workflow was generated in YAML format, but we required it in JSON format.

As you can see, it’s not perfect, with certain parameters being missed. So, we just copied the code to Orkes Developer Edition: a free tool from Orkes, to visualize the accuracy. And here are the problems found.

So I input these errors into ChatGPT’s interface itself.

It looks like those two errors were fixed, and one of the existing parameters, “version”, was removed. So I continued the conversation with the error message I received on this.

So now the workflow was almost accurate with the input parameters to the workflow, num1, and num2 not defined in the workflow input. However, this is an optional thing to be added to the workflow definition, but you do need to pass it while running the workflow.

So, I stopped my trial workflow at this point and manually added the missing input parameters to the workflow.



Ta-da🥳! The workflow is ready now!

The next step is to set up the worker for this. Let’s take Java worker as an example and see what ChatGPT offers for the worker setup.

Not so perfect because a few things are missing. A complete working sample of the worker would look like this.

package io.orkes.samples;
import com.netflix.conductor.client.worker.Worker;
import com.netflix.conductor.common.metadata.tasks.Task;
import com.netflix.conductor.common.metadata.tasks.TaskResult;
import com.netflix.conductor.common.metadata.tasks.TaskResult.Status;
import org.springframework.stereotype.Component;


@Component
public class SumWorker implements Worker {


   private static final String TASK_DEF_NAME = "sum_task";

   @Override
   public String getTaskDefName() {
       return TASK_DEF_NAME;
   }


   @Override
   public TaskResult execute(Task task) {


       int num1 = Integer.parseInt(task.getInputData().get("num1").toString());
       int num2 = Integer.parseInt(task.getInputData().get("num2").toString());
       int result = num1 + num2;

       TaskResult taskResult = new TaskResult(task);
       taskResult.setStatus(Status.COMPLETED);
       taskResult.getOutputData().put("result", result);

       return taskResult;
   }
}

Things ChatGPT missed in Conductor Workflows

Now that we have the ChatGPT-generated Workers and Workflow ready (Although our manual intervention is there😉). There are a few things that ChatGPT didn’t mention throughout the trial, such as the workflow missing a few parameters, such as the task name and schema version. On repeated attempts, even some of the task type was also misinterpreted.

Additional ChatGPT generated Workflow Examples

We conducted a few more trials on several use cases, and here are the workflow definitions that ChatGPT has defined.

Note: We have not tested the above ChatGPT-generated workflows.

ChatGPT: Capabilities & Limitations

Taking our Conductor example using ChatGPT, it is clear that you cannot rely on an AI tool alone. ChatGPT being an AI model, has its own limitations too.

Code delivered in Seconds

It’s truly impressive that it helps in generating codes in a few seconds, which a developer may take hours to do. But it’s not a cent percent deliverable code. As in our case, you’ve witnessed that a manual interpretation of the code is required.

Outdated Model

The current version of ChatGPT is based on the 2021 data. We are in the first quarter of 2023 now, which makes certain discrepancies in the results it provides. Let’s wait and see what future updates can bring in.

Output Quality

The quality of the answers is not always the same. Throughout our trial process, we witnessed some ups and downs in the quality of the solutions provided. However, ChatGPT itself claims to learn and evolve with time.

Summing Up

As an AI-based model, ChatGPT has its own set of capabilities and limitations. Based on our trial, we have observed that while AI chatbots can be helpful in generating code samples, they may not always deliver complete solutions. However, you can leverage similar AI tools and make your work 10x faster, similar to how Conductor helps in building distributed applications 10x faster. 🚀

So have you tried ChatGPT yet? If not, try creating a few Conductor workflows and let us know your results.

Related Posts

Ready to build reliable applications 10x faster?