Skip to content

Instantly share code, notes, and snippets.

@anna-geller
Created November 6, 2023 13:28
Show Gist options
  • Save anna-geller/c9b2b79f05e6cc68bb8015ce84878a96 to your computer and use it in GitHub Desktop.
Save anna-geller/c9b2b79f05e6cc68bb8015ce84878a96 to your computer and use it in GitHub Desktop.

Welcome to the Code Editor!

The embedded Visual Studio Code IDE lets you easily add custom scripts, queries, and configuration files along with your flow YAML configuration files.

Get started by selecting a namespace. If you type a name of a namespace that doesn't exist yet, kestra will create it for you at runtime.

Then, add a new file, e.g., a Python script. Try adding a folder named scripts and a file called hello.py with the following content:

print("Hello from the Editor!")

Once you added a file, you can use it in your flow. Try adding a new flow named hello.yml with the following content:

id: editor
namespace: dev

tasks:
  - id: hello
    type: io.kestra.plugin.scripts.python.Script
    script: "{{ read('scripts/hello.py') }}"

Finally, click on the Execute button to run your flow. You should see the friendly message Hello from the Editor! in the logs.

For more information about the Code Editor, check out the documentation.

Get an editable version of this file from this GitHub gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment