# YAML Syntax Description

## Related Concepts

Job is the basic unit of the Action workflow. A [DAG](https://en.wikipedia.org/wiki/Directed_acyclic_graph) is generated by defining multiple jobs and setting the dependencies of the jobs. The TensorBay workflow engine can automate tasks by executing DAGs. Set the following YAML file as an example.

![](/files/-MhX2C_dhXqrINAy7JAy)

1. &#x20;\[tasks]: Define all the jobs under this workflow.
2. &#x20;\[tasks.hello-world]: Defines a task, with the name "hello-world".
3. &#x20;\[tasks.hello-world.container]: This job is executed under the docker container.
4. \[tasks.hello-world.container.image]: The image used by the docker container is alpine:latest.
5. &#x20;\[tasks.hello-world.container.command]: The command executed in the docker container is 991\`called echo.
6. \[tasks.hello-world.container.args]: The argument to echo is "hello world".

## Runtime Environment of Job

Job supports the following three runtime environments. Each job has only one runtime environment.

**1. Container**

In this environment you can use a specified image to generate a container and execute it.The job content will be defined by the image.

![](/files/-MhllnSpT7CfaGvCjdAe)

**2. Script**

In this environment, a specified script wil be excuted in the docker container.

![](/files/-MhX2Uj-DskoLHQtzko-)

&#x20;**3. Git**

In this environment, a git repo code will be executed inside the docker container.

![](/files/-MhX2b-Y2H7sKEfGk9lh)

## Job Dependencies

**Dependencies**

Jobs can define their dependencies by keywords.

![](/files/-MhX2qkVdKXdzefuhTCb)

**Flowchart**

A diamond-shaped DAG. Task A executes first, then task B and task C conduct simultaneously. Task D only starts to run when task B and task C are finished.

![](/files/-MhX2vkUwqy72p9F0gsX)

## Parameters Setting of Job&#x20;

### Attributes of Parameters

#### **Name**

The name of a parameter, which is used to refer to the parameter in the code of a workflow.

#### **Type**

The type of a parameter. The following three types of parameters are supported in Actions now.

* String: string
* Number: number, including integers and floating-point numbers
* Boolean: boolean value, true/false

#### **Default**

The default value of a parameter. If the default value is not specified at the beginning, the system will automatically use a preset default value.

### Definition of Parameters

Support to view and set the detailed parameters on the parameter details page.

![](/files/-MhXdWRR0XZtgNIR3DAS)

### Parameters Setting

**Manual Parameters Setting**: If a workflow is started manually, then its values can be set via the TensorBay console.

**Automatic Parameters Setting**: If a workflow is started automatically, then the system will use default values.

![](/files/-MhXc6lmzyPLqBiv29T3)

### How to Quote Parameters

You can quote a parameter in workflow with its name.

![](/files/-MhX9HFBmnXa4F3Pb7ew)

{% hint style="info" %}

1. The parameter to be quoted must be within {{}}.
2. The parameter name must start with **workflow\.parameters**.
3. The parameter name must be the same as **the preset one**.
   {% endhint %}

### Environment Settings of Jobs

**Environment** defines the environment variables of the **container**, which can be quoted in the same way as the environment variables of the normal **docker container**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.graviti.com/guide/tensorbay/action/yaml-syntax-description.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
