diff --git a/docs/how-tos/archival-of-workflows.md b/docs/how-tos/archival-of-workflows.md new file mode 100644 index 00000000..1ad6a80b --- /dev/null +++ b/docs/how-tos/archival-of-workflows.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Archival Of Workflows + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/build-a-golang-task-worker.md b/docs/how-tos/build-a-golang-task-worker.md new file mode 100644 index 00000000..1576bee3 --- /dev/null +++ b/docs/how-tos/build-a-golang-task-worker.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Build a GO Lang Task Worker + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/build-a-java-task-worker.md b/docs/how-tos/build-a-java-task-worker.md new file mode 100644 index 00000000..636b1908 --- /dev/null +++ b/docs/how-tos/build-a-java-task-worker.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Build a Java Task Worker + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/build-a-nodejs-task-worker.md b/docs/how-tos/build-a-nodejs-task-worker.md new file mode 100644 index 00000000..e9d66be1 --- /dev/null +++ b/docs/how-tos/build-a-nodejs-task-worker.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Build a Node.js Task Worker + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/build-a-python-task-worker.md b/docs/how-tos/build-a-python-task-worker.md new file mode 100644 index 00000000..60f0b090 --- /dev/null +++ b/docs/how-tos/build-a-python-task-worker.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Build a Python Task Worker + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/conductor-configurations.md b/docs/how-tos/conductor-configurations.md new file mode 100644 index 00000000..313ceca3 --- /dev/null +++ b/docs/how-tos/conductor-configurations.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Conductor Configurations + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/configuring-metrics.md b/docs/how-tos/configuring-metrics.md new file mode 100644 index 00000000..9accb72b --- /dev/null +++ b/docs/how-tos/configuring-metrics.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Configuring Metrics + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/golang-sdk.md b/docs/how-tos/golang-sdk.md new file mode 100644 index 00000000..d26f46cd --- /dev/null +++ b/docs/how-tos/golang-sdk.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Golang SDK + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/idempotency.md b/docs/how-tos/idempotency.md new file mode 100644 index 00000000..2c808699 --- /dev/null +++ b/docs/how-tos/idempotency.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Idempotency + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/java-sdk.md b/docs/how-tos/java-sdk.md new file mode 100644 index 00000000..b4295797 --- /dev/null +++ b/docs/how-tos/java-sdk.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Java SDK + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/maintaining-workflows.md b/docs/how-tos/maintaining-workflows.md new file mode 100644 index 00000000..a9014d8a --- /dev/null +++ b/docs/how-tos/maintaining-workflows.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Maintaining Workflows + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/nodejs-sdk.md b/docs/how-tos/nodejs-sdk.md new file mode 100644 index 00000000..3ab27f7d --- /dev/null +++ b/docs/how-tos/nodejs-sdk.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Nodejs SDK + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/python-sdk.md b/docs/how-tos/python-sdk.md new file mode 100644 index 00000000..bc26d3fb --- /dev/null +++ b/docs/how-tos/python-sdk.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Python SDK + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/retry-configurations.md b/docs/how-tos/retry-configurations.md new file mode 100644 index 00000000..2ed5b93c --- /dev/null +++ b/docs/how-tos/retry-configurations.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Retry Configurations + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/scaling-the-system.md b/docs/how-tos/scaling-the-system.md new file mode 100644 index 00000000..a15275c8 --- /dev/null +++ b/docs/how-tos/scaling-the-system.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Scaling the System + +TODO + +## Summary + +TODO diff --git a/docs/how-tos/timeouts.md b/docs/how-tos/timeouts.md new file mode 100644 index 00000000..6c455a43 --- /dev/null +++ b/docs/how-tos/timeouts.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Timeouts + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/do-while-task.md b/docs/reference-docs/do-while-task.md new file mode 100644 index 00000000..6a405171 --- /dev/null +++ b/docs/reference-docs/do-while-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Do While Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/dynamic-fork-task.md b/docs/reference-docs/dynamic-fork-task.md new file mode 100644 index 00000000..0b631279 --- /dev/null +++ b/docs/reference-docs/dynamic-fork-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Dynamic Fork Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/dynamic-task.md b/docs/reference-docs/dynamic-task.md new file mode 100644 index 00000000..8a712a62 --- /dev/null +++ b/docs/reference-docs/dynamic-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Dynamic Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/exclusive-join-task.md b/docs/reference-docs/exclusive-join-task.md new file mode 100644 index 00000000..3a9cd71b --- /dev/null +++ b/docs/reference-docs/exclusive-join-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Exclusive Join Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/fork-task.md b/docs/reference-docs/fork-task.md new file mode 100644 index 00000000..575c5175 --- /dev/null +++ b/docs/reference-docs/fork-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Fork Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/http-task.md b/docs/reference-docs/http-task.md new file mode 100644 index 00000000..51373118 --- /dev/null +++ b/docs/reference-docs/http-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Http Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/inline-task.md b/docs/reference-docs/inline-task.md new file mode 100644 index 00000000..601f2704 --- /dev/null +++ b/docs/reference-docs/inline-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Inline Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/join-task.md b/docs/reference-docs/join-task.md new file mode 100644 index 00000000..c128ca33 --- /dev/null +++ b/docs/reference-docs/join-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Join Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/json-jq-transform-task.md b/docs/reference-docs/json-jq-transform-task.md new file mode 100644 index 00000000..6689c4be --- /dev/null +++ b/docs/reference-docs/json-jq-transform-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Json JQ Transform Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/kafka-publish-task.md b/docs/reference-docs/kafka-publish-task.md new file mode 100644 index 00000000..33a9ffe7 --- /dev/null +++ b/docs/reference-docs/kafka-publish-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Kafka Publish Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/operators.md b/docs/reference-docs/operators.md new file mode 100644 index 00000000..c41ac391 --- /dev/null +++ b/docs/reference-docs/operators.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Operators + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/set-variable-task.md b/docs/reference-docs/set-variable-task.md new file mode 100644 index 00000000..faa50f6f --- /dev/null +++ b/docs/reference-docs/set-variable-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Set Variable Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/switch-task.md b/docs/reference-docs/switch-task.md new file mode 100644 index 00000000..edfe827d --- /dev/null +++ b/docs/reference-docs/switch-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Switch Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/system-tasks.md b/docs/reference-docs/system-tasks.md new file mode 100644 index 00000000..cd265a36 --- /dev/null +++ b/docs/reference-docs/system-tasks.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# System Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/tasks-and-workers.md b/docs/reference-docs/tasks-and-workers.md new file mode 100644 index 00000000..bf3d575b --- /dev/null +++ b/docs/reference-docs/tasks-and-workers.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Tasks and Workers + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/terminate-task.md b/docs/reference-docs/terminate-task.md new file mode 100644 index 00000000..defb14c6 --- /dev/null +++ b/docs/reference-docs/terminate-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Terminate Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/wait-task.md b/docs/reference-docs/wait-task.md new file mode 100644 index 00000000..ea1f6f1b --- /dev/null +++ b/docs/reference-docs/wait-task.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Wait Task + +TODO + +## Summary + +TODO diff --git a/docs/reference-docs/workflows.md b/docs/reference-docs/workflows.md new file mode 100644 index 00000000..7105b13b --- /dev/null +++ b/docs/reference-docs/workflows.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +--- + +# Workflows + +TODO + +## Summary + +TODO diff --git a/docs/system-tasks/dynamic-task.md b/docs/system-tasks/dynamic-task.md index 2591cd5d..59ea83d5 100644 --- a/docs/system-tasks/dynamic-task.md +++ b/docs/system-tasks/dynamic-task.md @@ -45,6 +45,140 @@ Following are the parameters - If the workflow is started with input parameter `dynamicTaskToExecute` value as `fedex_shipping_task`, Conductor will schedule `fedex_shipping_task` when scheduling this dynamic task. +### Sample Use Case : + +Suppose in a workflow, we have to take decision to ship the courier with the shipping +service providers on the basis of Post Code. + +Following task `shipping_info` generates an output on the basis of which decision would be +taken to run the next task. + +```json +{ + "name": "shipping_info", + "retryCount": 3, + "timeoutSeconds": 600, + "pollTimeoutSeconds": 1200, + "timeoutPolicy": "TIME_OUT_WF", + "retryLogic": "FIXED", + "retryDelaySeconds": 300, + "responseTimeoutSeconds": 300, + "concurrentExecLimit": 100, + "rateLimitFrequencyInSeconds": 60, + "ownerEmail":"abc@example.com", + "rateLimitPerFrequency": 1 +} +``` + +Following are the two worker tasks, one among them would execute on the basis of output generated +by the `shipping_info` task : + +```json +{ + "name": "ship_via_fedex", + "retryCount": 3, + "timeoutSeconds": 600, + "pollTimeoutSeconds": 1200, + "timeoutPolicy": "TIME_OUT_WF", + "retryLogic": "FIXED", + "retryDelaySeconds": 300, + "responseTimeoutSeconds": 300, + "concurrentExecLimit": 100, + "rateLimitFrequencyInSeconds": 60, + "ownerEmail":"abc@example.com", + "rateLimitPerFrequency": 2 +}, +{ + "name": "ship_via_ups", + "retryCount": 3, + "timeoutSeconds": 600, + "pollTimeoutSeconds": 1200, + "timeoutPolicy": "TIME_OUT_WF", + "retryLogic": "FIXED", + "retryDelaySeconds": 300, + "responseTimeoutSeconds": 300, + "concurrentExecLimit": 100, + "rateLimitFrequencyInSeconds": 60, + "ownerEmail":"abc@example.com", + "rateLimitPerFrequency": 2 +} +``` + + +We will create the Workflow with the following definition : + +```json +{ + "name": "Shipping_Flow", + "description": "Ships smartly on the basis of Shipping info", + "version": 1, + "tasks": [ + { + "name": "shipping_info", + "taskReferenceName": "shipping_info", + "inputParameters": { + }, + "type": "SIMPLE" + }, + { + "name": "shipping_task", + "taskReferenceName": "shipping_task", + "inputParameters": { + "taskToExecute": "${shipping_info.output.shipping_service}" + }, + "type": "DYNAMIC", + "dynamicTaskNameParam": "taskToExecute" + } + + ], + "restartable": true, + "ownerEmail":"abc@example.com", + "workflowStatusListenerEnabled": true, + "schemaVersion": 2 +} +``` + +Workflow is the created as shown in the below diagram. + + +![Conductor UI - Workflow Diagram](/img/tutorial/ShippingWorkflow.png) + + +Note : `shipping_task` is a `DYNAMIC` task and the `taskToExecute` parameter can be set +with input value provided while running the workflow or with the output of previous tasks. +Here, it is set to the output provided by the previous task i.e. +`${shipping_info.output.shipping_service}`. + +If the input value is provided while running the workflow it can be accessed by +`${workflow.input.shipping_service}`. + +```json +{ + "shipping_service": "ship_via_fedex" +} +``` + +We can see in the below example that on the basis of Post Code the shipping service is being +decided. + +```js reference +https://github.com/orkes-io/orkesworkers/blob/main/src/main/java/io/orkes/samples/workers/ShippingInfoWorker.java#L10-L29 +``` + +Based on given set of inputs i.e. Post Code starts with '9' hence, `ship_via_fedex` is executed - + +![Conductor UI - Workflow Run](/img/tutorial/ShippingWorkflowRunning.png) + +If the Post Code started with anything other than 9 `ship_via_ups` is executed - + +![Conductor UI - Workflow Run](/img/tutorial/ShippingWorkflowUPS.png) + +If the incorrect task name or the task that doesn't exist is provided then the workflow fails and +we get the error " Invalid task specified. Cannot find task by name in the task definitions ". + +If the null reference is provided in the task name then also the workflow fails and we get the +error " Cannot map a dynamic task based on the parameter and input. Parameter= taskToExecute, input= {taskToExecute=null} " + ### FAQs Example use case: @@ -53,7 +187,7 @@ Example use case: 2. When the workflow starts, based on the input parameter, we can decide which worker to run 3. Show example of both workers running 4. Show example of what happens when you try to run a task that doesn't exist - 1. Show what happens if we give a null reference + 1. Show what happens if we give a null reference Sample Use Case @@ -63,4 +197,3 @@ Sample Use Case 4. Start -> Read Shipping Info -> Run Dynamic Shipping Task -> End Add code, refer to the - diff --git a/sidebars.js b/sidebars.js index 34b2d7ec..0c7bd8db 100644 --- a/sidebars.js +++ b/sidebars.js @@ -38,6 +38,51 @@ module.exports = { 'how-tos/using-sub-workflows', ], }, + { + type: 'category', + label: 'Workers', + collapsed: false, + items: [ + 'how-tos/build-a-java-task-worker', + 'how-tos/build-a-python-task-worker', + 'how-tos/build-a-golang-task-worker', + 'how-tos/build-a-nodejs-task-worker', + ], + }, + { + type: 'category', + label: 'Client SDKs', + collapsed: false, + items: [ + 'how-tos/java-sdk', + 'how-tos/python-sdk', + 'how-tos/golang-sdk', + 'how-tos/nodejs-sdk', + ], + }, + { + type: 'category', + label: 'Best Practises', + collapsed: false, + items: [ + 'how-tos/maintaining-workflows', + 'how-tos/idempotency', + 'how-tos/retry-configurations', + 'how-tos/timeouts', + ], + }, + { + type: 'category', + label: 'Running in Production', + collapsed: false, + items: [ + 'how-tos/conductor-configurations', + 'how-tos/scaling-the-system', + 'how-tos/archival-of-workflows', + 'how-tos/configuring-metrics', + ], + }, + ], tutorialsSideBarV2: [ 'tutorials', @@ -71,8 +116,64 @@ module.exports = { ], }, ], + showcaseSideBar: [ - 'showcase' + 'showcase', + { + type:'category', + label:'Concepts', + collapsed:false, + items:[ + 'reference-docs/workflows', + 'reference-docs/tasks-and-workers', + 'reference-docs/operators', + 'reference-docs/system-tasks', + ], + }, + { + type:'category', + label:'System Tasks', + collapsed:false, + items:[ + 'reference-docs/http-task', + 'reference-docs/kafka-publish-task', + 'reference-docs/json-jq-transform-task', + 'reference-docs/set-variable-task', + ], + }, + { + type:'category', + label:'Operators', + collapsed:false, + items:[ + 'reference-docs/switch-task', + 'reference-docs/do-while-task', + 'reference-docs/fork-task', + 'reference-docs/dynamic-fork-task', + 'reference-docs/join-task', + 'reference-docs/exclusive-join-task', + 'reference-docs/wait-task', + 'reference-docs/dynamic-task', + 'reference-docs/inline-task', + 'reference-docs/terminate-task', + ], + }, + { + type:'category', + label:'Event Task', + collapsed:false, + items:[ + + ], + }, + { + type:'category', + label:'Sub Workflows', + collapsed:false, + items:[ + + ], + }, ], tutorialsSideBar: [ 'intro', @@ -84,7 +185,7 @@ module.exports = { 'installing-conductor/running-locally', 'installing-conductor/running-locally-docker', 'installing-conductor/running-locally-minikube', - 'installing-conductor/running-binaries' + 'installing-conductor/running-binaries', ], }, { @@ -94,10 +195,9 @@ module.exports = { items: [ 'running-workflows/running-first-workflow', 'running-workflows/running-first-worker', - 'running-workflows/running-workers-microservices' + 'running-workflows/running-workers-microservices', ], - } - , + }, { type: 'category', label: 'Running in Production', diff --git a/static/img/tutorial/ShippingWorkflow.png b/static/img/tutorial/ShippingWorkflow.png new file mode 100644 index 00000000..82aa43d9 Binary files /dev/null and b/static/img/tutorial/ShippingWorkflow.png differ diff --git a/static/img/tutorial/ShippingWorkflowRunning.png b/static/img/tutorial/ShippingWorkflowRunning.png new file mode 100644 index 00000000..8bdd6350 Binary files /dev/null and b/static/img/tutorial/ShippingWorkflowRunning.png differ diff --git a/static/img/tutorial/ShippingWorkflowUPS.png b/static/img/tutorial/ShippingWorkflowUPS.png new file mode 100644 index 00000000..68b5ea93 Binary files /dev/null and b/static/img/tutorial/ShippingWorkflowUPS.png differ