Skip to main content

Quickstart 2: Create Your First Workflow

Estimated time: 8min

In Conductor, workflow definitions are stored as JSON. These workflows can be created using a UI-based or code-based approach:

  • Visual workflow editor—Using the Conductor UI, define and execute your workflow visually.
  • Workflow as code—Using the Conductor SDKs, define and execute your workflow in your preferred language.

In this quickstart, you will use your preferred option to:

  • Create and register a workflow definition consisting of a system task, a custom task, and an operator.
  • Test run the workflow.

Create and register workflow

Follow along to build your first workflow, a conditional helloWorld flow that greets users based on their location.

Use the visual workflow editor in Conductor UI to create your helloWorld workflow.

To create a workflow:

  1. Log in to your Orkes cluster or the Orkes Developer Edition.
  2. In the left navigation menu, go to Definitions > Workflow.
  3. Select (+) Define workflow.

Screenshot of visual workflow editor in Orkes Conductor.

  1. Copy the JSON code below into the Code tab of the workflow builder.

    {
    "name": "helloWorld",
    "description": "Hello World workflow that greets a user. Uses a Switch task, HTTP task, and Simple task.",
    "version": 1,
    "tasks": [
    {
    "name": "get-user",
    "taskReferenceName": "get-user_ref",
    "inputParameters": {
    "uri": "https://randomuser.me/api/",
    "method": "GET",
    "accept": "application/json",
    "contentType": "application/json",
    "encode": true
    },
    "type": "HTTP"
    },
    {
    "name": "user-criteria",
    "taskReferenceName": "user-criteria_ref",
    "inputParameters": {
    "switchCaseValue": "${get-user_ref.output.response.body.results[0].location.country}"
    },
    "type": "SWITCH",
    "decisionCases": {
    "United States": [
    {
    "name": "myTask",
    "taskReferenceName": "myTask_ref",
    "inputParameters": {
    "name": "${get-user_ref.output.response.body.results[0].name.first}"
    },
    "type": "SIMPLE"
    }
    ]
    },
    "defaultCase": [],
    "evaluatorType": "value-param",
    "expression": "switchCaseValue"
    }
    ],
    "inputParameters": [],
    "outputParameters": {},
    "failureWorkflow": "",
    "schemaVersion": 2
    }
  2. To register the workflow, select Save > Confirm.

Your first workflow has been created!

Run workflow

Let’s give your first workflow a test run.

tip

Before running the workflow, make sure that your myTask worker is actively polling the Conductor server. Otherwise, go back and start your worker again.

Inside the workflow visual editor, go to the Run tab and select Run workflow.

Screenshot of the Run tab in the visual workflow editor in Orkes Conductor.

Done! To track the workflow progress, go to Executions > Workflow in the Conductor UI.

Now that you have gotten the hang of creating workflows, let’s discover the power of Conductor in monitoring and debugging workflow executions in the next quickstart.