|
| 1 | +--- |
| 2 | +title: Conductor Workflow Orchestration |
| 3 | +sidebar_position: 2 |
| 4 | +--- |
| 5 | +## Conductor |
| 6 | + |
| 7 | +:::important |
| 8 | +Conductor will be replaced with Oracle Transaction Manager for Microservices, which will include the Conductor Server as a component of the product |
| 9 | +::: |
| 10 | + |
| 11 | +Conductor is a workflow orchestration platform, originally developed at Netflix, designed to coordinate long-running, distributed workflows across microservices by defining tasks, dependencies, and retries, while providing scalability, fault tolerance, and operational visibility through a centralized engine. |
| 12 | + |
| 13 | +[Conductor OSS Documentation](https://docs.conductor-oss.org) |
| 14 | + |
| 15 | +### Installing Conductor |
| 16 | + |
| 17 | +Conductor will be installed if the `conductor-server.enabled` is set to `true` in the `values.yaml` file. The default namespace for Conductor is `conductor-server`. |
| 18 | + |
| 19 | +### API Specification |
| 20 | + |
| 21 | +[API Specification](https://docs.conductor-oss.org/documentation/api/index.html) |
| 22 | + |
| 23 | +### Accessing Conductor APIs |
| 24 | + |
| 25 | +To access the Conductor APIs, use kubectl port-forward to create a secure channel to `service/conductor-server`. Run the following command to establish the secure tunnel (replace the example namespace `obaas-dev` with the namespace where the Conductor Server is deployed): |
| 26 | + |
| 27 | +```shell |
| 28 | +kubectl port-forward -n obaas-dev svc/conductor-server 8080 |
| 29 | +``` |
| 30 | + |
| 31 | +### Testing the Conductor service |
| 32 | + |
| 33 | +You can test the Conductor service by running the sample workflow provided. Save the content into a file called `first_simple_workflow.json` and then execute the following command: |
| 34 | + |
| 35 | +```shell |
| 36 | +curl -X POST 'http://localhost:8080/api/metadata/workflow' \ |
| 37 | +-H 'Content-Type: application/json' \ |
| 38 | +-d @first_sample_workflow.json |
| 39 | +``` |
| 40 | + |
| 41 | +```json |
| 42 | + |
| 43 | + { |
| 44 | + "name": "first_sample_workflow", |
| 45 | + "description": "First Sample Workflow", |
| 46 | + "version": 1, |
| 47 | + "tasks": [ |
| 48 | + { |
| 49 | + "name": "get_population_data", |
| 50 | + "taskReferenceName": "get_population_data", |
| 51 | + "inputParameters": { |
| 52 | + "http_request": { |
| 53 | + "uri": "https://restcountries.com/v3.1/name/united%20states?fields=name,population", |
| 54 | + "method": "GET" |
| 55 | + } |
| 56 | + }, |
| 57 | + "type": "HTTP" |
| 58 | + } |
| 59 | + ], |
| 60 | + "inputParameters": [], |
| 61 | + "outputParameters": { |
| 62 | + "data": "${get_population_data.output.response.body.data}", |
| 63 | + "source": "${get_population_data.output.response.body.source}" |
| 64 | + }, |
| 65 | + "schemaVersion": 2, |
| 66 | + "restartable": true, |
| 67 | + "workflowStatusListenerEnabled": false, |
| 68 | + "ownerEmail": "[email protected]", |
| 69 | + "timeoutPolicy": "ALERT_ONLY", |
| 70 | + "timeoutSeconds": 0 |
| 71 | + } |
| 72 | + |
| 73 | +``` |
| 74 | + |
| 75 | +Execute the workflow by using this command and capture the Workflow ID: |
| 76 | + |
| 77 | +```shell |
| 78 | +WORKFLOW_ID=$(curl -s -X POST 'http://localhost:8080/api/workflow/first_sample_workflow' \ |
| 79 | +-H 'Content-Type: application/json' \ |
| 80 | +-d '{}' | tr -d '"') |
| 81 | +``` |
| 82 | + |
| 83 | +Check the Workflow IS, should return a string similar to this `46cbbaef-7133-451b-9334-2ccfc4e270c5` |
| 84 | + |
| 85 | +```shell |
| 86 | +echo "Workflow ID: $WORKFLOW_ID" |
| 87 | +``` |
| 88 | + |
| 89 | +Check status of the Workflow, will return the data from https://restcountries.com/v3.1/name/united%20states?fields=name,population. |
| 90 | + |
| 91 | +```shell |
| 92 | +curl -s -X GET "http://localhost:8080/api/workflow/$WORKFLOW_ID" | jq |
| 93 | +``` |
0 commit comments