### Install Kestra Go SDK Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/api-reference/kestra-sdk/go-sdk/index.md Install the Kestra Go SDK using the go get command. ```shell go get github.com/kestra-io/client-sdk/go-sdk ``` -------------------------------- ### Install pip Packages from requirements.txt using Git Clone Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/16.scripts/05.installing-dependencies/index.md This example clones a Git repository, displays the `requirements.txt` file, and then installs packages listed in it using `beforeCommands`. It then lists installed packages to verify. ```yaml id: python_requirements_file namespace: company.team tasks: - id: wdir type: io.kestra.plugin.core.flow.WorkingDirectory tasks: - id: cloneRepository type: io.kestra.plugin.git.Clone url: https://github.com/kestra-io/examples branch: main - id: print_requirements type: io.kestra.plugin.scripts.shell.Commands taskRunner: type: io.kestra.plugin.core.runner.Process commands: - cat requirements.txt - id: list_installed_packages type: io.kestra.plugin.scripts.python.Commands containerImage: python:3.11-slim beforeCommands: - pip install -r requirements.txt > /dev/null commands: - ls -lt $(python -c "import site; print(site.getsitepackages()[0])") | head -n 20 ``` -------------------------------- ### Install Go and Dependencies with Process Task Runner Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/16.scripts/05.installing-dependencies/index.md This snippet demonstrates how to install Go, set up the PATH, and fetch Go dependencies using `go mod` and `go get` before executing a Go script. It uses `wget` to download the Go binary and `tar` to extract it. ```yaml id: antelope_355074 namespace: company.team tasks: - id: script type: io.kestra.plugin.scripts.go.Script taskRunner: type: io.kestra.plugin.core.runner.Process beforeCommands: - wget -qO- https://go.dev/dl/go1.24.3.linux-amd64.tar.gz | tar -C /usr/local -xzf - && echo 'export PATH=$PATH:/usr/local/go/bin' > /etc/profile.d/golang.sh && export PATH=$PATH:/usr/local/go/bin - go mod init go_script - go get github.com/go-gota/gota/dataframe - go mod tidy script: | package main import ( "os" "github.com/go-gota/gota/dataframe" "github.com/go-gota/gota/series" ) func main() { names := series.New([]string{"Alice", "Bob", "Charlie"}, series.String, "Name") ages := series.New([]int{25, 30, 35}, series.Int, "Age") df := dataframe.New(names, ages) file, _ := os.Create("output.csv") df.WriteCSV(file) defer file.Close() } outputFiles: - output.csv ``` -------------------------------- ### Install Dependencies and Serve Kestra Docs Locally Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/04.contribute-to-kestra/04.docs-contributor-guide/index.mdx Install project dependencies and start a local development server with hot reloading for the Kestra documentation. Also includes commands for generating static pages and creating a production build. ```shell ## install dependencies npm install ## serve with hot reload at localhost:3001 npm run dev ## to generate static pages npm run generate ## making a production build npm run build ``` -------------------------------- ### Install and Run Kestra Docs Locally Source: https://github.com/kestra-io/docs/blob/main/README.md Commands to install dependencies and start the local development server for Kestra documentation. Requires Node.js and NPM. ```bash npm install npm run dev ``` -------------------------------- ### Install pip Dependencies at Server Startup (Standalone) Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/14.best-practices/4.managing-pip-dependencies/index.md For a standalone Kestra server, preinstall Python dependencies using pip before starting the server to avoid runtime installations. ```bash pip install requests pandas polars && ./kestra server standalone --worker-thread=16 ``` -------------------------------- ### Install and Run Kestra Server Source: https://github.com/kestra-io/docs/blob/main/src/contents/blogs/2024-04-05-getting-started-with-kestra/index.md Use this Docker command to start a local Kestra server instance. Ensure Docker is installed. Access the interface at https://localhost:8080. ```bash docker run --pull=always --rm -it -p 8080:8080 --user=root \ --name kestra \ -v kestra_data:/app/storage \ -v kestra_db:/app/data \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /tmp:/tmp \ kestra/kestra:latest server local ``` -------------------------------- ### Workflow with Inputs, Trigger, and Execution Variables Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/05.workflow-components/04.variables/index.md This example demonstrates how inputs, trigger, and execution variables are resolved before task variables. It shows a typical workflow for downloading, unzipping, and uploading a file to S3, using dynamic keys based on trigger or execution start dates. ```yaml id: upload_to_s3 namespace: company.team inputs: - id: bucket type: STRING defaults: declarative-data-orchestration tasks: - id: get_zip_file type: io.kestra.plugin.core.http.Download uri: https://wri-dataportal-prod.s3.amazonaws.com/manual/global_power_plant_database_v_1_3.zip - id: unzip type: io.kestra.plugin.compress.ArchiveDecompress algorithm: ZIP from: "{{outputs.get_zip_file.uri}}" - id: csv_upload type: io.kestra.plugin.aws.s3.Upload from: "{{ outputs.unzip.files['global_power_plant_database.csv'] }}" bucket: "{{ inputs.bucket }}" key: "powerplant/{{ trigger.date ?? execution.startDate | date('yyyy_MM_dd__HH_mm_ss') }}.csv" triggers: - id: hourly type: io.kestra.plugin.core.trigger.Schedule cron: "@hourly" ``` -------------------------------- ### Add Labels to a Kestra Flow Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/03.tutorial/01.fundamentals/index.md Enhance flow organization by adding key-value labels. This example includes a 'tag: Getting Started' label to the flow definition. ```yaml id: getting_started namespace: company.team labels: tag: Getting Started tasks: - id: hello_world type: io.kestra.plugin.core.log.Log message: Hello World! ``` -------------------------------- ### Getting Started with AIAgent for Data Analysis Source: https://github.com/kestra-io/docs/blob/main/src/contents/blogs/introducing-ai-agents/index.md This example demonstrates a basic AI Agent task for data analysis. It takes JSON data as input and uses a Google Gemini provider to analyze it based on a system message and a prompt. ```yaml id: analytics_agent namespace: company.ai inputs: - id: data type: JSON defaults: | [ {"region": "North America", "sales": 120000, "month": "September"}, {"region": "Europe", "sales": 95000, "month": "September"}, {"region": "Asia", "sales": 143000, "month": "September"} ] tasks: - id: agent type: io.kestra.plugin.ai.agent.AIAgent provider: type: io.kestra.plugin.ai.provider.GoogleGemini apiKey: "{{ secret('GEMINI_API_KEY') }}" modelName: gemini-2.5-flash systemMessage: You are an expert data analyst. Extract insights based on the provided data. prompt: "Analyze the following dataset: {{ inputs.data }}" ``` -------------------------------- ### Install Kestra Starter Chart Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/02.installation/03.kubernetes/index.md Install the kestra-starter Helm chart, which includes Kestra, PostgreSQL, and Versity. This is suitable for evaluation and quick experimentation. ```bash helm install my-kestra kestra/kestra-starter ``` -------------------------------- ### Enable and Start SSH Service Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/15.how-to-guides/ceph/index.md Installs the OpenSSH server, enables it to start on boot, and starts the service. This is required for cephadm to manage hosts. ```sh sudo apt install openssh-server sudo systemctl enable ssh sudo systemctl start ssh ``` -------------------------------- ### Start Kestra Webserver Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/kestra-cli/kestra-server/index.md Starts the Kestra webserver. Use `--no-tutorials` to disable auto-loading of tutorials. ```bash kestra server webserver --no-tutorials ``` -------------------------------- ### Kestra CLI Tenant Create Help Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/07.enterprise/02.governance/tenants/index.md View all available options and properties for creating a tenant using the Kestra CLI by running the help command. ```bash $ kestra tenants create --help Usage: kestra tenants create [-hVv] [--internal-log] [--admin-username=] [-c=] [-l=] [--name=] [-p=] [--tenant=] create a tenant and assign admin roles to an existing admin user --admin-username= Username of an existing admin user that will be admin of this tenant -c, --config= Path to a configuration file, default: /Users/anna/. kestra/config.yml) -h, --help Show this help message and exit. --internal-log Change also log level for internal log, default: false) -l, --log-level= Change log level (values: TRACE, DEBUG, INFO, WARN, ERROR; default: INFO) --name= tenant description -p, --plugins= Path to plugins directory , default: /Users/anna/dev/plugins) --tenant= tenant identifier -v, --verbose Change log level. Multiple -v options increase the verbosity. -V, --version Print version information and exit. ``` -------------------------------- ### Install Python Dependencies with beforeCommands Source: https://github.com/kestra-io/docs/blob/main/src/contents/blogs/release-0-23/index.md Use `beforeCommands` to install Python dependencies before script execution. This method is suitable for dynamic installations or when custom setup is required. ```yaml id: python namespace: company.team tasks: - id: python type: io.kestra.plugin.scripts.python.Script containerImage: ghcr.io/kestra-io/pydata:latest taskRunner: type: io.kestra.plugin.scripts.runner.docker.Docker beforeCommands: - pip install pandas script: | from kestra import Kestra import pandas as pd data = { 'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35] } df = pd.DataFrame(data) print(df) print("Average age:", df['Age'].mean()) Kestra.outputs({"average_age": df['Age'].mean()}) ``` -------------------------------- ### kestra_namespace_secret Example Source: https://github.com/kestra-io/docs/blob/main/content/docs/13.terraform/resources/namespace_secret.md This example shows how to declare a kestra_namespace_secret resource. Ensure you have the Enterprise Edition of Kestra installed and configured. ```hcl resource "kestra_namespace_secret" "example" { namespace = "company.team" secret_key = "MY_KEY" secret_value = "my-r34l-53cr37" } ``` -------------------------------- ### Install MinIO Client (mc) Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/15.how-to-guides/minio/index.md Download and install the MinIO Client (`mc`) tool for Linux. Ensure the executable is in your PATH. ```bash curl https://dl.min.io/client/mc/release/linux-amd64/mc --create-dirs -o $HOME/minio-binaries/mc && \ chmod +x $HOME/minio-binaries/mc && \ export PATH=$PATH:$HOME/minio-binaries/ ``` -------------------------------- ### Initialize and Start Podman Machine, Launch Kestra Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/02.installation/14.podman-compose/index.md Initialize a rootful Podman machine with specified resources and volumes, start it, and then launch Kestra using Podman Compose. Ensure volumes are mounted correctly for container access to local files. ```bash podman machine init --cpus 2 --rootful -v /tmp:/tmp -v $PWD:$PWD podman machine start podman compose up -d ``` -------------------------------- ### Install Podman Dependencies Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/02.installation/14.podman-compose/index.md Before initializing the Podman machine, install necessary dependencies like qemu and gvproxy. The specific package names vary by operating system. ```bash # MacOS brew install qemu # Debian / Ubuntu sudo apt install qemu-utils qemu-system-x86 virtiofsd # Fedora / CentOS / RHEL sudo dnf install qemu-img qemu-system-x86 podman-gvproxy virtiofsd # Arch Linux sudo pacman -S qemu qemu-system-x86 virtiofsd ``` -------------------------------- ### Example Complete Webhook URL Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/15.how-to-guides/notion-webhook/index.md An example of a complete Kestra webhook URL based on the flow defined in the guide. Ensure you replace `your-kestra-host` with your actual Kestra instance address. ```plaintext http://your-kestra-host:8080/api/v1/main/executions/webhook/company.team/notion-webhook/my-notion-product-alert-key ``` -------------------------------- ### Automate Plugin Installation in Docker Compose Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/15.how-to-guides/selected-plugin-installation/index.md This Docker Compose configuration installs specified plugins using `kestra plugins install` within the container's entrypoint before starting the Kestra server. It also mounts necessary volumes for Docker and storage. ```yaml services: kestra: image: kestra/kestra:latest-no-plugins entrypoint: "/bin/sh -c " kestra plugins install io.kestra.plugin:plugin-dbt:LATEST && \ kestra plugins install io.kestra.plugin:plugin-scripts:LATEST && \ kestra server standalone" volumes: - /var/run/docker.sock:/var/run/docker.sock - ./storage:/app/storage ``` -------------------------------- ### kestractl Configuration File Example Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/kestra-cli/kestractl/index.md An example of the kestractl configuration file (config.yaml) showing how contexts, hosts, tenants, and authentication methods are defined. This example uses API token authentication. ```yaml contexts: default: host: https://kestra.example.com tenant: production auth_method: token token: YOUR_TOKEN default_context: default ``` -------------------------------- ### Install Specific Plugins with Kestra Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/02.installation/13.windows/index.md Use this command to install only the necessary plugins for your Kestra setup. Replace `io.kestra.plugin:plugin-script-powershell:LATEST` and `io.kestra.plugin:plugin-script-python:LATEST` with the desired plugin identifiers. ```bat .\kestra.bat plugins install io.kestra.plugin:plugin-script-powershell:LATEST io.kestra.plugin:plugin-script-python:LATEST ``` -------------------------------- ### Start Kestra Local Dev Server Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/kestra-cli/kestra-server/index.md Starts a local development server for Kestra. ```bash kestra server local ``` -------------------------------- ### Add Kestra Plugins to Docker Image Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/02.installation/02.docker/index.md Installs specified Kestra plugins into a custom Docker image using the `kestra plugins install` command. Useful when starting from an image without plugins. ```dockerfile ARG IMAGE_TAG=latest-no-plugins FROM kestra/kestra:$IMAGE_TAG RUN /app/kestra plugins install \ io.kestra.plugin:plugin-aws:LATEST \ io.kestra.storage:storage-gcs:LATEST \ io.kestra.plugin:plugin-gcp:LATEST ``` -------------------------------- ### Prepare Working Directory Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/10.administrator-guide/custom-ca-kubernetes/index.md Create a directory to store SSL-related files and copy your self-signed certificate into it. ```bash mkdir ssl cp /path/to/self-signed-certificate.pem ./ssl/ ``` -------------------------------- ### Create a Tenant using Kestra API Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/07.enterprise/02.governance/tenants/index.md This example demonstrates how to create a tenant programmatically using a cURL command to interact with the Kestra API. ```bash curl -X POST "https://demo.kestra.io/api/v1/tenants" \ -H "accept: application/json" \ -H "Content-Type: application/json" \ -d "{ \"id\": \"stage\", \"name\": \"staging\", \"deleted\": false}" ``` -------------------------------- ### Full KV Store Example Flow Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/06.concepts/11.storage/index.md An example flow showcasing the Set, Get, and Delete tasks to manage data in Kestra's KV store, including updating and verifying deletions. ```yaml id: kv_store_example namespace: company.team tasks: - id: set_data type: io.kestra.plugin.core.kv.Set key: user_name value: John Doe - id: get_data type: io.kestra.plugin.core.kv.Get key: user_name - id: log_state type: io.kestra.plugin.core.log.Log message: "{{ kv('user_name') }}" - id: set_new_data type: io.kestra.plugin.core.kv.Set key: user_name value: Bob Smith - id: get_new_data type: io.kestra.plugin.core.kv.Get key: user_name - id: log_new_data type: io.kestra.plugin.core.log.Log message: "{{ kv('user_name') }}" - id: delete_data type: io.kestra.plugin.core.kv.Delete key: user_name - id: get_deleted_data type: io.kestra.plugin.core.kv.Get description: You will not get any data as the corresponding key is deleted in the earlier task. key: user_name ``` -------------------------------- ### Create a Hello World App Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/07.enterprise/04.scalability/apps/index.md Configure an app to trigger the 'myflow' and provide a user interface with markdown, an execution form, and a submit button. This app is PUBLIC, allowing anyone with the URL to access it. ```yaml id: hello_world_form type: io.kestra.plugin.ee.apps.Execution displayName: Hello World Form namespace: company.team flowId: myflow access: type: PUBLIC layout: - on: OPEN blocks: - type: io.kestra.plugin.ee.apps.core.blocks.Markdown content: | ## Say hello Enter a name and submit the form. - type: io.kestra.plugin.ee.apps.execution.blocks.CreateExecutionForm - type: io.kestra.plugin.ee.apps.execution.blocks.CreateExecutionButton text: Submit - on: SUCCESS blocks: - type: io.kestra.plugin.ee.apps.core.blocks.Alert style: SUCCESS showIcon: true content: Your request completed successfully. - type: io.kestra.plugin.ee.apps.execution.blocks.Logs ``` -------------------------------- ### Install Custom dbt Version and Run dbt Commands Source: https://github.com/kestra-io/docs/blob/main/src/contents/blogs/2024-04-02-dbt-kestra/index.md Install a specific dbt version using pip and then execute `dbt deps` and `dbt build` commands. This example uses a Python Docker image and `uv` for package management. ```yaml id: dbt_custom_dependencies namespace: company.team inputs: - id: dbt_version type: STRING defaults: "dbt-duckdb==1.6.0" tasks: - id: git type: io.kestra.plugin.core.flow.WorkingDirectory tasks: - id: clone_repository type: io.kestra.plugin.git.Clone url: https://github.com/kestra-io/dbt-example branch: main - id: dbt type: io.kestra.plugin.dbt.cli.DbtCLI runner: DOCKER docker: image: python:3.11-slim beforeCommands: - pip install uv - uv venv --quiet - . .venv/bin/activate --quiet - uv pip install --quiet {{ inputs.dbt_version }} commands: - dbt deps - dbt build profiles: | my_dbt_project: outputs: dev: type: duckdb path: ":memory:" fixed_retries: 1 threads: 16 timeout_seconds: 300 target: dev ``` -------------------------------- ### Expected certificate status output Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/10.administrator-guide/ssl-configuration/index.md Example output showing a successfully provisioned certificate. 'READY' indicates the certificate is valid and ready for use. ```plaintext NAME READY SECRET AGE kestra-tls True kestra-tls 5m ``` -------------------------------- ### Webhook Trigger Example Source: https://github.com/kestra-io/docs/blob/main/src/contents/resources/event-driven-orchestration/index.md Use this webhook trigger to start a workflow via HTTP POST requests. The request body and headers are accessible within the flow. ```yaml id: webhook_example namespace: company.team tasks: - id: log_payload type: io.kestra.plugin.core.log.Log message: "Received event: {{ trigger.body }}" triggers: - id: webhook type: io.kestra.plugin.core.trigger.Webhook key: "{{ secret('WEBHOOK_KEY') }}" ``` -------------------------------- ### Cache Python Dependencies Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/06.concepts/12.caching/index.md Cache Python dependencies for 24 hours using the WorkingDirectory task. This example installs the 'pandas' package into a 'deps' folder and caches it. ```yaml id: python_cached_dependencies namespace: company.team tasks: - id: working_dir type: io.kestra.plugin.core.flow.WorkingDirectory tasks: - id: python_script type: io.kestra.plugin.scripts.python.Script taskRunner: type: io.kestra.plugin.core.runner.Process beforeCommands: - pip install --target=./deps pandas env: PYTHONPATH: "./deps" script: | import pandas as pd print(pd.__version__) cache: patterns: - deps/** ttl: PT24H ``` -------------------------------- ### Simple CI/CD Pipeline Example in Kestra Source: https://github.com/kestra-io/docs/blob/main/src/contents/resources/ci-cd-orchestration/index.md This Kestra flow automates a build, test, and deploy process using Git, Shell commands, Docker, and Kubernetes plugins. ```yaml id: cicd-pipeline-example namespace: dev.cicd tasks: - id: clone-repo type: io.kestra.plugin.git.Clone url: https://github.com/your-org/your-app.git branch: main - id: build-and-test type: io.kestra.plugin.scripts.shell.Commands runner: DOCKER docker: image: maven:3.8-jdk-11 commands: - mvn clean install - id: build-image type: io.kestra.plugin.docker.Build dockerfile: "{{ workingDir }}/Dockerfile" imageTags: - your-repo/your-app:{{ flow.revision }} - id: deploy type: io.kestra.plugin.kubernetes.Apply manifest: | apiVersion: apps/v1 kind: Deployment metadata: name: your-app-deployment spec: replicas: 3 template: spec: containers: - name: your-app image: your-repo/your-app:{{ flow.revision }} ``` -------------------------------- ### Cache Node.js Dependencies Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/06.concepts/12.caching/index.md Cache Node.js dependencies for one hour using the WorkingDirectory task. This example installs the 'colors' package and caches the 'node_modules' folder. ```yaml id: node_cached_dependencies namespace: company.team tasks: - id: working_dir type: io.kestra.plugin.core.flow.WorkingDirectory cache: patterns: - node_modules/** ttl: PT1H tasks: - id: node_script type: io.kestra.plugin.scripts.node.Script beforeCommands: - npm install colors script: | const colors = require("colors"); console.log(colors.red("Hello")); ``` -------------------------------- ### Start React Development Server Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/15.how-to-guides/js-webhook/index.md Start the development server for the React application. This command compiles the code and launches the app in the browser. ```bash npm start ``` -------------------------------- ### kestra_user_password Example Source: https://github.com/kestra-io/docs/blob/main/content/docs/13.terraform/resources/user_password.md This snippet shows how to configure a kestra_user_password resource to manage a user's password. Ensure you have the Kestra Enterprise Edition installed as this resource is only available there. ```hcl resource "kestra_user_password" "example" { user_id = "4by6NvSLcPXFhCj8nwbZOM" password = "my-random-password" } ``` -------------------------------- ### Create a Tenant and Assign Admin Role (EE) Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/kestra-cli/kestra-server/index.md Creates a new tenant with a specified ID and name, and assigns an existing admin user as the administrator for this new tenant. ```bash kestra tenants create tenantA "Tenant A" --admin-username alice ``` -------------------------------- ### List Plugins in Docker and Standalone Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/kestra-cli/kestra-server/index.md Demonstrates how to list Kestra plugins using the CLI in both Docker container and standalone binary installations. ```bash # Docker container docker exec -it kestra /app/kestra plugins list ``` ```bash # Standalone binary ./kestra-VERSION plugins list ``` -------------------------------- ### Get Execution Information Source: https://github.com/kestra-io/docs/blob/main/src/contents/docs/15.how-to-guides/api/index.md Retrieve detailed information about a specific execution, including its state, duration, start and end dates, and outputs. This is useful for monitoring and debugging. ```json { "executionId": "59uQXHbkMy5YwHEDom72Xv", "flowId": "my-flow", "flowRevision": 1, "namespace": "my-namespace", "id": "59uQXHbkMy5YwHEDom72Xv", "taskId": "my-task", "taskRunId": "59uQXHbkMy5YwHEDom72Xv", "taskRunAttemptNumber": 1, "childExecutions": [ { "executionId": "59uQXHbkMy5YwHEDom72Xv", "flowId": "my-flow", "flowRevision": 1, "namespace": "my-namespace", "id": "59uQXHbkMy5YwHEDom72Xv", "taskId": "my-sub-task", "taskRunId": "59uQXHbkMy5YwHEDom72Xv", "taskRunAttemptNumber": 1, "state": { "current": "SUCCESS", "histories": [ { "state": "CREATED", "date": "2024-11-21T17:09:40.937Z" }, { "state": "RUNNING", "date": "2024-11-21T17:09:41.967Z" }, { "state": "SUCCESS", "date": "2024-11-21T17:09:42.053Z" } ], "duration": 1.116000000, "startDate": "2024-11-21T17:09:40.937Z", "endDate": "2024-11-21T17:09:42.053Z" } } ], "outputs": { "value": "This is an output" }, "state": { "current": "SUCCESS", "histories": [ { "state": "CREATED", "date": "2024-11-21T17:09:40.937Z" }, { "state": "RUNNING", "date": "2024-11-21T17:09:41.967Z" }, { "state": "SUCCESS", "date": "2024-11-21T17:09:42.053Z" } ], "duration": 1.116000000, "startDate": "2024-11-21T17:09:40.937Z", "endDate": "2024-11-21T17:09:42.053Z" } } ], "labels": [ { "key": "system.correlationId", "value": "59uQXHbkMy5YwHEDom72Xv" } ], "state": { "current": "SUCCESS", "histories": [ { "state": "CREATED", "date": "2024-11-21T17:09:40.204Z" }, { "state": "RUNNING", "date": "2024-11-21T17:09:40.942Z" }, { "state": "SUCCESS", "date": "2024-11-21T17:09:42.994Z" } ], "duration": 2.790000000, "startDate": "2024-11-21T17:09:40.204Z", "endDate": "2024-11-21T17:09:42.994Z" }, "originalId": "59uQXHbkMy5YwHEDom72Xv", "deleted": false, "metadata": { "attemptNumber": 1, "originalCreatedDate": "2024-11-21T17:09:40.204Z" }, "scheduleDate": "2024-11-21T17:09:40.181Z" } ``` -------------------------------- ### Install Nginx Software with Kestra Source: https://github.com/kestra-io/docs/blob/main/src/contents/blogs/assets-for-infra-automation/index.md This flow simulates installing Nginx on a VM using a log task and creates an Ingress asset. It tracks software inventory and potential reuse. The VM is marked as an input asset. ```yaml id: install_software namespace: company.team labels: - key: feature value: assets inputs: - id: target_vm type: STRING defaults: "windows-web-01" tasks: - id: choco_install_nginx type: io.kestra.plugin.core.log.Log message: "choco install nginx -y" assets: inputs: - id: "{{ inputs.target_vm | slugify }}" outputs: - id: "{{ 'nginx-' ~ execution.id }}" type: io.kestra.plugin.ee.assets.VM.Ingress metadata: version: "1.24.0" installed_on: "{{ inputs.target_vm }}" vm: "{{ inputs.target_vm }}" type: nginx ```