docs/concepts/orchestration/yaml-spec.md
(flow-yaml-spec)=
file-code YAML specificationTo generate a YAML configuration from an Orchestration, use {meth}~jina.jaml.JAMLCompatible.save_config.
We provide a JSON Schema for your IDE to enable code completion, syntax validation, members listing and displaying help text.
Preferences -> JSON Schema mappings;Schema File or URL write https://schemas.jina.ai/schemas/latest.json; select JSON Schema Version 7;*.jaml or *.jina.yml or any suffix you commonly used for Jina-serve Flow's YAML.YAML Language Support by Red Hat;settings.json add:"yaml.schemas": {
"https://schemas.jina.ai/schemas/latest.json": ["/*.jina.yml", "/*.jaml"],
}
You can bind Schema to any file suffix you commonly used for Jina-serve Flow's YAML.
```yaml
jtype: Deployment
version: '1'
with:
protocol: http
name: firstexec
uses:
jtype: MyExec
py_modules:
- executor.py
```
```yaml
jtype: Flow
version: '1'
with:
protocol: http
executors:
# inline Executor YAML
- name: firstexec
uses:
jtype: MyExec
py_modules:
- executor.py
# reference to Executor YAML
- name: secondexec
uses: indexer.yml
workspace: /home/my/workspace
# reference to Executor Python class
- name: thirdexec
uses: CustomExec # located in executor.py
```
jtypeString that is always set to either "Flow" or "Deployment", indicating the corresponding Python class.
versionString indicating the version of the Flow or Deployment.
withKeyword arguments are passed to a Flow's __init__() method. You can set Flow-specific arguments and Gateway-specific arguments here:
```{include} deployment-args.md
```
```{include} flow-args.md
```
##### Gateway arguments
These apply only to Flows, not Deployments
```{include} gateway-args.md
```
(executor-args)=
executorsCollection of Executors used in the Orchestration. In the case of a Deployment, this is a single Executor, while a Flow can have an arbitrary amount.
Each item in the collection specifies one Executor and can be used via:
```python
dep = Deployment(uses=MyExec, arg1="foo", arg2="bar")
```
```python
f = Flow().add(uses=MyExec, arg1="foo", arg2="bar")
```