# Auto-completion for Workflows JSON and YAML on Visual Studio Code

Author: [Mete Atamel](https://atamel.dev/) | Published: 2022-01-28 | Topics: Workflows, Serverless, Google Cloud Platform, How To | Canonical: https://atamel.dev/posts/2022/01-28_auto_complete_workflows_vscode/


If you're like me, you probably use VS Code to author your Workflows JSON or
YAML. You also probably expect some kind syntax validation or auto-completion as
you work on your workflow. Unfortunately, there's no VS Code extension for
Workflows and [Cloud Code for VS
Code](https://cloud.google.com/code/docs/vscode) does not support Workflows.

However, there's a way to get **partial** auto-completion for Workflows in VS Code.

## VS Code and JSON Schema

VS Code has the ability to display auto-complete suggestions for JSON and YAML
files out of the box. It uses [JSON Schema Store](https://www.schemastore.org/json/)
which hosts [JSON Schemas](https://json-schema.org/) for popular configuration
files in JSON and YAML.

Thanks to [Grant Timmerman](https://twitter.com/granttimmerman), Workflows also
has its JSON Schema hosted there:

* Hosted: https://json.schemastore.org/workflows.json
* Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/workflows.json

This means that you can get VS Code auto-complete your Workflows files.

## Get VS Code recognize Workflows

To get VS Code auto-complete your Workflows files, first, you need a YAML
extension for VS Code. I used [Redhat
YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
extension.

Then, you need to name your workflow as `workflows.yaml` or `workflows.json` and
voila! Now, you should see auto-complete working for Workflows:

![Workflows Auto-complete in VS Code](/img/2022/workflows-auto-complete.png)

## Why is it partial?

Remember, I said **partial** auto-completion and the reason for that is the Workflows
schema is already out of date. It doesn't have some of the newer syntax. If
you're interested in seeing more syntax supported by the schema, please open issues in our
[workflows-samples](https://github.com/GoogleCloudPlatform/workflows-samples/issues)
repo and hopefully, we'll gradually add the full syntax, if there's enough
demand for it.

---

Feel free to reach out to me on Twitter [@meteatamel](https://twitter.com/meteatamel)
for any questions/feedback.

