Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add create workflow #1488

Merged
merged 5 commits into from
Jul 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions docs-2.0/nebula-explorer/workflow/2.create-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Workflow example

This topic describes how to create a simple workflow.

## Prerequisites

- The data source is ready. The data source can be data in Nebula Graph or CSV files on HDFS.

- The [resource](1.prepare-resources.md) has been configured.

## Add workflow

With the result of the MATCH statement `MATCH (v1:player)--(v2) RETURN id(v1), id(v2);` as the input of the PageRank algorithm, the following will introduce how to create a simple workflow.

1. At the top of the Explorer page, click **Workflow**.

2. In the **Workflows** tab, click **New workflow** to enter the process canvas page.

3. In the component library list on the left side of the process canvas page, select **Query**->**Query** and drag it onto the canvas. Click the graph query component and set the following parameters in the configuration panel on the right side.

![query-component](https://docs-cdn.nebula-graph.com.cn/figures/ex-query-220623-en.png)

|Parameters|Description|
|:---|:---|
|Query|Click ![pencil](https://docs-cdn.nebula-graph.com.cn/figures/workflow-edit.png) to modify the component name to identify the component.|
|Input| Set custom parameters that can be used for parameterized query. Click **Add parameter** to add more custom parameters. |
|Query language| Select the graph space to execute the nGQL statement and fill in the nGQL statement. Click **Parse Parameter** to display the returned column name in the **Output**.|
|Output| The column name returned by parsing the query language. You can change the name, which is equivalent to aliasing the column with `AS`.|
|Results| Set the saving project of the result. To call the results expediently for other algorithms, the results of the graph query component can only be saved in the HDFS.|

!!! note

The connection anchors are shown in yellow, indicating that it is optional and can be set by user or provided by any other component.

4. In the component library list on the left side of the process canvas page, select **Node importance**->**PageRank** and drag it onto the canvas. Connect the anchor `output0` to the anchor `input0` and the anchor `output1` to the anchor `input1`.

![connect-component](https://docs-cdn.nebula-graph.com.cn/figures/ex-connect-220623-cn.png)

5. Click the graph computing component and set the following parameters in the configuration panel on the right side.

![connect-component](https://docs-cdn.nebula-graph.com.cn/figures/ex-algorithm-220623-en.png)

|Parameters|Description|
|:---|:---|
|PageRank|Click ![pencil](https://docs-cdn.nebula-graph.com.cn/figures/workflow-edit.png) to modify the component name to identify the component.|
|Input| Three data sources are supported as input. <br>**Nebula Graph**: Users must select the graph space and corresponding edge types.<br>**Dependence**: The system will automatically recognize the data source according to the connection of the anchor.<br>**HDFS**: Users must select HDFS and fill in the relative path of the data source file.|
cooper-lzy marked this conversation as resolved.
Show resolved Hide resolved
|Parameter settings| Set the parameters of the graph algorithm. The parameters of different algorithms are different. Some parameters can be obtained from any upstream component where the anchor are shown in yellow.|
|Output| Display the column name of the graph computing results. The name can not be modified.|
|Execution settings| **Machine num**: The number of machines executing the algorithm.<br>**Processes**: The total number of processes executing the algorithm. Allocate these processes equally to each machine based on the number of machines.<br>**Threads**: How many threads are started per process.|
|Results| Set the result saved in HDFS or Nebula Graph.<br>**HDFS**: The save path is automatically generated based on the job and task ID.<br>**Nebula Graph**: Tags need to be created beforehand in the corresponding graph space to store the results. For more information about the properties of the tag, see [Algorithm overview](../../graph-computing/algorithm-description.md).<br>Some algorithms can only be saved in the HDFS.|
cooper-lzy marked this conversation as resolved.
Show resolved Hide resolved

6. Click ![pencil](https://docs-cdn.nebula-graph.com.cn/figures/workflow-edit.png) next to the automatically generated workflow name at the upper left corner of the canvas page to modify the workflow name, and click **Run** at the upper right corner of the canvas page. The job page is automatically displayed to show the job progress. You can view the result after the job is completed. For details, see [Job management](4.jobs-management.md).
cooper-lzy marked this conversation as resolved.
Show resolved Hide resolved

!!! note

When you click **Run**, the workflow will be automatically saved. If you do not perform graph computing and only modify, click ![save](https://docs-cdn.nebula-graph.com.cn/figures/workflow-save-220623.png) to save the modification, or click ![save](https://docs-cdn.nebula-graph.com.cn/figures/workflow-saveAs-220623.png) to save the workflow as a new workflow.
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved