Create a workflow using Data Orchestrator
Before you start
To complete the following actions, you must have:
- A Scaleway account logged into the console (External link)
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A Container Registry namespace
- An image pushed to your namespace (for task execution)
- Created at least 3 Serverless Jobs
- Basic familiarity with YAML syntax
- Basic familiarity with the Open Workflow Specification (External link)
Create a Data Orchestrator workflow using the Scaleway console
The following section explains how to create a workflow using the Scaleway console in Graph view. If you want to create a workflow using a workflow definition file, skip to Create a workflow using a workflow definition.
Create the workflow
- In the Scaleway console (External link) side menu, go to Data & Analytics > Data Orchestrator. The list of your workflows appears.
- Click Create workflow. The Data Orchestrator workflow creation wizard opens.
- Select the region for your workflow.
- Enter a name or use the automatically generated one.
- (Optional) Enter a description.
- Click Create workflow only to finish, or click Create workflow and add tasks to add tasks or upload a workflow definition file next.
Add tasks to the workflow
After creating a workflow, you can use the Scaleway console to create tasks manually or upload a workflow definition file.
The following procedure explains how to create a sequential workflow with 3 Serverless Jobs using the Scaleway console in Graph view.
- Click Create workflow and add tasks at the end of the workflow creation, or click Edit in the Overview tab of an existing workflow.
- Click Choose a job to create the first task. The Graph view opens with an empty job task created.
- Click the empty job task, then:
- Select the region of the job.
- Select the job you want to use.
If the job does not exist yet, click Create job to open the Serverless Jobs creation wizard in a new tab. After you have created the job, click Refresh list to make it appear.
- In the tasks menu on the left, click Serverless Jobs to create a new empty job task. Note that a new task always appears to the right of all other tasks.
- Click the new task and select the second job.
- Repeat the previous step to create a third Serverless Job.
- Drag the connector on the right side of the first task to the connector on the left side of the second task to link them.
- Repeat the previous step to link the second and third tasks.
- Click Save changes to finish, or click Save and run to save the workflow and run it immediately.
Graph view validation rules
The Graph view is designed to run tasks from left to right. Drag and drop the tasks to arrange them in the order that suits you best. Graph view is a visual representation of the code view, thus it is still limited by the rules of the Open Workflow Specification.
You can save a workflow when:
- All created tasks have a corresponding Serverless Job. An empty task is not valid.
- All created tasks are linked together in a sequential flow. A workflow with an unused or isolated task is not valid.
- The workflow has one first task and one final task. A loop is not valid.
Create a workflow using a workflow definition
You can upload a YAML file to use more complex workflows in Data Orchestrator.
Create a workflow definition YAML file
This is a basic example of a sequential workflow using 3 Serverless Jobs. For information on other tasks and concepts, see Action tasks, Logic tasks, or the full Data Orchestrator DSL Reference.
See Workflow schema to download the Data Orchestrator workflow schema to help you create your workflow definition file.
-
Create a YAML file, copy and paste the following content into the file.
Replace the placeholders with the appropriate values. Thenamespaceandnamefields are required, and can be used as metadata to help organize YAML files. Copy Serverless Job IDs from the Serverless Jobs page (External link) of the console.document: dsl: 1.0.3 namespace: <NAMESPACE_NAME> name: <WORKFLOW_NAME> version: 1.0.0 do: - task1: call: "serverless_job" metadata: description: "The first job" with: id: "<SERVERLESS_JOB1_ID>" region: "<REGION>" - task2: call: "serverless_job" metadata: description: "The second job" with: id: "<SERVERLESS_JOB2_ID>" region: "<REGION>" - task3: call: "serverless_job" metadata: description: "The third job" with: id: "<SERVERLESS_JOB3_ID>" region: "<REGION>" -
Save the YAML file.
Create the workflow
- In the Scaleway console (External link) side menu, go to Data & Analytics > Data Orchestrator. The list of your workflows appears.
- Click Create workflow. The Data Orchestrator workflow creation wizard opens.
- Select the region for your workflow.
- Enter a name or use the automatically generated one.
- (Optional) Enter a description.
- Click Create workflow only to finish, or click Create workflow and add tasks to add tasks or upload a workflow definition file next.
Upload the workflow definition
The workflow upload window opens when you finish creating a workflow, or when you click Edit in the Overview tab of an existing workflow.
- Click Upload.
- Select the YAML file to use as the workflow definition.
- Click Save changes to finish, or click Save and run if you want to save and run the workflow.
Run a workflow
- In the Scaleway console (External link) side menu, go to Data & Analytics > Data Orchestrator. The list of your workflows appears.
- Click the name of the workflow you want to run. The workflow Overview tab opens.
- Click the Actions button, then click Run in the drop-down menu. Your workflow starts, and a new entry appears in the Runs tab.