Skip to content

Commit

Permalink
Merge pull request #725 from RizaFarheen/main
Browse files Browse the repository at this point in the history
Doc Update - Debugging Workflows
  • Loading branch information
nhandt2021 committed Jul 15, 2024
2 parents 8137c44 + 2e53350 commit e60dd8d
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 24 deletions.
60 changes: 36 additions & 24 deletions docs/developer-guides/debugging-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,71 @@ import Install from '@site/src/components/install.mdx';

# Debugging Workflows

Orkes Conductor provides a visual representation of workflows that aids in quickly troubleshooting issues. Conductor UI provides you with the ability to look into workflow executions, which helps quickly spot and resolve issues.
Orkes Conductor provides a visual representation of workflows that aids in quickly troubleshooting issues. The Conductor UI allows users to inspect workflow executions, facilitating rapid identification and resolution of problems.

## Searching/Viewing Workflow Executions
## Searching and Viewing Workflow Executions

All recent workflow executions are listed on the **Executions > Workflow** page. This view is filtered by the user's permissions by default, i.e., users can view the execution of only the permitted workflows.
All recent workflow executions are listed on the **Executions > Workflow** page. By default, users can only view executions of permitted workflows.

<p align="center"><img src="/content/img/workflow-executions.png" alt="Workflow Executions page" width="90%"
height="auto"/></p>

The workflow execution data can be filtered by searching through workflow name, workflow ID, correlation ID, idempotency key, status, time period, and free text search. Click on the required execution to view the individual execution of a workflow.
The workflow execution data can be filtered by searching through workflow name, workflow ID, correlation ID, idempotency key, status, time period, and free text search. Turn on **SQL format** to view the workflow execution data in SQL format.

In addition, you can view the workflow execution as code directly from the UI. To do this, click the arrow in the Search button and choose “**Show as code**.
Additionally, you can view the workflow execution as code directly from the UI by clicking the arrow in the Search button and selecting **Show as code**.

<p align="center"><img src="/content/img/show-as-code-in-workflow-search.png" alt="Show as code option in Workflow Search" width="90%"
height="auto"/></p>

This would show the workflow search data in different codes. Currently, you can get them in cURL and Javascript.
This would show the workflow search data in different codes. You can get the workflow search data in cURL and Javascript formats.


<p align="center"><img src="/content/img/workflow-search-in-code.png" alt="Workflow search data in code" width="90%"
height="auto"/></p>

:::note
You can also search for workflow names by inputting partial values with wildcards (*) support. For example, if you want to search for workflow names containing “test”, then search for **test***, which will display all the workflow definitions with **‘test’** in their name.
Partial searches using wildcards `*` are supported for workflow names. For example, searching for **test*** will display all workflows with names containing "test".

<p align="center"><img src="/content/img/workflow-partial-search.png" alt="Workflow search with wildcard support"
width="90%" height="auto"/></p>
:::

A sample execution looks like this:
### Viewing Individual Workflow Execution

Click on a specific execution to view detailed information. A sample execution looks like this:

<p align="center"><img src="/content/img/sample-workflow-execution.png" alt="Sample Workflow Executions page"
width="90%" height="auto"/></p>

The page consists of the following sub-tabs:

* **Diagram** - Shows the visual representation of the workflow. If the workflow isn’t completed/failed, the diagram indicates the same.
* **Task List** - Includes the details of the tasks within the workflow.
* **Timeline** - A timeline showing the time taken by different tasks for execution. You can also zoom around the task timeline for more accuracy.
* **Summary** - Includes the workflow details such as workflow ID, status, version, start/end time, and duration.
* **Workflow Input/Output** - Shows the list of the inputs and outputs of the workflow.
* **JSON** - Include the complete JSON of the workflow.
* **Diagram** - Visual representation of the workflow's status; tasks are color-coded (green for successful, red for failed, orange for completed with errors).
* **Task List** - Details of tasks within the workflow.
* **Timeline** - Chronological timeline of task execution times, with zoom functionality for accuracy.
* **Summary** - Includes key details such as workflow ID, status, version, start/end time, and duration.
* **Workflow Input/Output** - Lists inputs and outputs of the workflow.
* **JSON** - Complete JSON representation of the workflow.
* **Variables** - Displays variables passed using the set variable task.
* **Task To Domain** - Mapping of tasks to domains used in the workflow execution.

Each of these tabs gives the details that can help debug workflow issues.

## Debugging Executions

The diagram tab on the workflow execution page shows the workflow diagram. All the successful tasks appear in green, failed ones appear in red, and the ones completed with errors appear in orange.
The **Diagram** tab on the workflow execution page visually represents task statuses:

<p align="center"><img src="/content/img/types-of-errors.png" alt="Different types of errors in a failed workflow"
width="80%" height="auto"/></p>

* Green: Successful tasks
* Red: Failed tasks
* Orange: Tasks completed with errors


:::tip
A task ends up with the status “Completed with Errors” only when it is marked as __optional:true__ in the workflow definition. The default value of this setting is false, so it needs to be explicitly set to continue the workflow even when there are errors.
:::

<p align="center"><img src="/content/img/types-of-errors.png" alt="Different types of errors in a failed workflow"
width="80%" height="auto"/></p>

Clicking on the failed task gives the failure details. The following fields are helpful in debugging:

Expand All @@ -72,22 +84,22 @@ Clicking on the failed task gives the failure details. The following fields are

Here is a screen grab of the fields referred above.

<p align="center"><img src="/content/img/failure-reasons-of-task.jpeg" alt="Failure reasons for the task" width="100%" height="auto"></img></p>
<p align="center"><img src="/content/img/failure-reasons-of-task.png" alt="Failure reasons for the task" width="100%" height="auto"></img></p>

## Recovering From Failures​

Once the issues are resolved for the workflow execution failure, you might want to retry the failed workflows. The **Actions** button towards the top-right corner of the execution page provides the following options:
Once the issues regarding the workflow execution failure are resolved, you can retry the failed workflows. The **Actions** button towards the top-right corner of the execution page provides the following options:

<p align="center"><img src="/content/img/workflow-recovery.png" alt="Workflow Recovery Options" width="80%" height="auto"></img></p>

| Action | Description |
| ------ |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Terminate | Terminates the workflow and changes the workflow status to **TERMINATED**. |
| Restart with Current Definitions | Restart the workflow from the beginning using the same version of the workflow definition that originally ran this execution. This is useful if the workflow definition has changed and you want to retain this instance in the original version. |
| Restart with Latest Definitions | Restart this workflow from the beginning using the latest definition of the workflow. If you've made changes to the definition, you could use this option to re-run the flow with the latest version. |
| Retry - From failed task | Retries the workflow from the failed task. |
| Re-run Workflow | Clicking on this takes us to the **Run Workflow** page, where you can rerun the workflow. While running, you can change the workflow input parameters and task to domain mapping. |
| Restart with current definitions | Restart the workflow from the beginning using the same version of the workflow definition that originally ran this execution. This is useful if the workflow definition has changed and you want to retain this instance of the original version. |
| Restart with latest definitions | Restart this workflow from the beginning using the latest definition of the workflow. If you've made changes to the definition, you could use this option to re-run the flow with the latest version. |
| Retry - from failed task | Retries the workflow from the failed task. |
| Re-run Workflow | Clicking on this takes to the **Run Workflow** page, where you can rerun the workflow. While running, you can change the workflow input parameters, idempotency key, correlation ID, and task to domain mapping. |

:::tip
Orkes Conductor has native [retry and error handling](https://orkes.io/content/error-handling) capabilities, allowing your task to be retried automatically for transient failures.
Check out the documentation on native [retry and error handling](https://orkes.io/content/error-handling) features, which enable tasks to be automatically retried in the event of transient failures.
:::
Binary file added static/img/failure-reasons-of-task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/show-as-code-in-workflow-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/workflow-executions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/workflow-partial-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/workflow-recovery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/workflow-search-in-code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e60dd8d

Please sign in to comment.